# Create a GMPay order 

**POST**`https://pay.example.com/payments/gmpay/v1/order/create-transaction`

[Request example ↓](https://epusdt.com/api/endpoints/create-order#request-example)

Sign the request on your server and open `payment_url` for the buyer. Supply `token` and `network` together or omit both so the buyer can choose at checkout.

## Parameters 

| Field         | Type   | Required    | Description                                                                                                                                      |
| ------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| pid           | string | Yes         | Merchant PID used to look up the signing key.                                                                                                    |
| order\_id     | string | Yes         | Unique merchant order ID, up to 32 characters.                                                                                                   |
| currency      | string | Yes         | Fiat currency, for example usd or cny.                                                                                                           |
| token         | string | Conditional | Receiving asset. Pair with network or omit both.                                                                                                 |
| network       | string | Conditional | Network ID from public config, for example binance.                                                                                              |
| amount        | number | Yes         | Fiat amount, greater than 0.01.                                                                                                                  |
| notify\_url   | string | Yes         | Asynchronous success callback URL.                                                                                                               |
| redirect\_url | string | No          | Browser return URL.                                                                                                                              |
| name          | string | No          | Product or order name.                                                                                                                           |
| payment\_type | string | No          | Defaults to GMPay. EPay (case-insensitive) selects EPay callback format and requires a numeric PID. Include any nonempty value in the signature. |
| signature     | string | Yes         | 64-character lowercase HMAC-SHA256 signature.                                                                                                    |

The sample signature uses the demonstration key `epusdt_secret_key`. Recalculate it on your server whenever the fields or merchant key change.

## Related resources 

* [Open hosted checkout](https://epusdt.com/api/endpoints/open-checkout)
* [Signatures](https://epusdt.com/api/payment#signing)

## Responses

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` object  
Response payload; null on error.

  * `trade_id` string
  * `order_id` string
  * `status` integer
  * `expiration_time` integer
  * `payment_url` string
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

application/jsonResponse fields
* `status_code` integer  
Application result code.
* `message` string  
Human-readable result.
* `data` null  
Response payload; null on error.
* `request_id` string  
Request identifier for tracing.

[error-codes.json ↓](https://epusdt.com/agent-setup/error-codes.json)

**Request example**

Gateway URL 

```
curl -i -X POST \
  'https://pay.example.com/payments/gmpay/v1/order/create-transaction' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "pid": "1000",
  "order_id": "ORD202605230001",
  "currency": "cny",
  "token": "usdt",
  "network": "tron",
  "amount": 100,
  "notify_url": "https://merchant.example/notify",
  "redirect_url": "https://merchant.example/return",
  "name": "VIP",
  "signature": "6f874b1919d95081835e2809b620e354a5866f5a6dbb2e432d1627f1eb10059d"
}'
```

**Example response**200 · Success401 · Invalid signature400 · 10009 · Invalid parameters400 · 10041 · Invalid notification URL400 · 10002 · Order already exists400 · 10004 · Amount below payment precision400 · 10014 · Network disabled400 · 10016 · Asset not found400 · 10003 · No available receiving address400 · 10005 · No available address/amount combination

application/json · Selected response fields

```
{
  "status_code": 200,
  "message": "success",
  "data": {
    "trade_id": "20260523171652123456001",
    "order_id": "ORD202605230001",
    "status": 1,
    "expiration_time": 1779530812,
    "payment_url": "https://pay.example.com/pay/checkout-counter/20260523171652123456001"
  },
  "request_id": "b1344d70-ff19-4543-b601-37abfb3b3686"
}
```
