Create a refund
Initiate a refund for a card transfer.
To use this endpoint from the browser, you’ll need to specify the
/accounts/{accountID}/transfers.write
scope when generating a token.
POST
/transfers/{transferID}/refunds
|
|
|
|
|
|
Successfully initiated a card refund.
{
"amount": {
"currency": "USD",
"value": 1204
},
"createdOn": "2023-09-09T14:15:22Z",
"refundID": "d4963079-5b35-4d17-981e-8f851753f786"
}
{
"amount": {
"currency": "USD",
"value": 1204
},
"cardDetails": {
"failedOn": "2023-09-09T14:15:59Z",
"initiatedOn": "2023-09-09T14:15:38Z",
"status": "failed"
},
"createdOn": "2023-09-09T14:15:22Z",
"failureCode": "insufficient-funds",
"refundID": "d4963079-5b35-4d17-981e-8f851753f786",
"status": "failed",
"updatedOn": "2023-09-09T14:15:59Z"
}
{
"amount": {
"currency": "USD",
"value": 1204
},
"cardDetails": {
"confirmedOn": "2023-09-09T14:17:41Z",
"initiatedOn": "2023-09-09T14:16:22Z",
"status": "confirmed"
},
"createdOn": "2023-09-09T14:15:22Z",
"refundID": "d4963079-5b35-4d17-981e-8f851753f786",
"status": "pending",
"updatedOn": "2023-09-09T14:17:41Z"
}
A refund was successfully created but an error occurred while waiting for a synchronous response.
{
"amount": {
"currency": "USD",
"value": 1204
},
"createdOn": "2023-09-09T14:15:22Z",
"refundID": "d4963079-5b35-4d17-981e-8f851753f786",
"status": "created",
"updatedOn": "2023-09-09T14:15:22Z"
}
Invalid request, an error message will be available in the response body.
Response for http requests that failed
{
"error": "example error message"
}
Attempted to initiate a refund using a duplicate X-Idempotency-Key header.
Details of a card refund.
{
"amount": {
"currency": "USD",
"value": 1204
},
"cardDetails": {
"completedOn": "2019-08-24T14:15:22Z",
"confirmedOn": "2019-08-24T14:15:22Z",
"failedOn": "2019-08-24T14:15:22Z",
"failureCode": "call-issuer",
"initiatedOn": "2019-08-24T14:15:22Z",
"settledOn": "2019-08-24T14:15:22Z",
"status": "initiated"
},
"createdOn": "2019-08-24T14:15:22Z",
"failureCode": "call-issuer",
"refundID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
"status": "failed",
"updatedOn": "2019-08-24T14:15:22Z"
}
The request body could not be processed.
Request was refused due to rate limiting.
Response headers
X-Retry-In
string
<duration>
How long (in milliseconds) to wait until able to retry the request.
Headers
X-Idempotency-Key
string
<uuid>
required
Prevents duplicate refunds from being created. Note that we only accept UUID v4.
X-Wait-For
string
Optional header that indicates whether to return a synchronous response that includes the full refund and card transaction details or an asynchronous response indicating the refund was created (this is the default response if the header is omitted).
Possible values:
rail-response
Path parameters
transferID
string
<uuid>
required
Identifier for the transfer.
Body
application/json
amount
integer<int64>
Amount to refund in cents. If null, the original transfer’s full amount will be refunded.
Response
application/json
amount
object
An integer value representing money in a specific currency.
Show child attributes
currency
string
<=3 characters
Pattern
A 3-letter ISO 4217 currency code.
value
integer<int64>
Quantity in the smallest unit of the specified currency. In USD this is cents, for example, $12.04 is 1204 and $0.99 is 99.
createdOn
string<date-time>
<=24 characters
refundID
string<uuid>
<=36 characters
Pattern
UUID v4
Details of a card refund.
amount
object
An integer value representing money in a specific currency.
Show child attributes
currency
string
<=3 characters
Pattern
A 3-letter ISO 4217 currency code.
value
integer<int64>
Quantity in the smallest unit of the specified currency. In USD this is cents, for example, $12.04 is 1204 and $0.99 is 99.
cardDetails
object
Show child attributes
completedOn
string<date-time>
<=24 characters
confirmedOn
string<date-time>
<=24 characters
failedOn
string<date-time>
<=24 characters
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
,
unknown-issue
,
duplicate-transaction
initiatedOn
string<date-time>
<=24 characters
settledOn
string<date-time>
<=24 characters
status
string<enum>
Status of the refund.
Possible values:
initiated
,
confirmed
,
settled
,
failed
,
completed
createdOn
string<date-time>
<=24 characters
failureCode
string
deprecated
This field is deprecated and will be removed in December 2023.
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
,
unknown-issue
,
duplicate-transaction
refundID
string<uuid>
<=36 characters
Pattern
UUID v4
status
string<enum>
Possible values:
created
,
pending
,
completed
,
failed
updatedOn
string<date-time>
<=24 characters