API Reference
DOKU DocsChangelogDOKU Github
  • Getting Started with DOKU API
    • User Registration
    • Idempotency Request
    • Notification
      • Setup Notification URL
      • HTTP Notification Sample for SNAP
      • HTTP Notification Sample - Non SNAP
      • Best Practice
      • Retry Notification
      • Override Notification URL
    • Signature Component
      • Non-SNAP
        • Signature Component from Request Header
        • Signature Componen from Response Header
        • Signature from API Get Method
        • Sample Code
      • SNAP
        • Symmetric Signature
        • Asymmetric Signature
    • Response Code
      • HTTP Status and Case Code
    • Check Status API
      • Non-SNAP
      • SNAP
    • Retrieve Payment Credential
  • Accept Payment
    • DOKU Checkout
      • Integration Guide
        • Backend Integration
        • Frontend Integration
        • Simulate payment and Notification
      • Supported Payment Methods
      • Status Order
      • Additional Feature
        • Tokenization
        • Promo on DOKU Checkout Page
        • Track Campaign Source on Google Analytics
      • Checkout Settings
    • Direct API
      • Non-SNAP
        • Cards
          • Payment Page Integration Guide
          • Host-To-Host Integration Guide
          • Mastercard Automatic Billing Updater (ABU) Integration Guide
            • Backend Integration
        • e-Wallet
          • Overview
          • DOKU e-Wallet
          • OVO Push Payment
          • ShopeePay
          • LinkAja
        • Paylater
          • Akulaku
          • Kredivo
          • Indodana
        • Digital Banking
          • Jenius Pay
        • Convenience Store
          • Alfa Group
          • Indomaret
      • SNAP
        • Integration Guide
          • Get Token API
            • B2B
            • B2B2C
          • Virtual Account
            • CIMB Virtual Account
            • BSI Virtual Account
            • BCA Virtual Account
            • BNC Virtual Account
            • BNI Virtual Account
            • Mandiri Virtual Account
            • BRI Virtual Account
            • BTN Virtual Account
            • Permata Virtual Account
            • Danamon Virtual Account
            • BSS Virtual Account
          • E-Wallet
            • DOKU Wallet
            • DANA
            • OVO
            • ShopeePay
          • Direct Debit
            • Allo Bank Direct Debit
            • BRI Direct Debit
            • CIMB Direct Debit
            • Mandiri Direct Debit
          • Kartu Kredit Indonesia Cepat Secure(KKI CPTS)
            • Host to Host Integration
          • QRIS
    • Finance and Settlement
      • Split Settlement
      • Custom Settlement Report
      • Hold and Release Settlement
      • Bulk Registration Bank
    • Test on DOKU Demo Site
    • DOKU Payment Simulator
  • Developer Kit
    • Postman Collection
    • Libraries and SDK
  • Wallet As A Service
    • Sub Account
  • Partnership
    • Partner API
      • Check Requirements API
      • Generate Token API
      • Upload File API
      • Business Registration API
      • Create Business Lite API
      • Get Business Data API
  • Payout
    • Kirim DOKU
  • FLEXIBILL
    • Account Billing
      • Batch Upload
    • DOKU Biller
      • Response Code
      • Samples
  • PAYCHAT API
    • Send WhatsApp Message
  • Archive
    • Non-SNAP
      • Tokenization V1
      • e-Wallet
        • OVO Recurring
        • OVO Open API
    • SNAP
      • Virtual Account
        • BCA v1.0
        • BRI v1.0
        • BNI v1.0
        • BNC v1.0
        • Mandiri v1.0
        • BTN v1.0
        • Permata v1.0
        • Danamon Virtual Account
      • e-Wallet
        • OVO Open API
        • DANA
        • ShopeePay
      • Direct Debit
        • CIMB Direct Debit
        • BRI Direct Debit
        • Allobank
Powered by GitBook

DOKU API

  • Legacy Documentation
On this page
  • Implementation
  • FAQs

Was this helpful?

  1. Accept Payment
  2. Finance and Settlement

Hold and Release Settlement

PreviousCustom Settlement ReportNextBulk Registration Bank

Last updated 10 months ago

Was this helpful?

Hold & Release Settlement is a feature that enables you to hold the settlement for a payment. This is a good solution for a merchant that needs to hold and release the settlement when needed. It is suitable for merchants who have a marketplace or ecommerce business.

Case Study

"Pasar Kelontong" is an online marketplace where sellers and buyers meet. They need to hold the settlement to their sellers and will only settle it after the buyers confirmed they have received the goods.

Therefore, they implement Hold and Release Settlement feature which makes the settlement hold until they trigger the release settlement API.


Implementation

Hold Settlement

To do hold settlement, please add this additional_info.hold_settlement object into your payment request:

{
...
    "additional_info": {
        "hold_settlement": true
    }
...
}

You can validate whether the settlement is hold by checking to and go to Report > Reconciled Transactions. You should see the transaction will have Settlement Schedule with HOLD.

Sample usage

Let's assume you are using the Checkout integration. You can simply add these parameters into your API Initiate Payment:

{
    "order": {
        "invoice_number": "INV-20210231-0001",
        "amount": 90000,
        "line_items": [
            {
                "name": "T-Shirt Red",
                "price": 30000,
                "quantity": 2
            },
            {
                "name": "Polo Navy",
                "price": 30000,
                "quantity": 1
            }
        ],
        "currency": "IDR",
        "callback_url": "https://merchant.com/return-url"
    },
    "payment": {
        "payment_due_date": 60,
        "payment_method_types": [
            "VIRTUAL_ACCOUNT_BCA",
            "VIRTUAL_ACCOUNT_BANK_MANDIRI",
            "VIRTUAL_ACCOUNT_BANK_SYARIAH_MANDIRI",
            "VIRTUAL_ACCOUNT_DOKU",
            "ONLINE_TO_OFFLINE_ALFA",
            "CREDIT_CARD",
            "DIRECT_DEBIT_BRI"
        ]
    },
    "customer": {
        "id": "CUST-0001",
        "name": "Anton Budiman",
        "email": "anton@example.com",
        "phone": "6285694566147",
        "address": "Menara Mulia Lantai 8",
        "country": "ID"
    },
    "additional_info": {
        "hold_settlement": true
    }
}

Release Settlement

To release the settlement, you will need to hit this API through your backend:

API Request

Type
Value

HTTP Method

POST

API endpoint (Sandbox)

https://api-sandbox.doku.com/finance/v1/release

API endpoint (Production)

https://api.doku.com/finance/v1/release

Here is the sample of request header to release transaction into settlement:

Client-Id: MCH-0001-10791114622547
Request-Id: fdb69f47-96da-499d-acec-7cdc318ab2fe
Request-Timestamp: 2021-05-08T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Request Header Explanation

Request Header Explanation

Parameter
Description

Client-Id

Client ID retrieved from DOKU Back Office

Request-Id

Unique random string (max 128 characters) generated from merchant side to protect duplicate request

Request-Timestamp

Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z

Signature

Here is the sample of request body:

{
    "order": {
        "invoice_number": "INV-20210231-0001",
        "amount": 90000,
        "currency": "IDR"
    },
    "transaction": {
        "original_request_id": "fdb69f47-96da-499d-acec-7cdc318ab2fe"
    },
    "override_settlement": 
        [
            {
                "bank_account_settlement_id": "SBA-0001-123123123",
                "value": 10,
                "type": "PERCENTAGE"
            },
            {
                "bank_account_settlement_id": "SBS-0002-321321321",
                "value": 90,
                "type": "PERCENTAGE"
            }
        ]
}

Request Body Explanation

Parameter
Type
Mandatory
Description

order.invoice_number

string

Mandatory

Same as the request that merchant sent on the payment initiation

order.amount

number

Mandatory

Same as the request that merchant sent on the payment initiation

order.currency

string

Mandatory

Same as the currency of original payment Default value: IDR

transaction.original_request_id

string

Mandatory

The request ID that sent when initiate the payment

override_settlement.bank_account_settlement_id

string

Optional

The bank_account_settlement_id that you retrieved from the DOKU Back Office

override_settlement.value

numeric

Optional

The value of the settlement can be in IDR or percentage based on the type defined. If you are using FIX type then the value should be the exact amount. If you are using PERCENTAGE type then the value should be the percentage

override_settlement.type

string

Optional

The type of the splitting funds. Possible value: FIX, PERCENTAGE

API Response

After hitting the above API request, DOKU will give the response.

Type
Value

HTTP Status

200

Result

SUCCESS

Client-Id: MCH-0001-10791114622547
Request-Id: fdb69f47-96da-499d-acec-7cdc318ab2fe
Response-Timestamp: 2021-05-08T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=

Response Header Explanation

Parameter
Description

Client-Id

Same as the request

Request-Id

Same as the request

Response-Timestamp

Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU

Signature

Signature generated by DOKU based on the response body

Here is the sample response body:

{
    "order": {
        "invoice_number": "INV-20210231-0001",
        "amount": 90000,
        "currency": "IDR"
    },
    "transaction": {
        "original_request_id": "fdb69f47-96da-499d-acec-7cdc318ab2fe",
        "settlement_date": "2021-05-09",
        "settlement_amount": 85500,
    }
}

Response Body Explanation

Parameter
Type
Mandatory
Description

order.invoice_number

string

Mandatory

Same as the request

order.amount

number

Mandatory

Same as the request

order.currency

string

Mandatory

Same as the request

transaction.original_request_id

string

Mandatory

Same as the request

transaction.settlement_date

string

Mandatory

Settlement date of this transaction (H+1) Format: yyyy-mm-dd

transaction.settlement_amount

number

Mandatory

The settlement amount after deducted with fee

The funds will be settled to the defined bank account within one business day (H+1)


FAQs

When will I receive my funds after I hit the release API?

You will receive your funds H+1 after you hit the release API

What currency supported for the settlement?

We support IDR, SGD, and USD settlement. Please make sure that your defined bank account is on respective currency.

Can I use this feature with split settlement or custom settlement report?

Of course, you can!

Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to to generate the signature

this section
DOKU Back Office