BTN v1.0

DOKU has partnered with various banks and one of them is BTN to provide Virtual Account Payment. Learn more about how DOKU can help you integrate with BTN Virtual Account here.

Process Flow

There is one method to integrate with BTN VA:

VA From Acquirer

Merchant could hit create VA API (service code 27) to create their virtual account number by acquirer. The number created then will be inquired by acquirer, merchant can get the payment notification.

Check this flow diagram to get know about this method

Register VA Flow

Integration Steps

Here is the overview of how to integrate with Virtual Account:


1. Create Virtual Account

To create Virtual Account, you will need to hit this API through your Backend:

API Endpoint

Type
Value

Service Code

27

HTTP Method

POST

API Endpoint Sandbox

https://api-sandbox.doku.com/.../

API Endpoint Production

https://api.doku.com/..../

Path

/bi-snap-va/btn/v1/transfer-va/create-va

Here is the sample request header, request body and response body for BTN VA

  1. DOKU Generate Payment Code

DOKU Generate Payment Code

post

DOKU Generate Payment Code

Header parameters
X-TIMESTAMPstring · utc timestampRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-21T07:56:11.000Z
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-IDstringRequired

Unique ID for a partner (DOKU'S Client ID)

Example: 821508239190
X-EXTERNAL-IDstringRequired

Numeric String. Reference number that should be unique in the same day (request-id)

Example: 418075533589
CHANNEL-IDstringRequired

channel Id for VA

Example: VA009
AuthorizationstringRequired

Access Token obtained from Get B2B Token API

Example: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Body
trxIdstringRequired

Transaction ID in Partner system. | min length: 1 | max length: 64

Example: 23219829713
virtualAccountTrxTypestringRequired

Transaction ID in Partner system. Fil 1 for Closed Payment, fill 2 for Open Payment | min length: 1 | max length: 1

Example: 1
expiredDatestringOptional

Expiration date for Virtual Account. ISO-8601

Example: 2023-01-01T10:55:00+07:00
partnerServiceIdstringRequired

similar to company code/BIN,8 digit left padding space. | min length: 1 | max length: 8

Example: 90341537
customerNostringRequired

Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 20

Example: 00000000000000000000
virtualAccountNostringRequired

partnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 28

Example: 0000000000000000000000000000
virtualAccountNamestringRequired

Customer Name | min length: 1 | max length: 255

Example: Toru Yamashita
virtualAccountEmailstringOptional

Customer Email | min length: 1 | max length: 255

Example: [email protected]
virtualAccountPhonestringOptional

Customer Phone, Format: 62xxxxxxxxx xxxx | min length: 9 | max length: 30

Example: 0816291271826
Responses
200
item created
application/json
post
POST /bi-snap-va/btn/v1/transfer-va/create-va HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
CHANNEL-ID: VA009
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 844

{
  "trxId": "23219829713",
  "virtualAccountTrxType": "1",
  "expiredDate": "2023-01-01T10:55:00+07:00",
  "partnerServiceId": "90341537",
  "customerNo": "00000000000000000000",
  "virtualAccountNo": "0000000000000000000000000000",
  "virtualAccountName": "Toru Yamashita",
  "virtualAccountEmail": "[email protected]",
  "virtualAccountPhone": "0816291271826",
  "totalAmount": {
    "value": "11500.00",
    "currency": "IDR"
  },
  "feeAmount": {
    "value": "11500.00",
    "currency": "IDR"
  },
  "billDetails": [
    {
      "billCode": "01",
      "billNo": "110292189291727",
      "billName": "A bill for Toru",
      "billShortName": "Bill T",
      "billDescription": {
        "english": "Maintenance",
        "indonesia": "Pemeliharaan"
      },
      "billSubCompany": "00001",
      "billAmount": {
        "value": "11500.00",
        "currency": "IDR"
      },
      "additionalInfo": {
        "id": "Hallo bro",
        "en": "Hallo world"
      }
    }
  ],
  "freeTexts": [
    {
      "id": "Hallo bro",
      "en": "Hallo world"
    }
  ],
  "additionalInfo": {
    "channel": "VIRTUAL_ACCOUNT_BTN"
  }
}
{
  "responseCode": "2002700",
  "responseMessage": "Successful",
  "virtualAccountData": {
    "partnerServiceId": "90341537",
    "customerNo": "0000000000112",
    "virtualAccountNo": "903415370000000000112",
    "virtualAccountName": "Toru Yamashita",
    "virtualAccountEmail": "[email protected]",
    "virtualAccountPhone": "081293912081",
    "trxId": "23219829713",
    "totalAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "billDetails": [
      {
        "billCode": "01",
        "billNo": "110292189291727",
        "billName": "A bill for Toru",
        "billShortName": "Bill T",
        "billDescription": {
          "english": "Maintenance",
          "indonesia": "Pemeliharaan"
        },
        "billSubCompany": "00001",
        "billAmount": {
          "value": "11500.00",
          "currency": "IDR"
        },
        "additionalInfo": {
          "id": "Hallo bro",
          "en": "Hallo world"
        }
      }
    ],
    "freeTexts": [
      {
        "id": "Hallo bro",
        "en": "Hallo world"
      }
    ],
    "virtualAccountTrxType": "1",
    "feeAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "expiredDate": "2023-01-01T10:55:00+07:00",
    "additionalInfo": {
      "channel": "VIRTUAL_ACCOUNT_BTN"
    },
    "howToPayInfo": {
      "howToPayPage": "https://sandbox.doku.com/bnc-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
      "howToPayApi": "https://api-sandbox.doku.com/bnc-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
    }
  }
}
  1. Merchant Generate Payment Code

Merchant Generate Payment Code

post

Merchant Generate Payment Code

Header parameters
X-TIMESTAMPstring · utc timestampRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-21T07:56:11.000Z
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-IDstringRequired

Unique ID for a partner (DOKU'S Client ID)

Example: 821508239190
X-EXTERNAL-IDstringRequired

Numeric String. Reference number that should be unique in the same day (request-id)

Example: 418075533589
CHANNEL-IDstringRequired

channel Id for VA

Example: VA009
AuthorizationstringRequired

Access Token obtained from Get B2B Token API

Example: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Body
trxIdstringRequired

Transaction ID in Partner system. | min length: 1 | max length: 64

Example: 23219829713
virtualAccountTrxTypestringRequired

Transaction ID in Partner system. Fil 1 for Closed Payment, fill 2 for Open Payment | min length: 1 | max length: 1

Example: 1
expiredDatestringOptional

Expiration date for Virtual Account. ISO-8601

Example: 2023-01-01T10:55:00+07:00
partnerServiceIdstringRequired

similar to company code/BIN,8 digit left padding space. | min length: 1 | max length: 8

Example: 90341537
customerNostringRequired

Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 20

Example: 0000001702529163
virtualAccountNostringRequired

partnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 28

Example: 0000001702529163
virtualAccountNamestringRequired

Customer Name | min length: 1 | max length: 255

Example: Toru Yamashita
virtualAccountEmailstringOptional

Customer Email | min length: 1 | max length: 255

Example: [email protected]
virtualAccountPhonestringOptional

Customer Phone, Format: 62xxxxxxxxx xxxx | min length: 9 | max length: 30

Example: 0816291271826
Responses
200
item created
application/json
post
POST /bi-snap-va/btn/v1/transfer-va/create-va HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
CHANNEL-ID: VA009
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 828

{
  "trxId": "23219829713",
  "virtualAccountTrxType": "1",
  "expiredDate": "2023-01-01T10:55:00+07:00",
  "partnerServiceId": "90341537",
  "customerNo": "0000001702529163",
  "virtualAccountNo": "0000001702529163",
  "virtualAccountName": "Toru Yamashita",
  "virtualAccountEmail": "[email protected]",
  "virtualAccountPhone": "0816291271826",
  "totalAmount": {
    "value": "11500.00",
    "currency": "IDR"
  },
  "feeAmount": {
    "value": "11500.00",
    "currency": "IDR"
  },
  "billDetails": [
    {
      "billCode": "01",
      "billNo": "110292189291727",
      "billName": "A bill for Toru",
      "billShortName": "Bill T",
      "billDescription": {
        "english": "Maintenance",
        "indonesia": "Pemeliharaan"
      },
      "billSubCompany": "00001",
      "billAmount": {
        "value": "11500.00",
        "currency": "IDR"
      },
      "additionalInfo": {
        "id": "Hallo bro",
        "en": "Hallo world"
      }
    }
  ],
  "freeTexts": [
    {
      "id": "Hallo bro",
      "en": "Hallo world"
    }
  ],
  "additionalInfo": {
    "channel": "VIRTUAL_ACCOUNT_BTN"
  }
}
{
  "responseCode": "2002700",
  "responseMessage": "Successful",
  "virtualAccountData": {
    "partnerServiceId": "90341537",
    "customerNo": "0000000000112",
    "virtualAccountNo": "903415370000000000112",
    "virtualAccountName": "Toru Yamashita",
    "virtualAccountEmail": "[email protected]",
    "virtualAccountPhone": "081293912081",
    "trxId": "23219829713",
    "totalAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "billDetails": [
      {
        "billCode": "01",
        "billNo": "110292189291727",
        "billName": "A bill for Toru",
        "billShortName": "Bill T",
        "billDescription": {
          "english": "Maintenance",
          "indonesia": "Pemeliharaan"
        },
        "billSubCompany": "00001",
        "billAmount": {
          "value": "11500.00",
          "currency": "IDR"
        },
        "additionalInfo": {
          "id": "Hallo bro",
          "en": "Hallo world"
        }
      }
    ],
    "freeTexts": [
      {
        "id": "Hallo bro",
        "en": "Hallo world"
      }
    ],
    "virtualAccountTrxType": "1",
    "feeAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "expiredDate": "2023-01-01T10:55:00+07:00",
    "additionalInfo": {
      "channel": "VIRTUAL_ACCOUNT_BTN"
    },
    "howToPayInfo": {
      "howToPayPage": "https://sandbox.doku.com/bnc-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
      "howToPayApi": "https://api-sandbox.doku.com/bnc-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
    }
  }
}

2. Display Virtual Account

You can display the payment code to your customer by using virtual_account_info.virtual_account_number that you retrieved from the API response.

3. Acknowledge payment result

After the payment is being made by your customer, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU .

4. Hit DOKU Check Status API

If you do not receive notifications from DOKU due to some issue, you can perform an API status check on the DOKU side to determine the updated transaction status. See the detailed request and response here Check Status API.

2. Direct Inquiry

Here is the overview of how to integrate Direct Inquiry BTN VA :

  1. Setup Inquiry URL on DOKU Dashboard

  2. Generate Payment Code on your End

  3. Receive Inquiry Request from DOKU

  4. Acknowledge Payment Notification

Check this flow to diagram to get know about this API :

To get Inquiry Request from DOKU, you will need to hit this API through your Backend:

1. Setup Inquiry URL on DOKU Dashboard

To receive the inquiry request from DOKU. You must set your Inquiry URL to DOKU. Please contact our team for the setup.

Please inform the Inquiry URL for Sandbox environment and Production environment.

2. Generate Payment Code on your end

Generate payment is done in your system. The payment code length maximum is 23 digits.

3. Receive Inquiry Request from DOKU

Here is the sample request header, request body from DOKU

Direct Inquiry

post

Direct Inquiry

Header parameters
X-TIMESTAMPstring · utc timestampRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-21T07:56:11.000Z
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-IDstringRequired

Unique ID for a partner (DOKU'S Client ID)

Example: 821508239190
X-EXTERNAL-IDstringRequired

Numeric String. Reference number that should be unique in the same day (request-id)

Example: 418075533589
CHANNEL-IDstringRequired

channel Id for VA

Example: VA004
AuthorizationstringRequired

Access Token obtained from Get B2B Token API

Example: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Body
partnerServiceIdstringRequired

similar to company code/BIN,8 digit left padding space. | min length: 1 | max length: 8

Example: 90341537
customerNostringRequired

Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 20

Example: 00000000000000000000
virtualAccountNostringOptional

partnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo. | min length: 1 | max length: 28

Example: 903415370000000000112
channelCodestringOptional

Channel code from bank | min length: 1 | max length: 5

Example: 1
trxDateInitstringRequired

Transaction date

Example: 2023-01-01T10:55:00+07:00
languagestringOptional

Language | min length: 1 | max length: 2

Example: ID
inquiryRequestIdstringRequired

Unique Inquiry request id | min length: 1 | max length: 30

Example: 12839218738127830
Responses
200
item created
application/json
post
POST /url-direct-inquiry-merchant HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
CHANNEL-ID: VA004
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 280

{
  "partnerServiceId": "90341537",
  "customerNo": "00000000000000000000",
  "virtualAccountNo": "903415370000000000112",
  "channelCode": "1",
  "trxDateInit": "2023-01-01T10:55:00+07:00",
  "language": "ID",
  "inquiryRequestId": "12839218738127830",
  "additionalInfo": {
    "id": "Hallo bro",
    "en": "Hallo world"
  }
}
{
  "responseCode": "2007300",
  "responseMessage": "Successful",
  "virtualAccountData": {
    "partnerServiceId": "90341537",
    "customerNo": "0000000000112",
    "virtualAccountNo": "903415370000000000112",
    "virtualAccountName": "Toru Yamashita",
    "virtualAccountEmail": "[email protected]",
    "virtualAccountPhone": "081293912081",
    "trxId": "23219829713",
    "totalAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "billDetails": [],
    "freeTexts": [
      {
        "id": "Hallo bro",
        "en": "Hallo world"
      }
    ],
    "virtualAccountTrxType": "1",
    "feeAmount": {
      "value": "11500.00",
      "currency": "IDR"
    },
    "expiredDate": "2023-01-01T10:55:00+07:00",
    "additionalInfo": {
      "id": "Hallo bro",
      "en": "Hallo world"
    },
    "inquiryStatus": "SUCCESS",
    "inquiryReason": {
      "english": "Success",
      "indonesia": "Sukses"
    },
    "inquiryRequestId": "12839218738127830",
    "subCompany": "128392"
  }
}

3. Acknowledge payment result

After the payment is being made by your customer, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU .

4. Hit DOKU Check Status API

If you do not receive notifications from DOKU due to some issue, you can perform an API status check on the DOKU side to determine the updated transaction status. See the detailed request and response here Check Status API.

Last updated

Was this helpful?