DOCS
Build with the API

Send a payout

Send funds to a bank account with POST /v1/transactions/payout.

Platform guide

POST /v1/transactions/payout sends money to a recipient's bank account by ACH. Send amount as a positive number. dhango records the payout as a negative amount, because money is leaving the account.

Payouts run on Third Party Sender, and on the Fake processor for testing. Stripe, Adyen, Nacha Direct Debit, and the legacy gateways cannot originate payouts.

Choose the destination

Send exactly one of ach, tokenId, or payeeAccountKey:

  • ach, with bankAccountHolder, routingNumber, and accountNumber
  • tokenId for a saved bank account. It must be an active ACH token, and a token for any other payment method is rejected.
  • payeeAccountKey for an in-system payee, which uses that account's deposit bank

With ach or tokenId, also send payee, the recipient's name, which can differ from the bank account holder. With payeeAccountKey, leave payee out, because dhango uses the name on that account. The payee account must be active and on the same platform as the account paying out.

Other fields

  • currency is required.
  • platformFee is optional. Leave it out and dhango calculates the fee from the account pricing. As a platform paying out for a merchant, you can send a platformFee greater than 0 to override the calculation for this one payout.
  • sendReceipt requests an email receipt. Leave it null to use the account setting.
  • emailAddress, comments, metadata, and paidInvoices are optional. See the Transactions reference.

Third Party Sender rules

  • The currency must be USD, as on every Third Party Sender transaction.
  • When you send ach with a bankAccountType of PersonalChecking or PersonalSavings, dhango validates the account number first and rejects the payout if validation fails. Payouts to a tokenId skip this check.
  • To an outside recipient (ach or tokenId), the events are Payout, then Batch, when the account paying out is debited, then Process, when the credit is sent to the recipient's bank. dhango sends that credit about 3 banking days after the debit, once the debit has cleared.
  • To an in-system payee (payeeAccountKey), the events are Payout, then Batch, and the payee is credited in a batch like any other merchant funding. There is no Process event.

On the Fake processor, a payout succeeds and goes straight into a batch.

Returns

A payout can be returned by the recipient's bank, and dhango applies the return from the Third Party Sender return file. If the payout was already batched, dhango creates a new linked transaction with event type Return and sends a TransactionEvent for it. If the payout was not batched yet, dhango marks the original payout returned and sends a TransactionEvent with event type Return.

Responses and retries

A successful call returns 201 with the transaction, and dhango sends a TransactionEvent webhook with event type Payout. If you repeat the request with the same Idempotency-Key and the same body, you get the same transaction back, with the Idempotent-Replayed response header set to true.

StatusMeaning
400The payout was not created.
403 with a bodyThe paying account is not active. This also applies when you replay an Idempotency-Key from a request made while the account was active. Once the account is active again, the replay returns the transaction.
403 with no bodyThe credential does not have permission.
409A request with this key is still in progress, or its outcome is not known yet. Retry later with the same key.
422This key was already used with a different body.
503Idempotency checks are unavailable, and the request was not processed. Retry later with the same key.

To reconcile payouts, use GET /v1/transactions/{id} and the BatchAdd and BatchUpdate webhooks.

payout
curl -s -u "$DHANGO_KEY:$DHANGO_SECRET" \ -H "Content-Type: application/json" \ -H "accountKey: $ACCOUNT_KEY" \ -H "Idempotency-Key: 9a8b7c6d-5e4f-3210-abcd-ef1234567890" \ -d '{"payee":"Northwind","amount":100.00,"tokenId":"tok_bank"}' \ https://api.dhangodemo.com/v1/transactions/payout