Skip to content

Place Order ​

Place order. Supports online payment, pure wallet payment and mixed payment; also creates wallet recharge orders with productCode=WALLET_RECHARGE.

Interface Address:

text
/papi/order/create

Request Method:

text
POST

Content-Type:

text
application/json

Header Parameters:

ParameterTypeRequiredDescription
X-Access-KeystringYesAPI access key ID. See API Rules for authentication
X-SignaturestringYesSignature value, Base64-encoded HMAC-SHA256 result
X-TimestampstringYesMillisecond-level Unix timestamp (13 digits)
X-NoncestringYesRandom string, 10~32 lowercase letters + digits

Body Parameters:

ParameterTypeRequiredDescription
productCodestringYesProduct code; fixed to WALLET_RECHARGE for wallet recharge
packageCodestringYesPackage code; not needed for wallet recharge orders
skuCodestringYesSKU code; not needed for wallet recharge orders
quantityintegerNoPurchase quantity, default 1; not needed for wallet recharge orders
amountintegerNoRecharge amount in US cents (e.g. 1000 means 10 USD); decimals are not allowed; used only by wallet recharge orders
currencystringNoCurrency code; only USD is supported; used only by wallet recharge orders
payCodestringYesPayment method code; WALLET for pure wallet payment; must not be WALLET for wallet recharge orders
providerCodestringYesProvider code; INTERNAL for wallet payment
walletPayAmountlongNoWallet payment amount for mixed payment, in cents; must be greater than 0 and less than the order's actual payment amount
autoRenewintegerNoAuto-renewal setting: 0 disabled, 1 enabled, default 0
modelSidstringNoModel SID, required for high-end real device (customizeType=2) orders
payParamsobjectNoPayment parameters
├─ keyobjectNokey

Request Example:

json
{
  "productCode": "CLOUD_PHONE",
  "packageCode": "s2e9pd6r6x",
  "skuCode": "gy5zp58kt3",
  "quantity": 1,
  "payCode": "wxpayUs",
  "providerCode": "Wallyt412",
  "modelSid": "string",
  "payParams": {
    "key": {}
  }
}

Response Parameters:

ParameterTypeDescription
codeintegerError code. See Error Codes
dataobjectResponse data
├─ orderNostringOrder number
├─ qrcodeUrlstringQR code URL
├─ payUrlstringPayment URL
├─ payParamsobjectPayment parameters (specific parameters for various payment methods, such as APP payment parameters)
├─├─ keyobjectkey
├─ payAmountintegerPayment amount (US cents)
├─ payAmountYuannumberPayment amount (USD)
├─ walletPayAmountlongWallet payment amount (US cents)
├─ onlinePayAmountlongOnline payment amount (US cents)
├─ walletBalancestringWallet balance after wallet payment (US cents), may be empty when wallet payment is not used
├─ currencystringCurrency (USD)
├─ expireTimeintegerOrder expiration time (timestamp)
├─ payMethodstringPayment method
├─ payIconstringPayment method icon
├─ payTypeintegerPayment type
├─ paySceneintegerPayment scene
├─ transactionIdstringTransaction ID
├─ productNamestringProduct name
├─ descriptionstringOrder description
msgstringError message

Response Example:

json
{
  "code": 0,
  "data": {
    "orderNo": "",
    "qrcodeUrl": "",
    "payUrl": "",
    "payParams": {
      "": {}
    },
    "payAmount": 0,
    "payAmountYuan": 0.0,
    "walletPayAmount": 0,
    "onlinePayAmount": 0,
    "walletBalance": "0",
    "currency": "",
    "expireTime": 0,
    "payMethod": "",
    "payIcon": "",
    "payType": 0,
    "payScene": 0,
    "transactionId": "",
    "productName": "",
    "description": ""
  },
  "msg": ""
}

Notes:

  • Wallet recharge ordering: productCode is fixed to WALLET_RECHARGE (internal product type 7); no package, SKU or quantity is needed. amount is in US cents (e.g. 1000 means 10 USD; decimals are not allowed), and the currency is fixed to USD. payCode must not be WALLET. Confirm crediting via Get Recharge Status.
  • Pure wallet payment: pass payCode=WALLET and providerCode=INTERNAL; the full order amount is used when walletPayAmount is omitted.
  • Mixed payment: pass the actual online payCode plus walletPayAmount (in US cents); it must be greater than 0 and less than the order's actual payment amount computed by the backend, and the online amount is calculated by the backend. It is recommended to get the actual price via Price Calculation before placing the order.
  • High-end real device ordering: orders for high-end real devices (customizeType=2) must pass modelSid (Model SID).
  • On request failure or timeout, query the original order and transactions first; do not use the X-Nonce from the signature as a business idempotency key.

Wallet payment rules ​

Wallet payment uses payCode=WALLET and providerCode=INTERNAL. Mixed payment uses the actual online channel plus an integer walletPayAmount in USD cents, greater than zero and below the calculated payable total; do not submit onlinePayAmount. Recharge orders cannot use wallet or mixed payment. On timeout or uncertain payment status, query the original order and transactions before retrying. Cancellation or switching to wallet payment requires reliable confirmation that an existing online payment is closed. Wallet deductions are returned against the original transaction when cancellation is permitted.

Recharge: use productCode=WALLET_RECHARGE, positive JSON integer amount (for example 1000), and USD (default); omit SKU, package, quantity, product type and business requestId. providerCode must not be INTERNAL. payNo is ignored by this response VO. Only premium real-device purchases require modelSid, obtained from the brand/model endpoint; this applies to wallet, online and mixed payment.

OpenAPI Docs