> For the complete documentation index, see [llms.txt](https://developers.doku.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.doku.com/get-started-with-doku-api/notification/http-notification-sample-for-snap.md).

# HTTP Notification Sample for SNAP&#x20;

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.&#x20;

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.&#x20;

The list of Virtual Account SNAP, you can find [here](/accept-payments/direct-api/snap/integration-guide/virtual-account.md).

{% openapi src="/files/AUFdbXiPyL51nDhr34MY" path="/v1/transfer-va/payment" method="post" %}
[Payment Notification.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FnQGwhUXSYpHnXNnr8gVY%2FPayment%20Notification.json?alt=media\&token=cc3fbba5-cbbb-4a36-b63d-0445e9901801)
{% endopenapi %}

### Direct Debit

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

The list of Direct Debit SNAP, you can find [here](/accept-payments/direct-api/snap/integration-guide/direct-debit.md).

{% openapi src="/files/v282JQBer9CUOaTIK0gk" path="/v1.0/debit/notify" method="post" %}
[dd-notify-snap.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FVcWNgbA2bsdEg6UwTdKt%2Fdd-notify-snap.json?alt=media\&token=d0b5dd88-56e0-416c-8b5f-78e59f0a15b8)
{% endopenapi %}

### 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.&#x20;

#### 1. Binding Notification

## POST https\://{api-domain}/v1.0/debit/notify

> Binding Result Notification to Merchant

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Core System - Notify Binding to Merchant (EMONEY_OVO_SNAP)","version":"1.0.0"},"paths":{"https://{api-domain}/v1.0/debit/notify":{"post":{"summary":"Binding Result Notification to Merchant","description":null,"operationId":"notifyBindingMerchantEmoneyOvoSnap","tags":["Merchant Notification"],"parameters":[{"name":"X-PARTNER-ID","in":"header","required":true,"description":"The merchant's client ID registered with DOKU","schema":{"type":"string","maxLength":32}},{"name":"X-EXTERNAL-ID","in":"header","required":true,"description":"A unique ID generated by DOKU for each notification.\nThe merchant can use this value for idempotency checks.\n","schema":{"type":"string","maxLength":36}},{"name":"X-TIMESTAMP","in":"header","required":true,"description":"Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+\\-]\\d{2}:\\d{2}$"}},{"name":"X-SIGNATURE","in":"header","required":true,"description":"HMAC-SHA512 digital signature for verifying the authenticity of the notification.\nThe merchant MUST verify this signature before processing the notification.\n\n**Verification steps:**\n1. Construct `stringToSign`: `HTTP-METHOD:RELATIVE-URL:ACCESS-TOKEN:HEX(SHA256(requestBody)):TIMESTAMP`\n2. Compute HMAC-SHA512 using the merchant's `clientSecret` as the key.\n3. Compare against the value of this header.\n","schema":{"type":"string"}},{"name":"Authorization-Customer","in":"header","required":false,"description":"Customer's B2B2C access token (DOKU B2B2C token) associated with this binding session.\nPresent when the customer holds an active DOKU B2B2C token.\n","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingNotificationRequest"}}}},"responses":{"200":{"description":"Notification successfully received and processed by the merchant.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingNotificationResponse"}}}},"400":{"description":"Merchant could not parse or validate the notification request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingNotificationErrorResponse"}}}},"401":{"description":"Merchant rejected the notification due to invalid or unverifiable signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingNotificationErrorResponse"}}}},"500":{"description":"Internal server error on the merchant side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingNotificationErrorResponse"}}}}}}}},"components":{"schemas":{"BindingNotificationRequest":{"type":"object","description":"Payload sent by DOKU to the merchant's binding notification URL","required":["originalExternalId","additionalInfo"],"properties":{"originalExternalId":{"type":"string","description":"The `X-EXTERNAL-ID` value from the original binding request submitted by the merchant.\nUsed by the merchant to correlate this notification with the original binding request.\n","maxLength":36},"additionalInfo":{"$ref":"#/components/schemas/BindingNotificationAdditionalInfo"}}},"BindingNotificationAdditionalInfo":{"type":"object","description":"Additional information about the binding result","required":["custIdMerchant","accountType","tokenId","channelId","status"],"properties":{"custIdMerchant":{"type":"string","description":"The merchant's customer ID, echoed from the original binding request"},"accountType":{"type":"string","description":"The type of acquirer account. Always `WALLET` for OVO.","enum":["WALLET"]},"tokenId":{"type":"string","description":"The DOKU token ID issued for this binding.\nUse this value as the `tokenId` in subsequent payment or balance inquiry requests.\nOnly meaningful when `status` is `SUCCESS`.\n"},"channelId":{"type":"string","description":"Identifies the acquirer and API version that processed the binding.\nFormat: `{acquirerId} {apiVersion}` — always `OVO SNAP` for this channel.\n"},"status":{"type":"string","description":"Final binding result:\n- `SUCCESS` — OTP verified; token is active and ready for payment.\n- `FAILED` — OTP failed or timed out; token has been invalidated.\n","enum":["SUCCESS","FAILED"]},"authCode":{"type":"string","description":"The session ID / OTP auth code from the binding flow.\nCorresponds to the `sessionId` of the binding session in DOKU.\n"}}},"BindingNotificationResponse":{"type":"object","description":"Expected acknowledgement from the merchant.\nDOKU only requires HTTP 200 — the response body is optional.\nIf provided, it should follow the SNAP response code format:\nHTTP Status (3) + Service Code `07` (2) + Case Code (2).\n","properties":{"responseCode":{"type":"string","description":"SNAP-format response code.\nExample: `2000700` = HTTP 200 + service `07` + case `00` (Successful).\n"},"responseMessage":{"type":"string","description":"Human-readable response message"}}},"BindingNotificationErrorResponse":{"type":"object","description":"Error acknowledgement from the merchant","properties":{"responseCode":{"type":"string","description":"SNAP-format error response code"},"responseMessage":{"type":"string","description":"Human-readable error message"}}}}}}
```

#### 2. Payment Notification

## Payment Notification to Merchant

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

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Core System - Notify Payment to Merchant (EMONEY)","version":"1.0.0"},"servers":[{"url":"https://{api-domain}","description":"Merchant notification URL (configured per merchant)","variables":{"merchant-notification-host":{"default":"merchant.example.com","description":"Merchant's registered notification host"}}}],"paths":{"/v1.0/debit/notify":{"post":{"summary":"Payment Notification to Merchant","description":"DOKU sends a payment transaction notification to the merchant's configured notification URL.\n","operationId":"notifyMerchantPaymentEmoneyDanaSnap","tags":["Merchant Notification"],"parameters":[{"name":"X-PARTNER-ID","in":"header","required":true,"description":"The merchant's client ID registered with DOKU","schema":{"type":"string","maxLength":36}},{"name":"X-EXTERNAL-ID","in":"header","required":true,"description":"A unique ID generated by DOKU for each notification.\nThe merchant can use this value for idempotency checks.\n","schema":{"type":"string","maxLength":32}},{"name":"X-TIMESTAMP","in":"header","required":true,"description":"Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)","schema":{"type":"string"}},{"name":"X-SIGNATURE","in":"header","required":true,"description":"HMAC-SHA512 digital signature for verifying the authenticity of the notification.\nThe merchant must verify this signature before processing the notification.\n","schema":{"type":"string"}},{"name":"CHANNEL-ID","in":"header","required":false,"description":"The channel ID used. Default is \"DH\" (Direct Hosting)","schema":{"type":"string","default":"DH"}},{"name":"Authorization-Customer","in":"header","required":false,"description":"Customer B2B2C token (dokuB2b2cToken) if available from the binding process.\nOnly present if the customer has an active token.\n","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyPaymentRequest"}}}},"responses":{"200":{"description":"Notification successfully received and processed by the merchant.\nDOKU only requires HTTP 200 to consider the notification successful.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}},"401":{"description":"Invalid or unverifiable signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}},"500":{"description":"Internal server error on the merchant side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}}}}}},"components":{"schemas":{"NotifyPaymentRequest":{"type":"object","description":"Payment notification body sent by DOKU to the merchant.\n","required":["originalPartnerReferenceNo","originalReferenceNo","originalExternalId","latestTransactionStatus","transactionStatusDesc","amount"],"properties":{"originalPartnerReferenceNo":{"type":"string","description":"The transaction invoice number used as the merchant's reference.\nThis value matches the `partnerReferenceNo` sent in the original payment request.\n","maxLength":64},"originalReferenceNo":{"type":"string","description":"The reference number assigned by the acquirer.\nCan be used for reconciliation purposes with the acquirer.\n","maxLength":64},"originalExternalId":{"type":"string","description":"External ID from the original payment request (the request ID sent by the merchant).","maxLength":36},"latestTransactionStatus":{"type":"string","description":"The latest transaction status as a two-digit code:\n- `00` — Success\n- `03` — Pending\n- `04` — Refunded\n- `05` — Canceled\n- `06` — Failed\n","maxLength":2},"transactionStatusDesc":{"type":"string","description":"Description of the transaction status, corresponding to `latestTransactionStatus`","maxLength":50},"amount":{"$ref":"#/components/schemas/AmountDto"},"additionalInfo":{"$ref":"#/components/schemas/PaymentAdditionalInfo"}}},"AmountDto":{"type":"object","description":"Transaction amount information","required":["value","currency"],"properties":{"value":{"type":"string","description":"Transaction amount in two-decimal format (e.g. 50000.00)","maxLength":19},"currency":{"type":"string","description":"ISO 4217 currency code","maxLength":3}}},"PaymentAdditionalInfo":{"type":"object","description":"Additional information related to the payment transaction.","properties":{"channelId":{"type":"string","description":"The acquirer channel ID that processed the transaction"},"channel":{"type":"string","description":"DOKU product channel code"},"accountType":{"type":"string","description":"The acquirer account type used"},"custIdMerchant":{"type":"string","description":"The customer ID on the merchant side (merchant customer ID), if available from the token binding process"},"paymentType":{"type":"string","description":"The type of payment performed","enum":["SALE","RECURRING"]}}},"NotifyMerchantResponse":{"type":"object","required":["responseCode","responseMessage"],"properties":{"responseCode":{"type":"string","description":"Response code in the format: HTTP Status Code (3 digits) + Service Code (2 digits) + Case Code (2 digits).\nThe service code for notify is `56`.\n"},"responseMessage":{"type":"string","description":"Response message"},"approvalCode":{"type":"string","description":"Approval Code"}}},"NotifyMerchantErrorResponse":{"type":"object","description":"Error response from the merchant","properties":{"responseCode":{"type":"string","description":"Error response code"},"responseMessage":{"type":"string","description":"Error message"}}}}}}
```

#### 3. Refund Notification

## Refund Notification to Merchant

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

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Core System - Notify Refund to Merchant (EMONEY)","version":"1.0.0"},"servers":[{"url":"https://{api-domain}","description":"Merchant notification URL (configured per merchant)","variables":{"merchant-notification-host":{"default":"merchant.example.com","description":"Merchant's registered notification host"}}}],"paths":{"/v1.0/debit/notify":{"post":{"summary":"Refund Notification to Merchant","description":"DOKU sends a refund transaction notification to the merchant's configured notification URL.\n","operationId":"notifyMerchantRefundEmoneyDanaSnap","tags":["Merchant Notification"],"parameters":[{"name":"X-PARTNER-ID","in":"header","required":true,"description":"The merchant's client ID registered with DOKU","schema":{"type":"string","maxLength":36}},{"name":"X-EXTERNAL-ID","in":"header","required":true,"description":"A unique ID generated by DOKU for each notification.\nThe merchant can use this value for idempotency checks.\n","schema":{"type":"string","maxLength":32}},{"name":"X-TIMESTAMP","in":"header","required":true,"description":"Notification send timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+\\-]\\d{2}:\\d{2}$"}},{"name":"X-SIGNATURE","in":"header","required":true,"description":"HMAC-SHA512 digital signature for verifying the authenticity of the notification.\nThe merchant must verify this signature before processing the notification.\n","schema":{"type":"string"}},{"name":"CHANNEL-ID","in":"header","required":false,"description":"The channel ID used. Default is \"DH\" (Direct Hosting)","schema":{"type":"string","default":"DH"}},{"name":"Authorization-Customer","in":"header","required":false,"description":"Customer B2B2C token (dokuB2b2cToken) if available from the binding process.\nOnly present if the customer has an active token.\n","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyRefundRequest"}}}},"responses":{"200":{"description":"Notification successfully received and processed by the merchant.\nDOKU only requires HTTP 200 to consider the notification successful.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}},"401":{"description":"Invalid or unverifiable signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}},"500":{"description":"Internal server error on the merchant side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyMerchantErrorResponse"}}}}}}}},"components":{"schemas":{"NotifyRefundRequest":{"type":"object","description":"Refund notification body sent by DOKU to the merchant.\n","required":["originalPartnerReferenceNo","originalReferenceNo","originalExternalId","latestTransactionStatus","transactionStatusDesc","amount"],"properties":{"originalPartnerReferenceNo":{"type":"string","description":"The invoice number of the original payment transaction.\nThis value matches the `partnerReferenceNo` sent in the original payment request.\n","maxLength":64},"originalReferenceNo":{"type":"string","description":"The reference number assigned by the acquirer for the original payment.\nCan be used for reconciliation purposes with acquirer.\n","maxLength":64},"originalExternalId":{"type":"string","description":"External ID from the original payment request (the request ID sent by the merchant).","maxLength":36},"latestTransactionStatus":{"type":"string","description":"The latest transaction status as a two-digit code:\n- `00` — Success\n- `03` — Pending\n- `06` — Failed\n","maxLength":2},"transactionStatusDesc":{"type":"string","description":"Human-readable description of the transaction status, corresponding to `latestTransactionStatus`","maxLength":50},"amount":{"$ref":"#/components/schemas/AmountDto"},"additionalInfo":{"$ref":"#/components/schemas/RefundAdditionalInfo"}}},"AmountDto":{"type":"object","description":"Original payment transaction amount","required":["value","currency"],"properties":{"value":{"type":"string","description":"Amount in two-decimal format (e.g. 50000.00)","maxLength":19},"currency":{"type":"string","description":"ISO 4217 currency code","maxLength":3}}},"RefundAdditionalInfo":{"type":"object","description":"Additional information related to refund transaction.","properties":{"channelId":{"type":"string","description":"The acquirer channel ID that processed the transaction"},"channel":{"type":"string","description":"DOKU product channel code"},"accountType":{"type":"string","description":"The acquirer account type used"},"custIdMerchant":{"type":"string","description":"The customer ID on the merchant side, if available from the token binding process"},"paymentType":{"type":"string","description":"The type of the original payment","enum":["SALE","RECURRING"]},"refundNo":{"type":"string","description":"The refund reference number assigned by the acquirer"},"partnerRefundNo":{"type":"string","description":"The refund number from the merchant/partner side (the `partnerRefundNo` sent in the refund request)"},"refundAmount":{"$ref":"#/components/schemas/AmountDto"}}},"NotifyMerchantResponse":{"type":"object","required":["responseCode","responseMessage"],"properties":{"responseCode":{"type":"string","description":"Response code in the format: HTTP Status Code (3 digits) + Service Code (2 digits) + Case Code (2 digits).\nThe service code for notify is `56`.\n"},"responseMessage":{"type":"string","description":"Response message"},"approvalCode":{"type":"string","description":"Approval Code"}}},"NotifyMerchantErrorResponse":{"type":"object","description":"Error response from the merchant","properties":{"responseCode":{"type":"string","description":"Error response code"},"responseMessage":{"type":"string","description":"Error message"}}}}}}
```
