For the complete documentation index, see llms.txt. This page is also available as Markdown.

HTTP Notification Sample for SNAP

HTTP Notification sample for SNAP Payment Methods

After setting up your Notification URL, we will send the notification for certain events such as when the Virtual Account has been paid by your customers, etc.

Once the customers finish the payment, DOKU will send the notification to your defined Notification URL.

Virtual Account

Here is the sample notification that DOKU will send to merchant's server. For Virtual Account SNAP has same sample notification.

The list of Virtual Account SNAP, you can find here.

Payment Notification

post

Payment Notification

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: 77777
customerNostringRequired

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

Example: 0000000000001
virtualAccountNostringRequired

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

Example: 777770000000000001
virtualAccountNamestringRequired

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

Example: Toru Yamashita
trxIdstringRequired

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

Example: 23219829713
paymentRequestIdstringOptional

Unique identifier generated by PJP. If Payment comes from the Inquiry process, this value must be the same with inquiryRequestId. | min length: 1 | max length: 30

Example: 12839218738127830
virtualAccountEmailstringOptional

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

Example: toru@oor.com
virtualAccountPhonestringOptional

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

Example: 081293912081
Responses
200

item created

application/json
responseCodestringRequired

Response Code with format HTTP status code + service code + case code. | min length: 1 | max length: 7

Example: 2002500
responseMessagestringRequired

Response Description. | min length: 1 | max length: 150

Example: Success
post/v1/transfer-va/payment

Direct Debit

Here is the sample notification that DOKU will send to merchant's server. For Direct Debit SNAP has same sample notification.

The list of Direct Debit SNAP, you can find here.

Notify endpoint

post
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
X-DEVICE-IDstringRequired

Device identification on which the API services are currently being accessed by the end user (customer). Can’t contain symbols

Example: 95221
X-IP-ADDRESSstringOptional

conditional. IP address of the end user (customer) using IPv4 format

Example: 95221
Authorization-customerstringRequired

Access token obtained from B2B2C API merchant

Example: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
AuthorizationstringRequired

Access Token obtained from Get B2B Token API from merchant

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

Original Partner Reference Number | min length: 1 | max length: 64

Example: INVALLO201223002
originalReferenceNostringRequired

Original Reference Number | min length: 1 | max length: 64

Example: 2023122000000002e21131
originalExternalIdstringRequired

Original External ID from payment process | min length: 1 | max length: 64

Example: 660156703
latestTransactionStatusstringRequired

latest transaction status of transaction | format: 00 (Success) / 03 (Pending) / 04 (Refunded) / 05 (Canceled) / 06 (Failed)

Example: 00
transactionStatusDescstringRequired

description of transaction status

Example: Success
Responses
200

Success

application/json
responseCodestringRequiredExample: 2005600
approvalCodestringRequiredExample: 201039000200
responseMessagestringRequiredExample: Request has been processed successfully
post/v1.0/debit/notify
200

Success

E-wallet

The notification format for SNAP e-wallet transactions exhibits minor differences from those of other e-wallets. For further details please refer to sample notification below.

1. Binding Notification

Binding Result Notification to Merchant

post
Header parameters
X-PARTNER-IDstring · max: 32Required

The merchant's client ID registered with DOKU

Example: merchant-client-id-001
X-EXTERNAL-IDstring · max: 36Required

A unique ID generated by DOKU for each notification. The merchant can use this value for idempotency checks.

Example: notif-bind-20260609-000001
X-TIMESTAMPstringRequired

Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)

Example: 2026-06-09T10:00:00+07:00Pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+\-]\d{2}:\d{2}$
X-SIGNATUREstringRequired

HMAC-SHA512 digital signature for verifying the authenticity of the notification. The merchant MUST verify this signature before processing the notification.

Verification steps:

  1. Construct stringToSign: HTTP-METHOD:RELATIVE-URL:ACCESS-TOKEN:HEX(SHA256(requestBody)):TIMESTAMP
  2. Compute HMAC-SHA512 using the merchant's clientSecret as the key.
  3. Compare against the value of this header.
Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
Authorization-CustomerstringOptional

Customer's B2B2C access token (DOKU B2B2C token) associated with this binding session. Present when the customer holds an active DOKU B2B2C token.

Example: Bearer eyJhbGciOiJSUzI1NiJ9.customer...
Body

Payload sent by DOKU to the merchant's binding notification URL

originalExternalIdstring · max: 36Required

The X-EXTERNAL-ID value from the original binding request submitted by the merchant. Used by the merchant to correlate this notification with the original binding request.

Example: ext-bind-20260609-00001
Responses
200

Notification successfully received and processed by the merchant.

application/json

Expected acknowledgement from the merchant. DOKU only requires HTTP 200 — the response body is optional. If provided, it should follow the SNAP response code format: HTTP Status (3) + Service Code 07 (2) + Case Code (2).

responseCodestringOptional

SNAP-format response code. Example: 2000700 = HTTP 200 + service 07 + case 00 (Successful).

Example: 2000700
responseMessagestringOptional

Human-readable response message

Example: Successful
posthttps://{api-domain}/v1.0/debit/notify

2. Payment Notification

Payment Notification to Merchant

post

DOKU sends a payment transaction notification to the merchant's configured notification URL.

Header parameters
X-PARTNER-IDstring · max: 36Required

The merchant's client ID registered with DOKU

Example: merchant-client-id-001
X-EXTERNAL-IDstring · max: 32Required

A unique ID generated by DOKU for each notification. The merchant can use this value for idempotency checks.

Example: notif-20260526-000001
X-TIMESTAMPstringRequired

Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)

Example: 2026-05-26T10:00:00+07:00
X-SIGNATUREstringRequired

HMAC-SHA512 digital signature for verifying the authenticity of the notification. The merchant must verify this signature before processing the notification.

Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
CHANNEL-IDstringOptional

The channel ID used. Default is "DH" (Direct Hosting)

Default: DHExample: DH
Authorization-CustomerstringOptional

Customer B2B2C token (dokuB2b2cToken) if available from the binding process. Only present if the customer has an active token.

Example: Bearer eyJhbGciOiJSUzI1NiJ9...
Body

Payment notification body sent by DOKU to the merchant.

originalPartnerReferenceNostring · max: 64Required

The transaction invoice number used as the merchant's reference. This value matches the partnerReferenceNo sent in the original payment request.

Example: INV-20260526-001
originalReferenceNostring · max: 64Required

The reference number assigned by the acquirer. Can be used for reconciliation purposes with the acquirer.

Example: REF-987654321
originalExternalIdstring · max: 36Required

External ID from the original payment request (the request ID sent by the merchant).

Example: ext-req-20260526-001
latestTransactionStatusstring · max: 2Required

The latest transaction status as a two-digit code:

  • 00 — Success
  • 03 — Pending
  • 04 — Refunded
  • 05 — Canceled
  • 06 — Failed
Example: 00
transactionStatusDescstring · max: 50Required

Description of the transaction status, corresponding to latestTransactionStatus

Example: Success
Responses
200

Notification successfully received and processed by the merchant. DOKU only requires HTTP 200 to consider the notification successful.

application/json
responseCodestringRequired

Response code in the format: HTTP Status Code (3 digits) + Service Code (2 digits) + Case Code (2 digits). The service code for notify is 56.

Example: 2005600
responseMessagestringRequired

Response message

Example: Successful
approvalCodestringOptional

Approval Code

Example: 123456
post/v1.0/debit/notify

3. Refund Notification

Refund Notification to Merchant

post

DOKU sends a refund transaction notification to the merchant's configured notification URL.

Header parameters
X-PARTNER-IDstring · max: 36Required

The merchant's client ID registered with DOKU

Example: merchant-client-id-001
X-EXTERNAL-IDstring · max: 32Required

A unique ID generated by DOKU for each notification. The merchant can use this value for idempotency checks.

Example: notif-20260526-000002
X-TIMESTAMPstringRequired

Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)

Example: 2026-05-26T10:05:00+07:00Pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+\-]\d{2}:\d{2}$
X-SIGNATUREstringRequired

HMAC-SHA512 digital signature for verifying the authenticity of the notification. The merchant must verify this signature before processing the notification.

Example: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
CHANNEL-IDstringOptional

The channel ID used. Default is "DH" (Direct Hosting)

Default: DHExample: DH
Authorization-CustomerstringOptional

Customer B2B2C token (dokuB2b2cToken) if available from the binding process. Only present if the customer has an active token.

Example: Bearer eyJhbGciOiJSUzI1NiJ9...
Body

Refund notification body sent by DOKU to the merchant.

originalPartnerReferenceNostring · max: 64Required

The invoice number of the original payment transaction. This value matches the partnerReferenceNo sent in the original payment request.

Example: INV-20260526-001
originalReferenceNostring · max: 64Required

The reference number assigned by the acquirer for the original payment. Can be used for reconciliation purposes with acquirer.

Example: REF-987654321
originalExternalIdstring · max: 36Required

External ID from the original payment request (the request ID sent by the merchant).

Example: ext-req-20260526-001
latestTransactionStatusstring · max: 2Required

The latest transaction status as a two-digit code:

  • 00 — Success
  • 03 — Pending
  • 06 — Failed
Example: 00
transactionStatusDescstring · max: 50Required

Human-readable description of the transaction status, corresponding to latestTransactionStatus

Example: Success
Responses
200

Notification successfully received and processed by the merchant. DOKU only requires HTTP 200 to consider the notification successful.

application/json
responseCodestringRequired

Response code in the format: HTTP Status Code (3 digits) + Service Code (2 digits) + Case Code (2 digits). The service code for notify is 56.

Example: 2005600
responseMessagestringRequired

Response message

Example: Successful
approvalCodestringOptional

Approval Code

Example: 123456
post/v1.0/debit/notify

Last updated