Link & Pay

Merchant Workflow

To initiate the payment in this scenario, the merchant needs to complete the following steps:

  1. Completed account linking request and store returned access token

  2. Optional: to retrieve user information or coin redemption using access token

  3. Initiate a payment request for Link & Pay when customer selects to pay

  1. Optionally, before initiating a payment, the merchant can call the two endpoints below based on the use cases
    • Get User Information: ShopeePay will inform the merchant of the customer’s current wallet balance, KYC status etc, should the merchant require any such checks beforehand.
    • Get Coin Redemption: ShopeePay will inform the merchant of the customer’s Shopee Coin redemption rules and Coin amount, should the merchant wish to display this information.
  2. Merchant calls Create Payment Order: Link & Pay endpoint to create payment for the customer. ShopeePay will return a redirect_url for the merchant to allow the user to enter.
  3. Customer selects a payment method and confirms payment.
  4. ShopeePay processes the payment and returns the customer back to the merchant’s page.
  5. ShopeePay will sends an asynchronous message via Notify Transaction Status endpoint to inform merchants on the payment result.
  6. Merchants can also call the Check Transaction Status endpoint to query the status of the transaction.
    • If the response code is "Success", merchant can mark this transaction as successful.
    • If the response code is "Failed", merchant can mark this transaction as failed.
    • If the transaction is in a processing status, please retry the request at an incremental time range of every 5 seconds (e.g., 5 seconds, 10 seconds, 15 seconds, and so on) up to a maximum of 100 seconds. If there is no response after 100 seconds, please retry the request at an incremental time range of every 5 minutes up to 24 hours.
    • If the transaction has no response, please retry the request at an incremental time range of every 5 seconds (e.g., 5 seconds, 10 seconds, 15 seconds, and so on) up to a maximum of 100 seconds. If there is no response after 100 seconds, please retry the request at an incremental time range of every 5 minutes up to 24 hours.
    • If customer can show evidence of payment success on their payment app, merchant may choose to consider payment as successful and wait for reconciliation process on T+1 to settle discrepancies with ShopeePay, if any.

Use this endpoint to create a payment with an access token and a hosted-checkout page

  • URL: "/v3/merchant-host/transaction/payment/direct"

Request Parameters

FieldTypeMandatoryDescription
request_idstringYUnique identifier for each request, accepts up to 64 characters.
payment_reference_idstringYUnique identifier of payment transaction generated by merchant.
merchant_ext_idstringYUnique identifier of merchant in merchant's system.
store_ext_idstringYUnique identifier of store in merchant's system.
access_tokenstringYThe access token obtained from ShopeePay via the Get Access Token when the customer linked their account.
amountint64YAmount used for the payment, inflated by a factor of 100. A positive integer in the smallest currency unit, with no decimal point.
currencystringYCurrency that is associated with the payment amount.
return_urlstringYIndicates the URL of the merchant's platform to return back to, once the payment on ShopeePay’s page is completed.
use_coinbooleanNUse this field to indicate whether the customer prefers to use or not to use coins to offset their payment on the merchant’s platform. The default value is set to false.
promo_idsstringNComma separated eligible promo_ids of 100 characters or less (up to 20), if any.
additional_infostringNAdditional information will be in json format.
expiry_timeuint32NUnix timestamp.

Sample API Request

REQUEST

{
"request_id": "input-unique-request-id-here",
"payment_reference_id":"ref-must-be-unique",
"merchant_ext_id": "external-merchant",
"store_ext_id":"external-store",
"access_token": "uXjWuhPGepSOtntoC8kTK5er6DlbUiGeSJDt53",
"amount": 1000000,
"currency": "IDR",
"use_coin": true,
"return_url": "https://isv-domain.com",
"expiry_time": 1716193900
}
arrow-svg

Copy

Response Parameters

FieldTypeDescription
request_idstringThe same value as the request_id in the request.
errcodestringError code to specify the error returned.
debug_msgstringDebug message to provide more information.
redirect_urlstringThe URL for the merchnat’s front-end to redirect the user to ShopeePay’s page.

Sample API Response

RESPONSE

{
"request_id": "input-unique-request-id-here",
"errcode": 0,
"debug_msg": "success",
"redirect_url": "https://uat.shopee.id/s/browser/payment/auth/passcode-verify?mode=fullscreen&next=https%3A%2F%2Fuat.shopee.vn%2Fs%2Fbrowser%2Fpayment%2Fauth%2FtokenizedPaymentResult%3Freturn_url%3Dhttps%253A%252F%252Fgoogle.com%26ticket%3DbxfWQkI0VfGzlj7ANMudkMYO9RvkO1PM&return_url=https%3A%2F%2Fuat.shopee.vn%2Fs%2Fbrowser%2Fpayment%2Fauth%2FtokenizedPaymentResult%3Fresult%3D201%26return_url%3Dhttps%253A%252F%252Fgoogle.com%26ticket%3DbxfWQkI0VfGzlj7ANMudkMYO9RvkO1PM&scenario=7cdccb66-cd7a-448f-a01f-b2ddd8970e53&source=TokenizedPayment&ticket=bxfWQkI0VfGzlj7ANMudkMYO9RvkO1PM"
}
arrow-svg

Copy

Response Code

ValueDescription
-2A server dropped the connection
-1A server error occurred
0Success
1The request parameters is invalid or a mandatory parameter is empty
2Permission denied, often due to invalid status
4Not found, often due to merchant/store/user/transaction not found
9Customer’s account is banned
11Duplicated request
14Customer’s account is deleted
24Customer's account is frozen
27Customer's account is not activated
42Insufficient balance
43Insufficient balance
50The request parameters is invalid due to payload sent is not a valid JSON
105Invalid auth code
140Customer’s wallet limit is reached
1001Customer is not allowed to make the transaction
1100ShopeePay internal payment module error
1101ShopeePay internal payment module error
1102Customer’s SPL credit limit is reached
1103Customer is required to link their bank account
1104Ineligible payment channel
1105Transaction failed due to unsuccessful authentication
1106Duplicated payment
1200ShopeePay internal payment module error
1201ShopeePay internal payment module error
1500ShopeePay internal payment module error
1800ShopeePay internal payment module error
1801ShopeePay internal payment module error
1906Unable to process refund due to transaction has been failed
1907Ineligible payment channel
1908Service is temporarily down for scheduled maintenance
300088Customer is required to complete verification
300210ShopeePay scam warning error message