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.

📘

Important

The presence of the refunds array does not mean the amount has already been returned.

Consider the refund completed only when the status field returns DONE.

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

FieldDescription
dateCreatedDate and time the refund was created
statusCurrent status of the refund
valueRefunded amount
descriptionDescription provided in the request
endToEndIdentifierTransaction identifier, when applicable
transactionReceiptUrlReceipt URL, when available
refundedSplitsSplits related to the return of the amount

Refund status

StatusHow to handle
PENDINGThe refund was requested and is still being processed
CANCELLEDThe refund was canceled and the amount must not be considered returned
DONEThe refund was completed and can be reconciled

Handle the refund in your integration

When querying a payment:

  1. check whether the refunds array was returned;
  2. iterate over all items in the array;
  3. store the amount and status of each refund;
  4. consider as returned only the items with status DONE;
  5. update the order and the financial reconciliation;
  6. provide the receipt when transactionReceiptUrl is 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:

FieldDescription
idSplit identifier
valueReturned amount
doneIndicates whether the split's return was completed
⚠️

Attention

Do not consider the split amount returned just because it appears in refundedSplits.

Also confirm the done field.

Reconciliation considerations

  • Sum only refunds with status DONE.
  • Do not include CANCELLED items in the total returned.
  • Treat endToEndIdentifier and transactionReceiptUrl as 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


Did this page help you?