Before you start integrating Checkout, make sure the following are ready:
merchantNoreturnUrl and notifyUrlOnce these basics are ready, you can continue with the integration.
The Checkout request needs to prepare the payer, amount, redirect target, and asynchronous notification target in one place.
Start by confirming these fields:
| Field | Purpose |
|---|---|
merchantNo | Merchant identity |
merchantTxnId | Merchant-side transaction ID for correlation and idempotency |
orderAmount | Order amount |
orderCurrency | Order currency |
txnType | Transaction type, usually SALE |
txnOrderMsg | Container for callback URLs and additional business data |
The minimal request usually includes these fields:
{
"merchantNo": "800209",
"merchantTxnId": "e868e769-afe5-41f7-9882-04835122e0b3",
"orderAmount": "100.00",
"orderCurrency": "USD",
"txnType": "SALE",
"txnOrderMsg": {
"returnUrl": "https://your-domain.com/checkout/result?merchantTxnId=YOUR_TXN_ID",
"notifyUrl": "https://your-domain.com/webhook"
}
}
For subscription Checkout, you can add subProductType and subscription in the subscription guide.
returnUrl / notifyUrlBoth returnUrl and notifyUrl should be included in the Checkout request, but they serve different purposes:
| Field | Purpose |
|---|---|
returnUrl | Redirect target after payment, used for display or re-checking status |
notifyUrl | Server-to-server notification endpoint used to confirm the final result |
returnUrl is only for page display, re-checking, and guiding the customer to the next step. It should not be the final basis for fulfillment. Use webhook notifications or a verified order query result instead.You can simulate webhook events locally to validate the integration quickly:
localhost:3000)# Expose the local port with ngrok
ngrok http 3000
# Get the HTTPS URL (for example https://abc123.ngrok.io)
notifyUrl to the generated public URL (for example https://abc123.ngrok.io/webhook)fulfill_checkout was called and the merchantTxnId matchedAfter the payment test is complete, check the following items one by one:
fulfill_checkout function was called correctlyWhen you create a Checkout session, specify both notifyUrl and returnUrl in the txnOrderMsg parameter:
{
"merchantNo": "800209",
"merchantTxnId": "e868e769-afe5-41f7-9882-04835122e0b3",
"orderAmount": "100.00",
"orderCurrency": "USD",
"txnType": "SALE",
// ... other required parameters
"txnOrderMsg": "{
\"notifyUrl\": \"https://your-domain.com/webhook\",
\"returnUrl\": \"https://your-domain.com/order-complete?merchantTxnId=e868e769-afe5-41f7-9882-04835122e0b3\",
\"appId\": \"your-app-id\",
\"products\": \"[...]\",
// ... other txnOrderMsg fields
}"
}
Parameter details:
| Parameter | Description |
|---|---|
notifyUrl | Webhook endpoint URL used to receive payment result notifications |
returnUrl | Landing page URL that customers are redirected to after payment |
We recommend appending merchantTxnId to returnUrl (for example https://your-domain.com/order-complete?merchantTxnId=YOUR_TXN_ID) so the page can query and display the final payment status when it loads.