Skip to content

Create pay-in order (hosted checkout) ​

Creates a pay-in order and returns the platform checkout URL. Send the customer there to pay to the account shown on the page. When the money arrives, the platform sends you a callback.

POST/api/open/order/createBuyOrder

Full URL = your API base URL + this path. The base URL is shown in the merchant console under Developers → API & callbacks.

Requires: whitelisted IP, OpenAPI enabled, a pay-in callback URL (or callbackUrl on this order).

Request parameters ​

JSON before encryption:

ParameterTypeRequiredDescription
merchantNostringYesMerchant number, same as the outer one
merchantOrderNostringStrongly recommendedYour order number, unique per merchant (40007). If omitted the platform generates a random one and you won't be able to query by it
amountnumberYesFiat amount, greater than 0, at most two decimals
currencyTypestringYesCurrency code such as CNY, THB, VND; must be enabled for your account
customerNamestringYesPayer's real name. The customer must pay from an account in this name; also used for blacklist checks
customerIdCardNumberstringNoPayer's ID number (used for blacklist checks)
customerPhoneNumberstringNoPayer's phone number
customerCountrystringNoPayer's nationality
paymentTypeintNoRestrict the order to one payment method. CNY: 1 bank card, 2 WeChat, 3 Alipay; other currencies use codes from List payout methods
redirectUrlstringNoWhere the checkout sends the customer after paying
hideUsdtboolNoHide the USDT amount on the checkout page
callbackUrlstringNoCallback URL for this order; defaults to the pay-in callback URL in the console
json
{
  "merchantNo": "your merchant number",
  "merchantOrderNo": "A20261013001",
  "amount": 100,
  "currencyType": "CNY",
  "customerName": "Zhang San",
  "redirectUrl": "https://shop.example.com/pay/done"
}

Response ​

FieldTypeDescription
urlstringCheckout URL to send the customer to
json
{
  "code": 0,
  "message": "success",
  "data": { "url": "https://checkout-domain/#/step1?orderId=…&checkoutToken=…&hideUsdt=&redirectUrl=…" }
}

The checkout URL contains an access token for this order. Give it only to this customer; never publish it.

Common errors ​

40004, 40005, 40007, 40010, 40011, 40012, 40013, 40015, 40016, 40017, 40019 — see Error codes.

Order states ​

orderStateMeaning
1Pending payment
2To be released (customer has paid; waiting for the trader to confirm receipt)
6Released (platform confirmed the money, USDT credited to your balance; you get a callback)
3Success (you replied success to the callback)
4Cancelled
5Expired (the customer didn't pay in time)
7Reversed

Get order always returns the current state.