Refunds
How to interpret the refunds attribute returned in charges with refunds.
Use the refunds attribute to identify and reconcile refunds linked to a charge.
When a charge has one or more refunds, the charge object returns the refunds array. Each item represents a refund attempt or completion and should be used by your integration to update the financial status of the order, display receipts to the customer, and reconcile returned amounts.
Response example
The example below shows the refunds field inside a valid JSON object:
{
"refunds": [
{
"dateCreated": "2022-02-21 10:28:40",
"status": "DONE",
"value": 2.00,
"description": "Overpayment",
"endToEndIdentifier": null,
"transactionReceiptUrl": "https://www.asaas.com/comprovantes/6677732109104548",
"refundedSplits": [
{
"id": "cff860dd-148e-48ca-ac8e-849684175158",
"value": 10,
"done": true
}
]
}
]
}Refund fields
| Field | Type | Description |
|---|---|---|
dateCreated | string | Date and time the refund was created. |
status | string | Current status of the refund. Possible values are PENDING, CANCELLED, and DONE. |
value | number | Amount refunded on the charge. |
description | string | Description provided to identify the reason for the refund. |
endToEndIdentifier | string or null | Transaction tracking identifier, when available. Treat null as a temporary absence or unavailability of the identifier. |
transactionReceiptUrl | string or null | URL of the refund receipt, when available. Display or store this link only after confirming it was returned. |
refundedSplits | array | List of splits related to the refund, when the charge has split values. |
Refund status
The available status values returned in the refunds field are:
PENDING: the refund has been requested but not yet completed. Keep the order as awaiting refund confirmation in your integration.CANCELLED: the refund was cancelled and should not be treated as a returned amount.DONE: the refund has been completed. Use this status to confirm the amount has been returned to the customer and update your reconciliation.
Behaviors and considerations
- A charge may return more than one item in
refunds. Iterate through the entire array before calculating the total refunded amount. - Do not use the mere existence of the
refundsarray to consider the refund complete. Confirm that the item has astatusofDONE. - Fields such as
endToEndIdentifierandtransactionReceiptUrlmay returnnullor be unavailable until the process is complete. Prepare your integration to treat these fields as optional. - When
refundedSplitsis returned, use thevalueanddonefields of each split to track the return of divided amounts. - For reconciliation, record the
value,status,dateCreated, andtransactionReceiptUrlwhen available.
Updated 21 days ago
Did this page help you?
