DOCS
Build with the API

Split a payment

Charge the payer once and fund more than one merchant on the same processor.

Platform guide

A split charges the payer once and funds several merchants. For example, a $100.00 payment can send $50.00, $30.00, and $20.00 to three merchant accounts. The payer sees one charge, and each merchant sees its own share as a transaction in its batch.

Send splits on POST /v1/transactions/pay or POST /v1/transactions/{id}/capture. Each entry needs an accountKey and an amount. If you plan to capture with splits, send splits on authorize too, so the charge is set up for splitting from the start.

All merchants in a split must be on the same processor. Splits are supported for:

  • Stripe card
  • Adyen card and Adyen ACH
  • Third Party Sender ACH

The response includes splits, one entry per merchant leg, with the leg's transactionId, accountKey, amount, transactionEventType, rejectDate, and errorMessage. splits is filled in only on the parent transaction. On a leg, splits is null, so no merchant sees the other merchants' shares. The legs also appear in the dashboard and in each merchant's batch.

Refunds

Refund each leg on its own, which reverses the credit to that merchant. On Adyen and Third Party Sender, dhango refunds the leg directly. On Stripe, a leg has no PaymentIntent of its own, so dhango first reverses that leg's transfer, then refunds the payer against the parent charge.

split
curl -s -u "$DHANGO_KEY:$DHANGO_SECRET" \ -H "Content-Type: application/json" \ -H "accountKey: $PRIMARY_ACCOUNT_KEY" \ -d '{"tokenId":"tok_card","payer":"Ada Lovelace","amount":100.00,"payerFee":0,"splits":[{"accountKey":"merch_a","amount":50.00},{"accountKey":"merch_b","amount":30.00},{"accountKey":"merch_c","amount":20.00}]}' \ https://api.dhangodemo.com/v1/transactions/pay