Skip to main content
POST
/
v1
/
pay
/
order
Create Order
curl --request POST \
  --url https://openplatform.gateapi.io/v1/pay/order \
  --header 'Content-Type: application/json' \
  --header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
  --header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
  --header 'X-GatePay-Signature: <x-gatepay-signature>' \
  --header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
  --data '
{
  "merchantTradeNo": "22212345678555",
  "env": {
    "terminalType": "APP"
  },
  "currency": "GT",
  "orderAmount": "1.21",
  "goods": {
    "goodsType": "312221",
    "goodsName": "NF2T",
    "goodsDetail": "123444"
  }
}
'
{
  "code": "SUCCESS",
  "message": "订单创建成功",
  "data": {
    "orderId": "GATE202400001",
    "merchantTradeNo": "22212345678555",
    "paymentUrl": "https://pay.gateapi.io/paypage?order=GATE202400001",
    "qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "orderAmount": "1.21",
    "currency": "GT",
    "expireTime": 1672909255498,
    "orderStatus": "CREATED",
    "createTime": 1672905655498
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.gate.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

This page documents the /v1/pay/order endpoint. The full schema, parameters, and examples are rendered from the linked OpenAPI definition above.

Notes

Headers

X-GatePay-Certificate-ClientId
string
required

Merchant client ID obtained from the GatePay platform

Example:

"4186d0c6-6a35-55a9-8dc6-5312769dbff8"

X-GatePay-Signature
string
required

HMAC-SHA256 signature used to verify request validity

Example:

"672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77"

X-GatePay-Timestamp
string
required

Timestamp in milliseconds. The difference from server time must not exceed 5 minutes.

Example:

"1672905655498"

X-GatePay-Nonce
string
required

Nonce used to prevent replay attacks

Example:

"9578"

Body

application/json

Payment order creation parameters

merchantTradeNo
string
required

Merchant order number. Must be unique.

Required string length: 5 - 32
Example:

"22212345678555"

env
object
required
currency
string
required

Order currency. Refer to the "Supported Networks and Currencies" section above for the currently supported options.

Example:

"GT"

orderAmount
string
required

Order amount. Must be a positive number and supports decimals.

Pattern: ^\d+(\.\d{1,2})?$
Example:

"1.21"

goods
object
required
orderExpireTime
integer<int64>

Order expiration time as a UTC timestamp in milliseconds. Defaults to 1 hour if omitted, and the maximum expiration time is 1 hour.

Example:

1770789143000

returnUrl
string<uri>

Return URL after the order is paid successfully. Maximum length is 256 characters. Redirection occurs only after payment is completed on the hosted payment page.

Maximum string length: 512
Example:

"http://47.99.158.63:8205/payment/redirect"

cancelUrl
string<uri>

Return URL after the order payment is cancelled.

Maximum string length: 512
Example:

"http://47.99.158.63:8205/payment/redirect"

channelId
string

Customer channel name

Maximum string length: 32
Example:

"123456"

Response

200 - application/json

Payment order created successfully

code
enum<string>

Response code

Available options:
SUCCESS,
ERROR
Example:

"SUCCESS"

message
string

Response message

Example:

"订单创建成功"

data
object