Create a refund
POST
/accounts/{accountID}/transfers/{transferID}/refunds
Initiate a refund for a card transfer.
The accountID must identify the partner account for the transfer.
Use the Cancel or refund a card transfer endpoint for more comprehensive cancel and refund options.
See the reversals guide for more information.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/transfers.write scope.
curl -X POST "https://api.moov.io/accounts/{accountID}/transfers/{transferID}/refunds" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2027.01.00" \
-H "X-Idempotency-Key: 7d8f2a64-4b1e-4c3a-9f2d-1e5b6c7a8d90"mc, _ := moov.NewClient()
var accountID string
var transferID string
mc.RefundTransfer(ctx, accountID, transferID, moov.CreateRefund{
Amount: 1700,
})
The request completed successfully.
{
"refundID": "d4963079-5b35-4d17-981e-8f851753f786",
"createdOn": "2023-09-09T14:15:22Z",
"amount": {
"currency": "USD",
"valueDecimal": "12.04"
}
}{
"refundID": "d4963079-5b35-4d17-981e-8f851753f786",
"createdOn": "2023-09-09T14:15:22Z",
"updatedOn": "2023-09-09T14:17:41Z",
"status": "pending",
"amount": {
"currency": "USD",
"valueDecimal": "12.04"
},
"processingDetails": {}
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
A refund was successfully created but an error occurred while waiting for a synchronous response.
Details of a card refund.
{
"refundID": "string",
"createdOn": "2019-08-24T14:15:22Z",
"updatedOn": "2019-08-24T14:15:22Z",
"status": "created",
"amount": {
"currency": "USD",
"valueDecimal": "12.987654321"
},
"captureID": "string",
"amountDetails": {
"surcharge": {
"currency": "USD",
"valueDecimal": "12.987654321"
}
},
"processingDetails": {
"cardPayment": {
"networkTransactionID": "string",
"failureCode": "call-issuer"
}
}
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
{
"error": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The requested resource was not found.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Attempted to create a refund using a duplicate X-Idempotency-Key header.
Details of a card refund.
{
"refundID": "string",
"createdOn": "2019-08-24T14:15:22Z",
"updatedOn": "2019-08-24T14:15:22Z",
"status": "created",
"amount": {
"currency": "USD",
"valueDecimal": "12.987654321"
},
"captureID": "string",
"amountDetails": {
"surcharge": {
"currency": "USD",
"valueDecimal": "12.987654321"
}
},
"processingDetails": {
"cardPayment": {
"networkTransactionID": "string",
"failureCode": "call-issuer"
}
}
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
{
"amount": "string",
"amountDetails": {
"surcharge": "string"
},
"error": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Request was refused due to rate limiting.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed due to an unexpected error.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Headers
X-Moov-Version
string
Set this header to v2027.01.00 to use the API described in this specification.
When omitted, the server defaults to v2024.01.00, the earliest supported version, which may not match the behavior documented here.
An unrecognized well-formed version uses the latest supported version that is not newer than the requested version, when one exists.
For example,
v2026.08.00 uses v2026.07.00.
A malformed value, such as 2022, returns a 404 response.
Possible values:
v2027.01.00
x-wait-for
string
Optional header that indicates whether to return a synchronous response that includes full transfer and rail-specific details or an
asynchronous response indicating the transfer was created (this is the default response if the header is omitted). A timeout will occur after 15 seconds.
Possible values:
rail-response
Path parameters
Body
application/json
Specifies a partial amount to refund.
Before v2026.10, this request body may be omitted. In v2026.10 and later, send an empty object to refund the full amount of the original transfer.
amountDetails
object
Breakdown of the refunded amount.
captureID
string
ID of the capture to refund. This field is only relevant for an auth-capture
card-payment transfer.
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).
Response
Details of a card refund.
amountDetails
object
captureID
string
ID of the capture refunded for an auth-capture
card-payment transfer.
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).
processingDetails
object
Show child attributes
processingDetails
cardPayment
object
Show child attributes
processingDetails.cardPayment
failureCode
string<enum>
Possible values:
call-issuer,
do-not-honor,
processing-error,
invalid-transaction,
invalid-amount,
no-such-issuer,
reenter-transaction,
cvv-mismatch,
lost-or-stolen,
insufficient-funds,
invalid-card-number,
invalid-merchant,
expired-card,
incorrect-pin,
transaction-not-allowed,
suspected-fraud,
amount-limit-exceeded,
velocity-limit-exceeded,
revocation-of-authorization,
card-not-activated,
issuer-not-available,
could-not-route,
cardholder-account-closed,
account-closed,
account-not-activated,
authentication-failed,
authentication-required,
cardholder-action-required,
format-error,
invalid-pin,
offline-approved,
offline-declined,
partial-approval,
payment-stopped,
pin-required,
record-not-found,
surcharge-not-permitted,
transaction-reversed,
verification-failed,
unknown-issue,
duplicate-transaction
Asynchronous refund response
amountDetails
object