AinePay
ENδΈ­ζ–‡
API Reference

Create Checkout Order

Create a checkout order. Merchants do not need to build a custom checkout flow or UI β€” customers complete payment on the checkout page provided by AinePay.

Endpoint

  • Method: POST
  • Path: /api/merchant/checkout
  • Authentication: Required
  • Content-Type: application/x-www-form-urlencoded

Request Parameters

parametertypedescriptionrequiredexample
orderIdstringMerchant order ID, length 5~256, must be unique per merchant. AinePay uses it to identify the unique order and prevent duplicate payable orders for the same merchant order. If the merchant creates an order with the same order ID, the existing order information is returned.yesORDER_10002
userIdstringMerchant-defined user ID in the AinePay system, length 5~256. It must stay stable for the same merchant user because it is also used to generate that user's payment address. The merchant should keep the mapping between this ID and the user in its own system.yesU_90001
coinstring(enum)Token symbolyesUSDT
chainstring(enum)Blockchain codeyesETH
qtydecimal(string)Payment amount, > 0, up to 2 decimal placesyes88.00
collectAddressstringThis address must be registered in the merchant dashboard and in ACTIVE status. If provided, this collect address is used; otherwise the latest active collect address on the same chain is used.no0xabc...
confirmationTypestring(enum)Confirmation tier: LOW / MEDIUM / HIGH. On the ETH chain, the current rules are 1 / 3 / 64 confirmations. If omitted, it is calculated based on the amount: qty > 1000U uses HIGH, qty > 100U uses MEDIUM, otherwise LOW.noLOW
confirmUrlstringRedirect URL after successful payment, length 10~2048yeshttps://merchant.example.com/pay/success
cancelUrlstringRedirect URL after cancellation, length 10~2048yeshttps://merchant.example.com/pay/cancel

Response Fields

Top-level response structure:

fieldtypedescription
successbooleantrue when the request succeeds.
codeintegerBusiness result code. Successful responses return 0.
dataobjectCheckout order business data.
msgstringTypically ok on success; otherwise an error message.

Order data:

parametertypedescriptionrequiredexample
data.idstringAinePay internal order ID.yes123457
data.orderIdstringMerchant-side order ID, same as the request.yesORDER_10002
data.merchantIdintegerMerchant ID.yes20001
data.userIdstringThe user ID assigned by the merchant in the AinePay system, same as the request.yesU_90001
data.coinstring(enum)Coin, same as the request.yesUSDT
data.chainstring(enum)Blockchain code, same as the request.yesETH
data.addressstringPayment address.yes0xabc...
data.qtystringOrder amount as string.yes88
data.statusstring(enum)Order status: INIT, PENDING, PAID, or EXPIRED.yesINIT
data.expiredintegerOrder expiration timestamp in milliseconds.yes1760000600000
data.payExpiredintegerCheckout payment expiration timestamp in milliseconds.yes1760000300000
data.payUrlstringCheckout URL, returned only when status is INIT.conditionalhttps://checkout.ainepay.com?token=xxxx
data.createdintegerCreation timestamp in milliseconds.yes1760000000000
data.updatedintegerLast update timestamp in milliseconds.yes1760000000000

Example Response

{
  "success": true,
  "code": 0,
  "data": {
    "id": 123457,
    "orderId": "ORDER_10002",
    "merchantId": 20001,
    "userId": "U_90001",
    "coin": "USDT",
    "chain": "ETH",
    "address": "0xabc...",
    "qty": "88",
    "status": "INIT",
    "expired": 1760000600000,
    "payExpired": 1760000300000,
    "payUrl": "https://checkout.ainepay.com?token=xxxx",
    "created": 1760000000000,
    "updated": 1760000000000
  },
  "msg": "ok"
}

Notes

  • Repeated requests with the same orderId return the existing order instead of creating a second payable order.