Refund a transaction
Asks the source's endpoint to refund a recorded charge, for amount or all that is left of it, then records the refund it answers with and returns it, under the source's id for the refund.
Only a payment source records purchases.
Guide: Payment sources
Errors
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request | invalid_transaction | When the refund answered cannot be recorded, which records nothing. |
| 400 | invalid_request | payment_source_required | For a store. |
| 404 | not_found | transaction_not_found | When the charge is not recorded. |
| 404 | not_found | payment_provider_not_found | For an unknown provider. |
| 409 | conflict | payment_source_disabled | For a disabled source. |
| 409 | conflict | payment_source_endpoint_not_configured | When the source's endpoint is not configured, does not support the action or refuses it. |
| 409 | conflict | payment_source_endpoint_unsupported | When the source's endpoint is not configured, does not support the action or refuses it. |
| 409 | conflict | payment_source_endpoint_rejected | When the source's endpoint is not configured, does not support the action or refuses it. |
| 503 | unavailable | payment_source_endpoint_unavailable | When it does not answer or answers outside the protocol; the message says why. |
| 503 | unavailable | payment_source_endpoint_invalid_response | When it does not answer or answers outside the protocol; the message says why. |
It can also fail with the errors every operation shares, such as unauthenticated; see Errors.
More in Payment sources
Something wrong or missing on this page? Tell us by email or on Discord.