AinePay
EN中文
API Reference

Create Inline Order

Create or retrieve an inline payment order. This endpoint returns full payment details for merchants to build custom payment flows and user interfaces.

Endpoint

  • Method: POST
  • Path: /api/merchant/pay
  • 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_10001
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 placesyes100.12
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

Response Fields

Top-level response structure:

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

Order data:

parametertypedescriptionrequiredexample
data.idstringAinePay internal order ID.yes123456
data.orderIdstringMerchant-side order ID, same as the request.yesORDER_10001
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.addressobjectPayment address info.conditional{"address":"0xabc..."}
data.address.addressstringPayment address.conditional0xabc...
data.address.chainstringBlockchain code.conditionalETH
data.address.coinstringToken symbol.conditionalUSDT
data.address.contractstringToken contract address.conditional0x630E...
data.address.namestringBlockchain name.conditionalEthereum(ERC20)
data.address.urlstringReserved field.conditionalhttps://...
data.qtystringOrder amount as string.yes100.12
data.statusstring(enum)Order status: INIT, PENDING, PAID, or EXPIRED.yesINIT
data.expiredintegerOrder expiration timestamp in milliseconds.yes1760000600000
data.payExpiredintegerPayment page expiration timestamp in milliseconds.yes1760000300000
data.createdintegerCreation timestamp in milliseconds.yes1760000000000
data.updatedintegerLast update timestamp in milliseconds.yes1760000000000

Example Response

{
  "success": true,
  "code": 0,
  "data": {
    "id": 123456,
    "orderId": "ORDER_10001",
    "merchantId": 20001,
    "userId": "U_90001",
    "coin": "USDT",
    "chain": "ETH",
    "address": {
      "address": "0xabc...",
      "chain": "ETH",
      "coin": "USDT",
      "contract": "0x...",
      "name": "Ethereum(ERC20)",
      "url": ""
    },
    "qty": "100.12",
    "status": "INIT",
    "expired": 1760000600000,
    "payExpired": 1760000300000,
    "created": 1760000000000,
    "updated": 1760000000000
  },
  "msg": "ok"
}

Notes

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