# Sub Account V2

## Overview

Sub Account simplifies how businesses manage deposits, commissions, and fund flows in one system with transparency, visibility, and control. With one API, you can create sub-accounts, monitor transactions, and handle internal transfers with ease. It’s built for platforms that need control, visibility, and flexibility in managing complex fund flows.

## Integration Guides

Choose how to onboard sub accounts, accept payments, pay out, and more.

### 1. Register Sub Account

Once the service has been verified for your business, you may use the Register Sub Account API to create Sub Accounts. You must consider several factors when choosing a sub account type, because the type of sub account you choose determines your partner experience and operational responsibilities such as KYC/ KYB, user support, etc. Currently there are three account types you can use with DOKU Sub Account, each of which is designed for different use cases.

* ***Default***: This sub account is almost completely invisible to the account holder and DOKU has no direct contact with them. Default sub accounts are suitable for platforms who want to control the entire user experience. Liability for partner KYC/ KYB is on Merchant.
* ***Standard***: Merchant can manage payout, customize the flow of funds. An account with a Standard account is able to log in to DOKU Dashboard to view their transaction history and account balance. Liability for partner KYC/ KYB is on Merchant.
* ***Partner***: Merchant can manage payout, customize the flow of funds. Liability for partner KYC/ KYB is on DOKU. If you decide to use this type of account, please register your sub account via [DOKU Partner API](https://developers.doku.com/partnership/partner-api).

|                                     | Default                           | Standard          | Partner           |
| ----------------------------------- | --------------------------------- | ----------------- | ----------------- |
| Availability                        | Collect and Route, Smart Acquired | Collect and Route | Collect and Route |
| Verification Process                | Merchant                          | Merchant          | DOKU              |
| Integration Method                  | API                               | API               | API               |
| Integration Effort                  | Low                               | Low               | Medium            |
| [DOKU.com](http://doku.com/) Access | No                                | Yes               | No                |

## New Register Sub Account

> Endpoint to Sub Account Register H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/sub-account/register":{"post":{"tags":["H2H"],"summary":"New Register Sub Account","description":"Endpoint to Sub Account Register H2H SNAP.","operationId":"newRegisterSubAccount","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo","merchantId","customerId","type","name"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"},"merchantId":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/merchantId"},"customerId":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/customerId"},"type":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/type"},"email":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/email"},"name":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/name"},"phoneNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/phoneNo"},"countryCode":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/countryCode"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccountRegisterResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"SubAccountRegisterResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string"},"profileId":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"currency":{"type":"string"},"accountNo":{"type":"string"}}}}}}}}}
```

### 2. Accept Payment

After you create your account, you can start processing transactions on behalf of your partner or you can topup your sub account balance via Virtual Account.

### 3. Transfer Funds

The funds from the payments or topup that you process for your partners are held in their balance accounts until you pay them out or until you transfer the balances to another sub accounts

#### a. Transfer Inquiry

Before initiating a fund transfer, it is crucial to verify the validity of both the sender's and the recipient's bank accounts. Ensuring account accuracy helps prevent transaction errors and supports a seamless transfer process

## Transfer Inquiry

> Endpoint Transfer Inquiry H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/transaction/transfer-inquiry":{"post":{"tags":["H2H"],"summary":"Transfer Inquiry","description":"Endpoint Transfer Inquiry H2H SNAP.","operationId":"transferInquiry","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo","type","method","amount","sourceAccountNo","beneficiaryBankCode","beneficiaryAccountNo"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"},"amount":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/amount"},"type":{"type":"string","enum":["BANK_ACCOUNT","DOKU_SUB_ACCOUNT","DOKU_WALLET"],"maxLength":20,"description":"type of transfer inquiry"},"method":{"type":"string","enum":["BI_FAST","ONLINE"],"maxLength":22,"description":"optional field, and the default value is ONLINE"},"sourceAccountNo":{"type":"string","maxLength":22,"description":"the doku BMS account number"},"beneficiaryBankCode":{"type":"string","maxLength":16,"description":"beneficiary Bank Code"},"beneficiaryAccountNumber":{"type":"string","maxLength":22,"description":"destination account"},"remark":{"type":"string","maxLength":256}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferInquiryResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"TransferInquiryResponse":{"type":"object","properties":{"responseCode":{"type":"string","maxLength":7},"responseMessage":{"type":"string","maxLength":128},"referenceNo":{"type":"string","maxLength":64},"partnerReferenceNo":{"type":"string","maxLength":64},"type":{"type":"string","maxLength":20},"method":{"type":"string","maxLength":22},"beneficiaryAccountNumber":{"type":"string","maxLength":10},"beneficiaryAccountName":{"type":"string","maxLength":256},"beneficiaryBankCode":{"type":"string","maxLength":16,"description":"beneficiary Bank Code"},"amount":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/amount"}}}}}}
```

#### b. Transfer Payment

This process involves transferring funds from the sub account to the recipient's account. Ensure all required details, including the recipient's bank account information and the transfer amount, are accurately provided.

## Transfer Payment

> Endpoint Transfer Payment H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/transaction/transfer-payment":{"post":{"tags":["H2H"],"summary":"Transfer Payment","description":"Endpoint Transfer Payment H2H SNAP.","operationId":"transferPayment","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo","referenceNo","type","method","amount","sourceAccountNo","beneficiaryBankCode","beneficiaryAccountNo"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"},"referenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/referenceNo"},"type":{"type":"string","enum":["BANK_ACCOUNT","DOKU_SUB_ACCOUNT","DOKU_WALLET"],"maxLength":20,"description":"type of transfer payment"},"method":{"type":"string","maxLength":22,"enum":["BI_FAST","ONLINE"],"description":"optional field, and the default value is ONLINE"},"amount":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/amount"},"sourceAccountNo":{"type":"string","maxLength":22,"description":"the doku BMS account number"},"beneficiaryBankCode":{"type":"string","maxLength":16,"description":"beneficiary Bank Code"},"beneficiaryAccountNumber":{"type":"string","maxLength":22,"description":"destination account"},"beneficiaryAccountName":{"type":"string","maxLength":256,"description":"destination account"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferPaymentResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"TransferPaymentResponse":{"type":"object","properties":{"responseCode":{"type":"string","maxLength":7},"responseMessage":{"type":"string","maxLength":256},"referenceNo":{"type":"string","maxLength":64},"partnerReferenceNo":{"type":"string","maxLength":64},"type":{"type":"string","maxLength":20},"method":{"type":"string","maxLength":22},"transactionDate":{"type":"string","maxLength":25,"description":"UTC dateTime"},"beneficiaryBankCode":{"type":"string","maxLength":16,"description":"beneficiary Bank Code"},"beneficiaryAccountNumber":{"type":"string","maxLength":10},"beneficiaryAccountName":{"type":"string","maxLength":22},"referenceNumber":{"type":"string"},"sourceAccountNo":{"type":"string","maxLength":22}}}}}}
```

### 4. Check Status

Track the status of your transaction to confirm its completion. This feature allows real-time monitoring.

## Check Status

> Endpoint Check Status H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/transaction/check-status":{"post":{"tags":["H2H"],"summary":"Check Status","description":"Endpoint Check Status H2H SNAP.","operationId":"checkStatus","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkstatush2hResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"Checkstatush2hResponse":{"type":"object","properties":{"responseCode":{"type":"string","maxLength":7},"responseMessage":{"type":"string","maxLength":128},"partnerReferenceNo":{"type":"string","maxLength":64},"latestTransactionStatus":{"type":"string","maxLength":2},"transactionStatusDesc":{"type":"string","maxLength":32},"transactionDate":{"type":"string","maxLength":25,"description":"UTC dateTime"},"amount":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/amount"}}}}}}
```

### 5. Inquiry Balance

Balance is like your wallet since it will tell you how much money is available to you on DOKU. You can retrieve it to see the current balance of your sub account.

## Balance Inquiries

> Endpoint to Balaance Inquiries H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/account/balance-inquiries":{"post":{"tags":["H2H"],"summary":"Balance Inquiries","description":"Endpoint to Balaance Inquiries H2H SNAP.","operationId":"balanceInquiries","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo","profileId","accounts"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"},"profileId":{"type":"string","maxLength":22},"accounts":{"type":"array","items":{"type":"string","maxLength":10}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceInquiriesResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"BalanceInquiriesResponse":{"type":"object","properties":{"responseCode":{"type":"string","maxLength":7},"responseMessage":{"type":"string","maxLength":128},"referenceNo":{"type":"string","maxLength":64},"name":{"type":"string","maxLength":128},"customerId":{"type":"string","maxLength":64},"profileId":{"type":"string","maxLength":128},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"accountNo":{"type":"string","maxLength":10},"status":{"type":"string","maxLength":4},"balance":{"type":"object","required":["totalAmount","availableAmount","holdAmount"],"properties":{"totalAmount":{"type":"number","format":"double","multipleOf":0.01,"minimum":1},"availableAmount":{"type":"number","format":"double","multipleOf":0.01,"minimum":1},"holdAmount":{"type":"number","format":"double","multipleOf":0.01,"minimum":1}}}}}}}}}}}
```

### 6. Account Mutation

This endpoint is used to get account mutation data.

## Account Mutation List

> Endpoint Account Mutation List H2H SNAP.

```json
{"openapi":"3.0.0","info":{"title":"waas-corporate-system-api","version":"2.0.0"},"servers":[{"url":"https://api-sandbox.doku.com"},{"url":"https://api-uat.doku.com"}],"paths":{"/sac/h2h/v1.0/account/account-mutation-list":{"post":{"tags":["H2H"],"summary":"Account Mutation List","description":"Endpoint Account Mutation List H2H SNAP.","operationId":"accountMutationList","parameters":[{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXPartnerId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXTimeStamp"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXSignature"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapXExternalId"},{"$ref":"../au-domain-object/snap-paramaters.yaml#/components/parameters/snapAuthorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["partnerReferenceNo","accountNo","fromDateTime","toDateTime","pageSize","pageNumber"],"properties":{"partnerReferenceNo":{"$ref":"../au-domain-object/snap-schemas.yaml#/components/schemas/partnerReferenceNo"},"accountNo":{"type":"string","maxLength":10,"description":"the doku BMS account number"},"fromDateTime":{"type":"string","maxLength":25,"description":"UTC dateTime"},"toDateTime":{"type":"string","maxLength":25,"description":"UTC dateTime"},"pageSize":{"type":"string","maxLength":3},"pageNumber":{"type":"string","maxLength":3}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountMutationListResponse"}}}},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"components":{"schemas":{"AccountMutationListResponse":{"type":"object","properties":{"responseCode":{"type":"string","maxLength":7},"responseMessage":{"type":"string","maxLength":128},"referenceNo":{"type":"string","maxLength":64},"partnerReferenceNo":{"type":"string","maxLength":64},"detailData":{"type":"array","items":{"type":"object","properties":{"invoiceNumber:":{"type":"string","maxLength":64},"mutationType":{"type":"string","maxLength":20},"transactionType":{"type":"string","maxLength":32},"amount":{"type":"number","format":"double","multipleOf":0.01,"minimum":1},"currency":{"type":"string","minLength":3,"maxLength":3},"dateTime":{"type":"string","maxLength":25,"description":"UTC dateTime"},"remark":{"type":"string","maxLength":256}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.doku.com/wallet-as-a-service/sub-account-v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
