ShopeePay
Integration Steps
Overview of integration process with ShopeePay.
1. Payment
Payment process using ShopeePay doesn't require account binding. After customer creates an order and chooses ShopeePay as payment method on merchant's platform, merchant will hit this payment API to get redirect URLs to ShopeePay's platform for customer to complete the payment.
API Endpoint
HTTP Method
POST
API Sandbox
API Production
Path
.../direct-debit/core/v1/debit/payment-host-to-host
Sample of Request Header, Request Body and Response Body
Notes:
Parameter with (*) is mandatory
Paramater without (*) is optional/conditional
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Device identification on which the API services are currently being accessed by the end user (customer). Can’t contain symbols
95221conditional. IP address of the end user (customer) using IPv4 format
95221Access Token obtained from Get B2B Token API
95221invoice number from partner | max: 64 | Mandatory
INV-0001Expired time payment url | format: 2024-07-10T11:57:58+07:00 Maximum expiry date is 1 day/24 hours
2024-07-10T11:57:58+07:00Point of initiation from partner | value: app/pc/mweb | max: 20
appSuccessful
POST /direct-debit/core/v1/debit/payment-host-to-host 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
Authorization: 95221
Content-Type: application/json
Accept: */*
Content-Length: 286
{
"partnerReferenceNo": "INV-0001",
"validUpTo": "2024-07-10T11:57:58+07:00",
"pointOfInitiation": "app",
"urlParam": {
"url": "https://www.merchant.com/",
"type": "PAY_RETURN",
"isDeepLink": "Y/N"
},
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"channel": "EMONEY_SHOPEE_PAY_SNAP"
}
}Successful
{
"responseCode": "2000500",
"responseMessage": "Successful",
"webRedirectUrl": "https://app-uat.doku.com/link/283702597342040",
"partnerReferenceNo": "INV-0001"
}2. Payment Notification
After payment is completed, DOKU will send HTTP Notification to merchant's defined Notification URL. Learn how to handle the notification from DOKU.
3. Additional Feature
Online Refund
This endpoint is used to create refund request for previous successful payment. Merchant can request a transaction refund to DOKU.
API Endpoint
HTTP Method
POST
API Sandbox
API Production
Path
.../direct-debit/core/v1/debit/refund
Sample of Request Header, Request Body and Response Body
Notes:
Parameter with (*) is mandatory
Paramater without (*) is optional/conditional
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Device identification on which the API services are currently being accessed by the end user (customer). Can’t contain symbols
95221conditional. IP address of the end user (customer) using IPv4 format
95221Access Token obtained from Get B2B Token API
95221Partner Reference No from Purchase Transaction | max: 64 | Mandatory
INV-0001External ID from Purchase Transaction | max: 64 |
REQ-0001Reason for Refund | max: 255
Request by CustomerPartner Refund No from Partner | max: 64 | Mandatory
INV-REF-0001Successful
POST /direct-debit/core/v1/debit/refund 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
Authorization: 95221
Content-Type: application/json
Accept: */*
Content-Length: 244
{
"additionalInfo": {
"channel": "EMONEY_SHOPEE_PAY_SNAP"
},
"originalPartnerReferenceNo": "INV-0001",
"originalExternalId": "REQ-0001",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"reason": "Request by Customer",
"partnerRefundNo": "INV-REF-0001"
}Successful
{
"responseCode": "2000700",
"responseMessage": "Successful",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2024-01-01T09:09:00.123",
"additionalInfo": {
"transactionType": 15,
"latestTransactionStatus": "00",
"createTime": "2024-01-01T09:09:00.123"
}
}Last updated
Was this helpful?