Cancel or refund a card transfer
POST
/accounts/{accountID}/transfers/{transferID}/reversals
Reverses a card transfer by initiating a cancellation or refund depending on the transaction status.
In v2026.10 and later, reversing an auth-capture card-payment transfer with no captures cancels the entire capturableAmount.
In those API versions, an auth-capture card-payment transfer with one final capture is canceled or refunded depending on its processing state.
Auth-capture card-payment transfers with a non-final capture or multiple captures are not supported in those API versions.
Read our reversals guide
to learn more.
To access this endpoint using a token you'll need
to specify the /accounts/{accountID}/transfers.write scope.
curl -X POST "https://api.moov.io/accounts/{accountID}/transfers/{transferID}/reversals" \
-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 // Partner account
var transferID string
// Idempotency Key is a unique identifier for this Transfer request
// Using the github.com/google/uuid library:
idempotencyKey := moov.WithReversalsIdempotencyKey(uuid.New())
mc.ReverseTransfer(ctx, accountID, transferID, moov.CreateReversal{
Amount: 1000,
}, idempotencyKey)
Successfully initiated a reversal.
{
"cancellation": {
"cancellationID": "89ca7f54-13ba-4714-b9af-17163eae2057",
"status": "completed",
"createdOn": "2025-01-19T03:02:43.255309588Z"
}
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Successfully initiated a reversal but an error occurred while waiting for a synchronous response.
Contains either a cancellation or refund, depending on the method used to reverse the transfer.
{
"cancellation": {
"cancellationID": "string",
"status": "pending",
"createdOn": "2019-08-24T14:15:22Z"
}
}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 request contained missing or expired authentication.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The user is not authorized to make the request.
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.
The request conflicted with the current state of the target resource.
{
"error": "string"
}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"
}
}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
Path parameters
Body
application/json
amount
object
Amount to reverse. In v2026.10 and later, if omitted, the original transfer's full amount will be reversed.
Before v2026.10, specify the amount in integer cents.
For supported auth-capture
card-payment reversals in v2026.10 and later, a transfer with no captures uses the full capturableAmount.
For those transfers with one final capture, a cancellation uses the full capture amount, while a refund may be partial.
Response
refund
object
Details of a card refund.
Show child attributes
refund
processingDetails
object
required
Show child attributes
refund.processingDetails
cardPayment
object
Show child attributes
refund.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