DOCS
Build with the API

Refund, void, or capture

Complete an authorization, void a payment that has not been sent to the bank, or refund one that has.

Platform guide

After a payment exists, three calls can change it. Which one you use depends on where the payment is.

CallBodyWhen
POST /v1/transactions/{id}/capturepayerFee is required. amount is optional, and sets how much of the authorization to capture.The transaction is an authorization that has not been captured yet.
POST /v1/transactions/{id}/voidEmptyThe payment has not been sent to the bank yet. Once the Process event is recorded, void is no longer available. A void usually costs the merchant nothing.
POST /v1/transactions/{id}/refundOptional amount. Leave it out to refund the remaining balance.The payment can no longer be voided.

Capture also accepts platformFee, splits, shipping, tax, line items, paidCustomers, and paidInvoices. As on pay, send payerFee as 0 when the payer is not charged a fee.

Refund and capture accept an Idempotency-Key header. Void does not.

Refunds after funding

A refund or a return works differently depending on whether the merchant was already funded:

  • Already funded: dhango creates a new transaction linked to the original, and a later batch debits the merchant.
  • Not funded yet: dhango updates the original transaction, and no extra funding entry is created.

Transaction lifecycles shows both sequences.

To refund a split payment, refund each leg separately. On Stripe, dhango reverses that leg's transfer, then refunds the payer against the parent charge. See Split a payment.

refund
curl -s -u "$DHANGO_KEY:$DHANGO_SECRET" \ -H "Content-Type: application/json" \ -H "accountKey: $ACCOUNT_KEY" \ -H "Idempotency-Key: aa0b1c2d-3e4f-5678-90ab-cdef12345678" \ -d '{"amount":10.00}' \ https://api.dhangodemo.com/v1/transactions/txn_example/refund