Merchant Generate Payment Code
Introduction#
This documentation explains how merchants can integrate with DOKU APIs to generate payment codes and process transactions through acquirers (banks, e-wallets, etc.). The sequence below shows the interaction between:The sequence involves the following actors:1.
Customer: End user making a payment.
2.
Merchant: E-commerce platform or application integrating with DOKU.
3.
DOKU: Payment gateway that provides secure access tokens, validates inquiries, and processes payments.
4.
Acquirer: Bank or payment channel where the actual payment happens.
Step-by-Step Payment Flow#
Step 1. Customer Checkout#
Customer shops online and checks out to pay.
Merchant displays payment page.
Customer chooses acquirer and proceeds with the payment.
Merchant generates payment code.
Step 2. Request Access Token#
Merchant requests access token from DOKU.
DOKU validates and processes the request.
DOKU grants access token to merchant.
Step 3. Register Payment Code#
Merchant registers payment code to DOKU using access token.
DOKU forwards registration to acquirer.
Acquirer confirms successful registration back to DOKU.
DOKU stores the payment code.
DOKU returns success response to merchant.
Merchant displays payment information (payment code, payment instruction) to customer.
Step 4. Customer Payment via Acquirer#
Customer inputs payment code at acquirer channel.
Merchant displays payment instructions to customer.
Customer goes to acquirer payment channel (e.g. ATM, Internet Banking, or e-Wallet).
DOKU responds with order details (merchant name, customer name, amount, etc.) to acquirer.
Acquirer displays order details to customer.
Customer confirms payment.
Step 5. Payment Processing#
Acquirer performs payment invocation to DOKU.
DOKU responds with payment status.
DOKU give the payment status to merchant.
Merchant requests access token from DOKU.
Step 6. Notify Merchant#
DOKU validates and processes the payment result.
DOKU validates and processes token request.
DOKU grants access token to merchant.
DOKU sends payment notification to merchant system.
Merchant displays payment result to customer.
Modified at 2025-08-26 04:22:26