Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged.
This request only accepts metadata
as an argument.
Parameters
- metadataobject
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
Returns
Returns the refund object if the update succeeds. This call raises an error if update parameters are invalid.
{ "id": "re_1Nispe2eZvKYlo2Cd31jOCgZ", "object": "refund", "amount": 1000, "balance_transaction": "txn_1Nispe2eZvKYlo2CYezqFhEx", "charge": "ch_1NirD82eZvKYlo2CIvbtLWuY", "created": 1692942318, "currency": "usd", "destination_details": { "card": { "reference": "123456789012", "reference_status": "available", "reference_type": "acquirer_reference_number", "type": "refund" }, "type": "card" }, "metadata": { "order_id": "6735" }, "payment_intent": "pi_1GszsK2eZvKYlo2CfhZyoZLp", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null}
Retrieves the details of an existing refund.
Parameters
No parameters.
Returns
Returns a refund if you provide a valid ID. Raises an error otherwise.
{ "id": "re_1Nispe2eZvKYlo2Cd31jOCgZ", "object": "refund", "amount": 1000, "balance_transaction": "txn_1Nispe2eZvKYlo2CYezqFhEx", "charge": "ch_1NirD82eZvKYlo2CIvbtLWuY", "created": 1692942318, "currency": "usd", "destination_details": { "card": { "reference": "123456789012", "reference_status": "available", "reference_type": "acquirer_reference_number", "type": "refund" }, "type": "card" }, "metadata": {}, "payment_intent": "pi_1GszsK2eZvKYlo2CfhZyoZLp", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null}
Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.
Parameters
- chargestring
Only return refunds for the charge specified by this charge ID.
- payment_
intentstring Only return refunds for the PaymentIntent specified by this ID.
More parameters
- createdobject
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
refunds, starting after the starting_
refund. Each entry in the array is a separate Refund object. If no other refunds are available, the resulting array is empty. If you provide a non-existent charge ID, this call raises an error.
{ "object": "list", "url": "/v1/refunds", "has_more": false, "data": [ { "id": "re_1Nispe2eZvKYlo2Cd31jOCgZ", "object": "refund", "amount": 1000, "balance_transaction": "txn_1Nispe2eZvKYlo2CYezqFhEx", "charge": "ch_1NirD82eZvKYlo2CIvbtLWuY", "created": 1692942318, "currency": "usd", "destination_details": { "card": { "reference": "123456789012", "reference_status": "available", "reference_type": "acquirer_reference_number", "type": "refund" }, "type": "card" }, "metadata": {}, "payment_intent": "pi_1GszsK2eZvKYlo2CfhZyoZLp", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null } ]}
Cancels a refund with a status of requires_
.
You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_
state.
Parameters
No parameters.
Returns
Returns the refund object if the cancellation succeeds. This call raises an error if you can’t cancel the refund.
{ "id": "re_1Nispe2eZvKYlo2Cd31jOCgZ", "object": "refund", "amount": 1000, "balance_transaction": "txn_1Nispe2eZvKYlo2CYezqFhEx", "charge": "ch_1NirD82eZvKYlo2CIvbtLWuY", "created": 1692942318, "currency": "usd", "failure_balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy", "failure_reason": "merchant_request", "metadata": {}, "payment_intent": "pi_1GszsK2eZvKYlo2CfhZyoZLp", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "canceled", "transfer_reversal": null}
ConfirmationTokens help transport client side data collected by Stripe JS over to your server for confirming a PaymentIntent or SetupIntent. If the confirmation is successful, values present on the ConfirmationToken are written onto the Intent.
To learn more about how to use ConfirmationToken, visit the related guides: