Refunds
The Refund API allows you to refund a succeeded payment back to the payment method used by your customer. The refund amount must be equal to or less than the amount specified in the original PaymentIntent/PaymentAttempt.
Multiple Refunds can be created until the full amount is refunded.
Data Retention Policy: You can query Refund resources for a maximum of 2 years since creation.
POST /api/v1/pa/refunds/createGET /api/v1/pa/refunds/{id}GET /api/v1/pa/refunds
Create a refund
POST /api/v1/pa/refunds/create
Create a Refund against a PaymentIntent/PaymentAttempt.
Amount of the Refund. If not specified, it will be same as the remaining amount that has been captured but not yet refunded. Please refer to supported currencies for supported minor units.
A set of key-value pairs that you can attach to the Refund. You can specify up to 50 keys with key names up to 50 characters long and values up to 500 characters long.
PaymentAttempt unique identifier against which this Refund is created. Either this or the payment_intent_id must be provided.
PaymentIntent unique identifier against which this Refund is created. Either this or the payment_attempt_id must be provided.
Reason of the Refund. Maximum length is 128.
Unique request identifier specified by the merchant. Maximum length is 64.
A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank.
Amount of the Refund
Time at which the Refund was created
Currency of the Refund
Failure details. Only applicable when status is FAILED.
The failure code returned by Airwallex
Additional details that may include original_response_code, original_response_message from provider, and other contextual information such as card details, risk factors, etc. depending on the specific error code.
The failure description.
The unique identifier for tracing the failure.
Unique identifier for the Refund
A set of key-value pairs that you can attach to the Refund. You can specify up to 50 keys with key names up to 50 characters long and values up to 500 characters long.
Unique identifier of PaymentAttempt on which the Refund is created
Unique identifier of PaymentIntent on which the Refund is created
Reason of the Refund
Unique request identifier specified by the merchant in the last operation
Status of the Refund. One of RECEIVED, ACCEPTED, SETTLED or FAILED
- RECEIVED: The Refund is created, which means the requested refund amount is valid and the payment is not in dispute.
- ACCEPTED: The Refund has been accepted by the payment method provider and can be considered completed.
- SETTLED: The Refund has been reconciled and will show up in the Airwallex settlement report.
- FAILED: The Refund has been rejected, which can be caused by the insufficient Airwallex receivable/available balance, or by the provider for more channel-specific reasons.
Last time at which the Refund was updated
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/refunds/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "payment_attempt_id": "att_hkpdskz7vg1xc7uscdj",> "reason": "Return goods",> "amount": 10,> "request_id": "962dbd83-5e7b-4185-b668-596834395c12">}'
1{2 "id": "rfd_hkpdbybkch3ovunwjy1_1raukh",3 "request_id": "962dbd83-5e7b-4185-b668-596834395c12",4 "payment_intent_id": "int_hkpdskz7vg1xc7uscdj",5 "payment_attempt_id": "att_hkpdskz7vg1xc7uscdj",6 "amount": 10,7 "currency": "USD",8 "reason": "Return goods",9 "status": "RECEIVED",10 "created_at": "2021-01-31T06:57:10+00:00",11 "updated_at": "2021-01-31T07:01:10+00:00"12}
Retrieve a refund
GET /api/v1/pa/refunds/{id}
Retrieve a Refund by unique identifier
Refund unique identifier
A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank.
Amount of the Refund
Time at which the Refund was created
Currency of the Refund
Failure details. Only applicable when status is FAILED.
The failure code returned by Airwallex
Additional details that may include original_response_code, original_response_message from provider, and other contextual information such as card details, risk factors, etc. depending on the specific error code.
The failure description.
The unique identifier for tracing the failure.
Unique identifier for the Refund
A set of key-value pairs that you can attach to the Refund. You can specify up to 50 keys with key names up to 50 characters long and values up to 500 characters long.
Unique identifier of PaymentAttempt on which the Refund is created
Unique identifier of PaymentIntent on which the Refund is created
Reason of the Refund
Unique request identifier specified by the merchant in the last operation
Status of the Refund. One of RECEIVED, ACCEPTED, SETTLED or FAILED
- RECEIVED: The Refund is created, which means the requested refund amount is valid and the payment is not in dispute.
- ACCEPTED: The Refund has been accepted by the payment method provider and can be considered completed.
- SETTLED: The Refund has been reconciled and will show up in the Airwallex settlement report.
- FAILED: The Refund has been rejected, which can be caused by the insufficient Airwallex receivable/available balance, or by the provider for more channel-specific reasons.
Last time at which the Refund was updated
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/pa/refunds/rfd_hkpdbybkch3ovunwjy1_1raukh' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "id": "rfd_hkpdbybkch3ovunwjy1_1raukh",3 "request_id": "962dbd83-5e7b-4185-b668-596834395c12",4 "payment_intent_id": "int_hkpdskz7vg1xc7uscdj",5 "payment_attempt_id": "att_hkpdskz7vg1xc7uscdj",6 "amount": 10,7 "currency": "USD",8 "reason": "Return goods",9 "status": "ACCEPTED",10 "created_at": "2021-01-31T06:57:10+00:00",11 "updated_at": "2021-01-31T07:01:10+00:00"12}
Get list of refunds
GET /api/v1/pa/refunds
Retrieve list of Refunds.
Refund currency
The start time of created_at in ISO8601 format. The timestamp must include an explicit timezone (e.g. Z or -04:00).
Page number starting from 0
Number of Refunds to be listed per page. Default value is 10. Maximum is 1000. The value greater than the maximum will be capped to the maximum.
PaymentAttempt unique identifier of the Refunds
PaymentIntent unique identifier of the Refunds
Refund status
The end time of created_at in ISO8601 format. The timestamp must include an explicit timezone (e.g. Z or -04:00).
A flag which identifies whether there are more results.
List items
A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank.
Amount of the Refund
Time at which the Refund was created
Currency of the Refund
Failure details. Only applicable when status is FAILED.
The failure code returned by Airwallex
Additional details that may include original_response_code, original_response_message from provider, and other contextual information such as card details, risk factors, etc. depending on the specific error code.
The failure description.
The unique identifier for tracing the failure.
Unique identifier for the Refund
A set of key-value pairs that you can attach to the Refund. You can specify up to 50 keys with key names up to 50 characters long and values up to 500 characters long.
Unique identifier of PaymentAttempt on which the Refund is created
Unique identifier of PaymentIntent on which the Refund is created
Reason of the Refund
Unique request identifier specified by the merchant in the last operation
Status of the Refund. One of RECEIVED, ACCEPTED, SETTLED or FAILED
- RECEIVED: The Refund is created, which means the requested refund amount is valid and the payment is not in dispute.
- ACCEPTED: The Refund has been accepted by the payment method provider and can be considered completed.
- SETTLED: The Refund has been reconciled and will show up in the Airwallex settlement report.
- FAILED: The Refund has been rejected, which can be caused by the insufficient Airwallex receivable/available balance, or by the provider for more channel-specific reasons.
Last time at which the Refund was updated
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/pa/refunds' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "has_more": false,3 "items": [4 {5 "id": "rfd_hkpdbybkch3ovunwjy1_1raukh",6 "request_id": "962dbd83-5e7b-4185-b668-596834395c12",7 "payment_intent_id": "int_hkpdskz7vg1xc7uscdj",8 "payment_attempt_id": "att_hkpdskz7vg1xc7uscdj",9 "amount": 10,10 "currency": "USD",11 "reason": "Return goods",12 "status": "SETTLED",13 "created_at": "2021-01-31T06:57:10+00:00",14 "updated_at": "2021-01-31T07:01:10+00:00"15 }16 ]17}