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.

Source of Fund Options for ShopeePay Payment.

There are a few source of fund options that can be used for ShopeePay payments:

  • ShopeePay Wallet Balance – This is the default source of fund for all ShopeePay payments.

  • ShopeePayLater – This option requires prior approval from ShopeePay. DOKU can help facilitate the application process through our Sales and Business team when the channel is activated.

    • Note: To enable ShopeePayLater as an additional source of fund (alongside ShopeePay Wallet Balance), merchants are required to implement the API Refund feature.

API Endpoint

Environment
Endpoint

HTTP Method

POST

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

Request Payment

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-IDstringOptional

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
AuthorizationstringRequired

Access Token obtained from Get B2B Token API

Example: 95221
Body
partnerReferenceNostringRequired

invoice number from partner | max: 64 | Mandatory

Example: INV-0001
validUpTostringOptional

Expired time payment url | format: 2024-07-10T11:57:58+07:00 Maximum expiry date is 1 day/24 hours

Example: 2024-07-10T11:57:58+07:00
pointOfInitiationstringOptional

Point of initiation from partner | value: app/pc/mweb | max: 20

Example: app
Responses
chevron-right
200

Successful

application/json
post
/direct-debit/core/v1/debit/payment-host-to-host
200

Successful


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.

Refund Eligibility

  • To enable ShopeePayLater as an additional source of fund (alongside ShopeePay Wallet Balance), merchants are required to implement the API Refund feature.

  • Refund can only be performed for transactions with successful payment status. Refund may be full or partial, provided that the total refunded amount does not exceed the original transaction amount. Refund requests must be submitted via API.

  • The refund expiration period is set at 365 days, starting from the initial payment date.

  • For transactions paid using ShopeePay Wallet Balance, the refund amount must not cause the user’s wallet balance to exceed the maximum wallet balance limit (up to IDR 2,000,000 for non-verified users and up to IDR 20,000,000 for verified users). If the user’s wallet balance has reached its maximum limit at the time of refund, the refund request will still be accepted via API but will remain in pending/processing status on ShopeePay’s side. The refund will be automatically processed once the user’s wallet balance becomes available. In this scenario, merchants do not need to resubmit the refund request.

  • For transactions paid using ShopeePayLater, refund is expected to be processed in real time under normal conditions. In some edge cases where real-time processing is not successful due to system issues, merchants may contact DOKU support for further assistance and investigation.

API Endpoint

Environment
Endpoint

HTTP Method

POST

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

Request Refund

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-IDstringOptional

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
AuthorizationstringRequired

Access Token obtained from Get B2B Token API

Example: 95221
Body
originalPartnerReferenceNostringRequired

Partner Reference No from Purchase Transaction | max: 64 | Mandatory

Example: INV-0001
originalExternalIdstringOptional

External ID from Purchase Transaction | max: 64 |

Example: REQ-0001
reasonstringOptional

Reason for Refund | max: 255

Example: Request by Customer
partnerRefundNostringRequired

Partner Refund No from Partner | max: 64 | Mandatory

Example: INV-REF-0001
Responses
chevron-right
200

Successful

application/json
post
/direct-debit/core/v1/debit/refund
200

Successful

Last updated