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
  • Setup
  • Access
  • Encryption Procedure
  • Decryption Procedure
  • Folder
  • SFTP File
  • File Explanation
  • File Report
  • Merchant Notification
  • Notification API
  • Request
  • Request Header Explanation
  • Merchant Notify to DOKU
  • DOKU Notify to Merchant

Was this helpful?

  1. Accept Payment
  2. Direct API
  3. Non-SNAP
  4. Cards
  5. Mastercard Automatic Billing Updater (ABU) Integration Guide

Backend Integration

PreviousMastercard Automatic Billing Updater (ABU) Integration GuideNexte-Wallet

Last updated 6 months ago

Was this helpful?


Setup

You can start by downloading your private and public keys to encrypt file and you also have to setup a notification URL so that DOKU can send a notification that the file being processed is completed.

Integration Steps

  • Upload File card registration via ABU SFTP Folder

  • Hit API Notification to DOKU

  • Consume Notification from DOKU

  • Download the result file from DOKU Result Folder

Access

DOKU will create user access for merchants to Read & Write in SFTP DOKU according to the environment. Merchants will send their IP for DOKU Whitelist.

Encryption Procedure

Encryption Procedure

  1. Merchants generate random String with length 32 digit Alfa Numeric as SALT.

  2. Merchants put the data on file (txt format) with content format : {Length_Of_Encrypted_SALT}+{Encrypted_SALT}+{Encrypted_Plain_Card_Data}

    • {Length_Of_Encrypted_SALT} : add padding left with "0", so there will be 4 digits (ex : 0344).

    • {Encrypted_SALT} : in Base64 format.

    • {Encrypted_Plain_Card_Data} : in Base64 format.

  3. The txt file data ready to put on DOKU SFTP ./download/ folder

Decryption Procedure

  1. Get the length of the Encrypted SALT:

    • Extract the first 4 digits from the data. These 4 digits represent the length of the encrypted SALT.

    • Cast this value into an integer, which will tell you how long the encrypted SALT is.

  2. Extract the Encrypted SALT:

    • Use the length obtained in Step 1.

    • Extract a substring from the data starting at index 4. This substring runs from index 4 to (index 4 + the length of the encrypted SALT)

  3. Decrypt the Encrypted SALT:

    • Use Merchant RSA Private Key 2048 bit - No Padding decryption to decrypt the extracted Encrypted SALT value.

  4. Extract the Encrypted Data:

    • Now, get the remaining part of the card data, starting from index (4 + length of the Encrypted SALT) to the end of the data. This is the encrypted card data.

  5. Decrypt the Encrypted Data:

    • Use AES 256 with SALT obtained from step 3 to decrypt the encrypted card data.

Folder

SFTP File

In this document will explain in details how to create file for transaction using SFTP. File Upload

Before putting the file in SFTP, we first need to set up the file itself. You will need to create it in TXT Format.

Example .TXT File :

D000001999128616DOKU0001  5XXXXNNNNNNNNNNN   YYMMAAAAA00001
D000001999128616DOKU0002  5XXXXNNNNNNNNNNN   YYMMAAAAA00002

File Explanation

Field Name
Length
Type
Position
Description

detail-identifier

1

AN

1

Value 'D'

merchant-id

15

AN

2-16

Valid merchant ID or Payment Facilitator ID

merchant-request-identifier-1

10

AN

17-26

Tracking number for merchant, must be unique per batch file

PAN number

19

N

27-45

Old PAN Number

Expiry Date

4

N

46-49

YYMM Format

merchant-request-identifier-2

20

AN

50-69

Tracking number for merchant

filler

20

AN

70-89

Blank spaces

File Report

After transaction finish DOKU will generate report in TXT format, like Example below. Merchant can get the data in to folder “upload”.

D000000000000002AAAA0001  5185515000000334   5185515000000334   22122212VALID AAAAA00001          V                   
D000000000000002AAAA0002  5185693000000115   5185693000000115   22122212VALID AAAAA00002          V                   
D000000000000002AAAA0003  4005550010538560   5410221000000112   11052212UPDATEAAAAA00003                              
Field Name
Length
Type
Position
Description

detail-identifier

1

AN

1

Value 'D'

merchant-id

15

AN

2-16

Valid merchant ID or Payment Facilitator ID

merchant-request-identifier-1

10

AN

17-26

Tracking number for merchant

Old PAN Number

19

AN

27-45

Old PAN Number

New PAN Number

19

AN

46-64

New PAN Number

Old Expiry Date

4

N

65-68

YYMM Format

New Expiry Date

4

AN

69-72

YYMM Format

Reason Identifier

6

AN

73-78

Contains one of the following values for account requests that had a match: • UPDATE—Match made; update data provided (includes issuer Reason Codes R, B, and P) • CONTAC—Match made; account closed (includes Issuer Reason Code C) • EXPIRY—Match made; expiration date changed (includes Issuer Reason Code E) • VALID—No updates were found but the account is valid. • UNKNWN—The account number could not be found in the ABU database. (See the Response Indicator for further explanation.)

merchant-request-identifier-2

20

AN

79-98

Tracking number for merchant

response indicator

1

A

99

ABU Validation Response Indicator (displayed only when the Reason Identifier is VALID or UNKNWN) • V—matches the account as reported by the issuer • P—No match, participating BIN/ issuer • N—No match, non-participating BIN/issuer

filler

19

AN

100-118

Blank Spaces

Merchant Notification

Notification API

Request

Here is the sample of request header to notify DOKU

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

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

Merchant Notify to DOKU

After merchants put file data in SFTP, merchants will trigger DOKU to get data file in SFTP with this API.

Format: REST API (JSON)

Type
Value

HTTP Method

POST

API endpoint (Sandbox)

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

API endpoint (Production)

https://api.doku.com/abu/notify

Request Body

Parameter
Data Type
Type
Description

file_name

String(128)

Mandatory

File name merchant put in DOKU sftp download folder

Example Request:

{
  "file_name": "example.txt"
}

Response Body

name

String (128)

Mandatory

File name

status

String (128)

Mandatory

IN_PROCESS response

error.code

String (128)

Optional

Response Code

error.message

String (128)

Optional

Response Message

error.type

String (128)

Optional

Error Type

Example Response Success:

Http status code: 201

{
  "name": "example.txt",
  "status": "IN_PROCESS"
}

List of error message

invalid header signature

invalid_signature

400

Invalid Signature

idempotent request

idempotent_request

400

Double request with same request id under 20 second

file_name must not be empty

invalid_parameter

400

Not input object file_name

File not found in SFTP

not_found

404

File not found in DOKU sftp download folder

DOKU Notify to Merchant

After DOKU create report in SFTP, DOKU will notify merchant to get report.

Guide how to handle payment notification can refer to: https://jokul.doku.com/docs/docs/http-notification/overview

Request

Format: REST API (JSON)

service.id

string

Mandatory

Batch Upload Service

batch_file.name

string

Mandatory

Batch file Upload name

batch_file.status

string

Mandatory

Status of processed file Done

batch_file.date

timestamp

Mandatory

Date file finish processed

Example :

{
  "service": {
    "id": "ABU"
  },
  "abu_file": {
    "name": "example.txt",
    "status": "DONE",
    "message": "SUCCESS",
    "date": "2021-07-29T13:52:53Z"
  }
}

Merchants encrypt plain card data using AES 256 Key Size, Chiper ECB, pkcs5 padding with SALT to Base64 encoded format.

Merchants encrypt the SALT using a DOKU RSA Public Key 2048 bit - No Padding to Base64 encoded format.

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

https://www.devglan.com/online-tools/aes-encryption-decryption
https://www.devglan.com/online-tools/rsa-encryption-decryption
this section
DOKU Automatic Billing Updater Flow Diagram