Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

API only integration

Learn how to add Indonesian payment methods to an existing API-only integration for mobile and web banking.

Accept bank transfers and cash payments at convenience stores using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

These instructions explain how to add payment methods for bank transfers and convenience stores in Indonesia to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your integration:

  1. Make sure that you have set up your back end implementation.
  2. Add the payment method in your test Customer Area.

Build your payment form

To make a payment, you need to collect the following shopper details:

Name Description
firstName Shopper's first name.
lastName Shopper's last name.
shopperEmail Shopper's email address.

We provide logos for the different payment method types which you can use in your payment form. For more information, refer to Downloading logos.

You can also get the required fields from the /paymentMethods response as explained in our API-only integration guide.

In your /paymentMethods request, specify the following combination of countryCode and amount.currency:

Country countryCode amount.currency
Indonesia ID IDR

The required fields for different Doku payments are included in the object with the type that you wish to integrate with.

name type Kind of payment method
Mandiri VA doku_mandiri_va Bank transfer
CIMB VA doku_cimb_va Bank transfer
Danamon VA doku_danamon_va Bank transfer
BNI VA doku_bni_va Bank transfer
Bank Transfer doku_permata_lite_atm Bank transfer
BRI VA doku_bri_va (only available with a local entity) Bank transfer
BCA Bank Transfer doku_bca_va (only available with a local entity) Bank transfer
Alfamart doku_alfamart Convenience store
Indomaret doku_indomaret Convenience store

Make a payment

From your server, make a /payments request, specifying:

  • paymentMethod.type: The type of payment method, for example, doku_alfamart.
  • paymentMethod.firstName: The shopper's first name.
  • paymentMethod.lastName: The shopper's last name.
  • paymentMethod.shopperEmail: The shopper's email address.

    {
       "amount": {
       "currency": "IDR",
       "value": 10000
       },
       "reference": "12345",
       "paymentMethod": {
            "type": "doku_alfamart",
            "firstName": "John", 
            "lastName": "Smith",
            "shopperEmail": "1212@aaa.com"
       },
       "returnUrl": "http://localhost:8080/",
       "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    } 

The /payments response contains:

  • resultCode: PresentToShopper
  • action: Use the information in this object to present the payment result as a voucher to your shopper.

    {
       "resultCode": "PresentToShopper",
       "action": {
           "expiresAt": "2019-07-21T16:59:00",
           "initialAmount": {
               "currency": "IDR",
               "value": 1000
           },
           "instructionsUrl": "...",
           "merchantName": "YOUR_MERCHANT_NAME",
           "paymentMethodType": "doku_alfamart",
           "reference": "888882603010314",
           "shopperEmail": "1212@aaa.com",
           "shopperName": "J Smith",
           "totalAmount": {
               "currency": "IDR",
               "value": 1000
           },
           "type": "voucher"
       }
    }

Present the payment result

As the voucher is an offline payment method, there is no need to handle the redirect back from the acquirer. We will send you a webhook notification informing you about the payment status.
The eventCode values you receive with your notification are:

eventCode success field Description Action to take resultCode
PENDING true The voucher reference is successfully created and the transaction is pending. Present the shopper with the voucher and wait for the payment. PresentToShopper
AUTHORISATION false The voucher reference is not successfully generated and the transaction failed. Cancel the order and inform the shopper that the payment failed. Error
AUTHORISATION true The shopper successfully completed the payment. Inform the shopper that the payment has been successful and proceed with the order. PresentToShopper
OFFER_CLOSED true The shopper did not complete the payment before the voucher expired. Cancel the order and inform the shopper that the payment timed out. PresentToShopper

Optional customization

You can customize the expiry date of the payment voucher. By default, the validity period is 48 hours. To change the validity of the voucher, contact the Support Team.

Test and go live

Use our test vouchers and card numbers to simulate the payments.

Check the status of the test payments in your Customer Area, under Transactions > Payments.

See also