postChargesChargeRefundsRefund
Update a specified refund.
Details
- Method:
POST - Path:
/v1/charges/{charge}/refunds/{refund} - Operation ID:
PostChargesChargeRefundsRefund
Parameters
{
"charge": {
"description": "",
"required": true,
"location": "path",
"type": "string"
},
"refund": {
"description": "",
"required": true,
"location": "path",
"type": "string"
}
}Response Schema
{
"description": "Refund objects allow you to refund a previously created charge that isn't\nrefunded yet. Funds are refunded to the credit or debit card that's\ninitially charged.\n\nRelated guide: [Refunds](https://docs.stripe.com/refunds)",
"properties": {
"amount": {
"description": "Amount, in cents (or local equivalent).",
"type": "integer"
},
"balance_transaction": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/balance_transaction"
}
],
"description": "Balance transaction that describes the impact on your account balance.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/balance_transaction"
}
]
}
},
"charge": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/charge"
}
],
"description": "ID of the charge that's refunded.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/charge"
}
]
}
},
"created": {
"description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
"format": "unix-time",
"type": "integer"
},
"currency": {
"description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).",
"format": "currency",
"type": "string"
},
"description": {
"description": "An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only).",
"maxLength": 5000,
"type": "string"
},
"destination_details": {
"description": "",
"properties": {
"affirm": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"afterpay_clearpay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"alipay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"alma": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"amazon_pay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"au_bank_transfer": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"blik": {
"description": "",
"properties": {
"network_decline_code": {
"description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_blik",
"type": "object",
"x-expandableFields": []
},
"br_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_br_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"card": {
"description": "",
"properties": {
"reference": {
"description": "Value of the reference number assigned to the refund.",
"maxLength": 5000,
"type": "string"
},
"reference_status": {
"description": "Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"type": "string"
},
"reference_type": {
"description": "Type of the reference number assigned to the refund.",
"maxLength": 5000,
"type": "string"
},
"type": {
"description": "The type of refund. This can be `refund`, `reversal`, or `pending`.",
"enum": [
"pending",
"refund",
"reversal"
],
"type": "string"
}
},
"required": [
"type"
],
"title": "refund_destination_details_card",
"type": "object",
"x-expandableFields": []
},
"cashapp": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"crypto": {
"description": "",
"properties": {
"reference": {
"description": "The transaction hash of the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_crypto",
"type": "object",
"x-expandableFields": []
},
"customer_cash_balance": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"eps": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"eu_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_eu_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"gb_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_gb_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"giropay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"grabpay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"jp_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_jp_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"klarna": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"mb_way": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_mb_way",
"type": "object",
"x-expandableFields": []
},
"multibanco": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_multibanco",
"type": "object",
"x-expandableFields": []
},
"mx_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_mx_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"nz_bank_transfer": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"p24": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_p24",
"type": "object",
"x-expandableFields": []
},
"paynow": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"paypal": {
"description": "",
"properties": {
"network_decline_code": {
"description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_paypal",
"type": "object",
"x-expandableFields": []
},
"pix": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"revolut": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"sofort": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"swish": {
"description": "",
"properties": {
"network_decline_code": {
"description": "For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_swish",
"type": "object",
"x-expandableFields": []
},
"th_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_th_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"twint": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"type": {
"description": "The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction.",
"maxLength": 5000,
"type": "string"
},
"us_bank_transfer": {
"description": "",
"properties": {
"reference": {
"description": "The reference assigned to the refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"reference_status": {
"description": "Status of the reference on the refund. This can be `pending`, `available` or `unavailable`.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"title": "refund_destination_details_us_bank_transfer",
"type": "object",
"x-expandableFields": []
},
"wechat_pay": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
},
"zip": {
"description": "",
"properties": {},
"title": "destination_details_unimplemented",
"type": "object",
"x-expandableFields": []
}
},
"required": [
"type"
],
"title": "refund_destination_details",
"type": "object",
"x-expandableFields": [
"affirm",
"afterpay_clearpay",
"alipay",
"alma",
"amazon_pay",
"au_bank_transfer",
"blik",
"br_bank_transfer",
"card",
"cashapp",
"crypto",
"customer_cash_balance",
"eps",
"eu_bank_transfer",
"gb_bank_transfer",
"giropay",
"grabpay",
"jp_bank_transfer",
"klarna",
"mb_way",
"multibanco",
"mx_bank_transfer",
"nz_bank_transfer",
"p24",
"paynow",
"paypal",
"pix",
"revolut",
"sofort",
"swish",
"th_bank_transfer",
"twint",
"us_bank_transfer",
"wechat_pay",
"zip"
]
},
"failure_balance_transaction": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/balance_transaction"
}
],
"description": "After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.",
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/balance_transaction"
}
]
}
},
"failure_reason": {
"description": "Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`.",
"maxLength": 5000,
"type": "string"
},
"id": {
"description": "Unique identifier for the object.",
"maxLength": 5000,
"type": "string"
},
"instructions_email": {
"description": "For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.",
"maxLength": 5000,
"type": "string"
},
"metadata": {
"additionalProperties": {
"maxLength": 500,
"type": "string"
},
"description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
"nullable": true,
"type": "object"
},
"next_action": {
"description": "",
"properties": {
"display_details": {
"description": "",
"properties": {
"email_sent": {
"description": "",
"properties": {
"email_sent_at": {
"description": "The timestamp when the email was sent.",
"format": "unix-time",
"type": "integer"
},
"email_sent_to": {
"description": "The recipient's email address.",
"maxLength": 5000,
"type": "string"
}
},
"required": [
"email_sent_at",
"email_sent_to"
],
"title": "EmailSent",
"type": "object",
"x-expandableFields": []
},
"expires_at": {
"description": "The expiry timestamp.",
"format": "unix-time",
"type": "integer"
}
},
"required": [
"email_sent",
"expires_at"
],
"title": "RefundNextActionDisplayDetails",
"type": "object",
"x-expandableFields": [
"email_sent"
]
},
"type": {
"description": "Type of the next action to perform.",
"maxLength": 5000,
"type": "string"
}
},
"required": [
"type"
],
"title": "RefundNextAction",
"type": "object",
"x-expandableFields": [
"display_details"
]
},
"object": {
"description": "String representing the object's type. Objects of the same type share the same value.",
"enum": [
"refund"
],
"type": "string"
},
"payment_intent": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/payment_intent"
}
],
"description": "ID of the PaymentIntent that's refunded.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/payment_intent"
}
]
}
},
"pending_reason": {
"description": "Provides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`.",
"enum": [
"charge_pending",
"insufficient_funds",
"processing"
],
"type": "string"
},
"presentment_details": {
"description": "",
"properties": {
"presentment_amount": {
"description": "Amount intended to be collected by this payment, denominated in `presentment_currency`.",
"type": "integer"
},
"presentment_currency": {
"description": "Currency presented to the customer during payment.",
"maxLength": 5000,
"type": "string"
}
},
"required": [
"presentment_amount",
"presentment_currency"
],
"title": "PaymentFlowsPaymentIntentPresentmentDetails",
"type": "object",
"x-expandableFields": []
},
"reason": {
"description": "Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).",
"enum": [
"duplicate",
"expired_uncaptured_charge",
"fraudulent",
"requested_by_customer"
],
"nullable": true,
"type": "string",
"x-stripeBypassValidation": true
},
"receipt_number": {
"description": "This is the transaction number that appears on email receipts sent for this refund.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"source_transfer_reversal": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/transfer_reversal"
}
],
"description": "The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/transfer_reversal"
}
]
}
},
"status": {
"description": "Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://docs.stripe.com/refunds#failed-refunds).",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"transfer_reversal": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/transfer_reversal"
}
],
"description": "This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/transfer_reversal"
}
]
}
}
},
"required": [
"amount",
"created",
"currency",
"id",
"object"
],
"title": "Refund",
"type": "object",
"x-expandableFields": [
"balance_transaction",
"charge",
"destination_details",
"failure_balance_transaction",
"next_action",
"payment_intent",
"presentment_details",
"source_transfer_reversal",
"transfer_reversal"
],
"x-resourceId": "refund"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('stripe')
# Call this tool
result = await agent.call_tool('postChargesChargeRefundsRefund', {
# Add required parameters here
})