Sub Account V2
Pre Condition
Before you begin, make sure you have an active DOKU account with Sub Account service (Collect and Route / Deposit System / Fund Oversight) activated. Contact Sales if you haven't activated yet.
Flow Overview
Step-by-Step
1. Get Access Token
Authenticate with the DOKU API to get a B2B access token. This token is required for all subsequent API calls.
See Get Token B2B for full documentation.
2. Register Sub-Account
Create a sub-account for each party in your ecosystem (seller, agent, branch, etc.). Each sub-account gets three account types (IDR, Pending IDR, Points) and an auto-assigned static BRI VA.
Save the profileId from the response, you'll use it in every subsequent call for this sub-account.
3. Create Split Rule (optional)
Define how incoming payments should be automatically distributed across sub-accounts. You can create percentage-based or flat-amount rules.
Save the splitRuleId , pass it together with profileId in payment requests.
4. Create Payment
Accept payments through Checkout API or Direct API. Include additionalInfo.account.id to route the payment to a sub-account, and optionally additionalInfo.account.split_rule_id to apply a split rule.
Returns a payment URL. Customer is redirected to the DOKU hosted payment page where they can choose from all active payment channels.
Merchant controls the payment UI. Each channel has its own endpoint.
After payment, DOKU sends a webhook notification to your callback URL. Funds land in DOKU_PENDING_IDR (for Checkout/Direct API) or DOKU_MERCHANT_IDR (for BRI VA top-up).
See Payment Channel Compatibility for which channels support Sub-Account routing.
5. Balance Inquiry
Check the current balance of any sub-account at any time.
Returns available and reserved balances across all three account types (IDR, Pending IDR, Points).
6. Transaction History
Retrieve a paginated list of all transactions for a sub-account within a date range.
Each record includes mutation type (CREDIT/DEBIT), transaction type, amount, channel, status, and timestamp.
7. Transaction Status
Check the real-time status of any individual transaction.
Returns the latest transaction status (00 = Success, 03 = Pending, 06 = Failed) and refund history if applicable.
8. Transfer Inquiry
Before sending money out, validate the destination account.
Returns a referenceNo and confirmed beneficiary name. You must use this referenceNo in the next step.
Important: The
partnerReferenceNomust be the same in both the inquiry and payment requests.
9. Transfer Payment
Execute the payout using the referenceNo from Transfer Inquiry.
Supports three transfer types:
BANK_ACCOUNT
Payout to 100+ Indonesian banks (via BI_FAST or ONLINE)
DOKU_SUB_ACCOUNT
Internal transfer between sub-accounts
DOKU_WALLET
Transfer to DOKU e-wallet
After transfer, DOKU sends a webhook notification with the transaction status.
Additional Operations
Debit
POST /sub-account/v2.0/debit
Deduct funds from a sub-account
Debit Cancel
POST /sub-account/v2.0/debit/cancel
Reverse a debit (full or partial)
Last updated