Refunds
How to interpret the refunds attribute returned in payments with refunds.
When a payment has one or more refunds, the API returns the refunds array.
Each item represents a refund linked to the payment and reports its amount, status, and receipt, when available.
ImportantThe presence of the
refundsarray does not mean the amount has already been returned.Consider the refund completed only when the
statusfield returnsDONE.
When to use
Check the refunds array to:
- identify full or partial refunds;
- track the completion of the refund;
- update the order's financial status;
- reconcile refunded amounts;
- provide the receipt to the customer;
- track the return of amounts with split.
Response example
{
"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": 2.00,
"done": true
}
]
}
]
}Refund fields
| Field | Description |
|---|---|
dateCreated | Date and time the refund was created |
status | Current status of the refund |
value | Refunded amount |
description | Description provided in the request |
endToEndIdentifier | Transaction identifier, when applicable |
transactionReceiptUrl | Receipt URL, when available |
refundedSplits | Splits related to the return of the amount |
Refund status
| Status | How to handle |
|---|---|
PENDING | The refund was requested and is still being processed |
CANCELLED | The refund was canceled and the amount must not be considered returned |
DONE | The refund was completed and can be reconciled |
Handle the refund in your integration
When querying a payment:
- check whether the
refundsarray was returned; - iterate over all items in the array;
- store the amount and status of each refund;
- consider as returned only the items with status
DONE; - update the order and the financial reconciliation;
- provide the receipt when
transactionReceiptUrlis filled in.
A payment can have more than one refund. Therefore, do not use only the first item in the array.
Refunds with split
When the payment has amounts split between accounts, the refundedSplits field reports how the refund affected each split.
For each item, use:
| Field | Description |
|---|---|
id | Split identifier |
value | Returned amount |
done | Indicates whether the split's return was completed |
AttentionDo not consider the split amount returned just because it appears in
refundedSplits.Also confirm the
donefield.
Reconciliation considerations
- Sum only refunds with status
DONE. - Do not include
CANCELLEDitems in the total returned. - Treat
endToEndIdentifierandtransactionReceiptUrlas optional. - Preserve the history when there is more than one refund.
- Do not replace the payment's original amount with the refunded amount.
- Consider the possibility of partial refunds.
Next steps
Updated 11 days ago
