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: [email protected]
virtualAccountPhonestringOptional

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

Example: 081293912081
Responses
200
item created
application/json
post
POST /v1/transfer-va/payment HTTP/1.1
Host: {merchant-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: 327

{
  "partnerServiceId": "   77777",
  "customerNo": "0000000000001",
  "virtualAccountNo": "   777770000000000001",
  "virtualAccountName": "Toru Yamashita",
  "trxId": "23219829713",
  "paymentRequestId": "12839218738127830",
  "paidAmount": {
    "value": "11500.00",
    "currency": "IDR"
  },
  "virtualAccountEmail": "[email protected]",
  "virtualAccountPhone": "081293912081"
}
{
  "responseCode": "2002500",
  "responseMessage": "Success",
  "virtualAccountData": {
    "partnerServiceId": "   77777",
    "customerNo": "0000000000001",
    "virtualAccountNo": "   777770000000000001",
    "virtualAccountName": "Toru Yamashita",
    "trxId": "23219829713",
    "paymentRequestId": "12839218738127830"
  }
}

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
post
POST /v1.0/debit/notify 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
X-DEVICE-ID: 95221
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
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: 537

{
  "originalPartnerReferenceNo": "INVALLO201223002",
  "originalReferenceNo": "2023122000000002e21131",
  "originalExternalId": "660156703",
  "latestTransactionStatus": "00",
  "transactionStatusDesc": "Success",
  "amount": {
    "value": "10000.00",
    "currency": "IDR"
  },
  "additionalInfo": {
    "channelId": "DIRECT_DEBIT_ALLO",
    "acquirerId": "ALLO",
    "custIdMerchant": "UATALLO1",
    "accountType": "DIRECT_DEBIT",
    "lineItems": [
      {
        "name": "baju",
        "price": "10000.00",
        "quantity": 1
      }
    ],
    "origin": {
      "source": "direct",
      "system": "mid-jokul-checkout-system",
      "product": "CHECKOUT",
      "apiFormat": "SNAP"
    }
  }
}
200

Success

{
  "responseCode": "2005600",
  "approvalCode": "201039000200",
  "responseMessage": "Request has been processed successfully"
}

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.

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: 2023122000000002e92112131
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
post
POST /v1.0/debit/notify 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
X-DEVICE-ID: 95221
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
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: 529

{
  "originalPartnerReferenceNo": "INVALLO201223002",
  "originalReferenceNo": "2023122000000002e92112131",
  "originalExternalId": "660156703",
  "latestTransactionStatus": "00",
  "transactionStatusDesc": "Success",
  "amount": {
    "value": "10000.00",
    "currency": "IDR"
  },
  "additionalInfo": {
    "channelId": "EMONEY_DANA",
    "acquirerId": "DANA",
    "custIdMerchant": "UATDANAO1",
    "accountType": "EMONEY",
    "lineItems": [
      {
        "name": "baju",
        "price": "10000.00",
        "quantity": 1
      }
    ],
    "origin": {
      "source": "direct",
      "system": "mid-jokul-checkout-system",
      "product": "CHECKOUT",
      "apiFormat": "SNAP"
    }
  }
}
200

Success

{
  "responseCode": "2005600",
  "approvalCode": "201039000200",
  "responseMessage": "Request has been processed successfully"
}

Last updated

Was this helpful?