Skip to content

Step 1 Create Order

Request URL: POST /js/create

Request Parameters

Description:

You can check the authentication method first Basic Auth Authentication

ParameterTypeRequiredDescription
orderIdString(128)RequiredMerchant order ID, can be requested repeatedly but only one successful transaction exists
currencyString(3)RequiredCurrency (Example: EUR/USD)
amountNumber(12,3)RequiredTransaction amount
appIdNumber(20)RequiredSystem -> Website App -> APP ID
callbackUrlString(255)Required3D/Checkout callback URL (Generally used for page display logic, such as redirecting to the original product page)
notificationUrlString(255)RequiredAsynchronous notification URL, if this parameter is not empty, a notification will be sent to this address after the transaction is completed (usually used to process order status)
productInfosArrayRequiredProduct information (ProductInfo Details)

Request Example

json
{
  "appId": "1998997704361046000",
  "amount": "12",
  "callbackUrl": "https://test.com",
  "currency": "USD",
  "notificationUrl": "https://test.com/webhook/test/notify",
  "orderId": "1777443202785",
  "productInfos": [
    {
      "productName": "Test Product",
      "currency": "USD",
      "quantity": 1,
      "price": "12.00"
    }
  ]
}

Response Parameters

Order Response Parameters

ParameterTypeDescription
codeNumber(3)Response code, see Appendix for details
appIdNumber(20)System -> Website App -> APP ID
transactionCurrencyString(3)Transaction currency (e.g. CNY/USD)
transactionAmountString(12)Transaction amount
redirectUrlString(255)Redirect URL
transactionTypeString(32)Sale
messageString(255)System return message
tokenString(1024)Order token (required for creating payment in Step 2)
timestampNumberResponse timestamp
expiresNumberBill expiration time (Unit: seconds, default 1 hour)

Response Example

json
{
  "appId": 1998997704361046000,
  "expires": 3599,
  "message": "Token created successfully",
  "orderId": "1777443202785",
  "code": 131,
  "timestamp": 1777443735797,
  "token": "eyJvcmRlcklkIjoiMTc3NzQ0MzczNTQ1MCIsImFwcElkIjoxOTk4OTk3NzA0MzYxMDQ2MDE4LCJtZXJjaGFudE5vIjoiNTU1NzUyIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiIxOTk4OTk3MjgyNzk5OTM5NTg2IiwiaWF0IjoxNzc3NDQzNzM1LCJleHAiOjE3Nzc0NDczMzV9.qB1C4XUOn83jct_boUL4jQKxXdbhL2YLM3mWUvAewo0",
  "transactionAmount": "12",
  "transactionCurrency": "USD",
  "transactionType": "Sale"
}