DOKU 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: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#
The customer shops online and proceeds to checkout.
The merchant displays the payment page with available payment channels.
The customer selects an acquirer (ATM, Internet Banking, e-Wallet, etc.) and clicks "Proceed".
Step 2. Request Access Token#
The merchant requests an access token from DOKU using credentials (public & private key).
DOKU validates and processes the request.
If successful, DOKU grants an access token which will be used in subsequent API calls.
Step 3. Generate Payment Code#
With the token, the merchant requests a payment code from DOKU.
The request includes: invoice number, transaction amount, and expiry date.
DOKU processes the request and generates a unique payment code, returning it along with payment instructions.
The merchant displays payment information (code, instructions) to the customer.
Step 4. Customer Payment via Acquirer#
The customer inputs the payment code at the acquirer’s channel (ATM, Internet Banking, etc.).
The acquirer system invokes an inquiry to DOKU to verify order details.
DOKU responds with details (merchant name, customer name, amount).
The acquirer displays order details to the customer.
The customer confirms the payment.
Step 5. Payment Processing#
The acquirer performs a payment invocation to debit the customer account.
The acquirer checks payment status internally.
Once processed, the acquirer sends a payment response to DOKU.
Step 6. Notify Merchant#
DOKU validates and processes the payment result.
Merchant requests access token from DOKU.
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:23:15