> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pay247.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建订单

### 支付流程图

<img src="https://mintcdn.com/gopay/sF8dw_ucY0cv3ekq/api-reference/cn/images/payin.png?fit=max&auto=format&n=sF8dw_ucY0cv3ekq&q=85&s=2a402a7c27636eb9b956f3af0bb62a7b" alt="支付流程" width="3670" height="1804" data-path="api-reference/cn/images/payin.png" />

### 请求URL

* `https://gateway.pay247.io/gateway/payin/create`

### 请求方式

* POST

### 请求参数

| 参数名                 | 必选 | 类型     | 说明                                                         |
| :------------------ | :- | :----- | ---------------------------------------------------------- |
| mch\_id             | 是  | string | 商户号                                                        |
| mch\_order\_no      | 是  | string | 商户自生成订单号                                                   |
| mch\_user\_id       | 是  | string | 商户用户的唯一标识（如果想隐藏用户id明文，可以使用md5加密传递）                         |
| currency            | 是  | string | 支持【CNY,JPY,PHP,THB等 ，更多参考商户后台】                             |
| amount              | 是  | string | 99.11  单位元，支持到两位小数                                         |
| pay\_method         | 否  | string | [支付方式](/api-reference/en/common/#dict) ，如果为空，自动选择可用的支付方式   |
| pay\_theme          | 可选 | string | 1. link: 收银台模式（默认），2. custom: 自定义模式，会返回银行卡或者收款码信息，商户需自己封装  |
| client\_ip          | 是  | string | 下单用户的IP地址（一定要是用户的真实IP）                                     |
| notify\_url         | 是  | string | 异步通知地址                                                     |
| return\_url         | 否  | string | 同步跳转地址                                                     |
| payer\_id           | 可选 | string | 【依据相关渠道】付款人身份证号                                            |
| payer\_name         | 可选 | string | 【依据相关渠道】付款人姓名                                              |
| payer\_phone        | 可选 | string | 【依据相关渠道】付款人手机号                                             |
| payer\_email        | 可选 | string | 【依据相关渠道】付款人邮箱                                              |
| payer\_account\_no  | 可选 | string | 【依据相关渠道】 付款人银行卡号                                           |
| payer\_bank\_code   | 可选 | string | 【依据相关渠道】 付款人银行代码   [银行列表](/api-reference/cn/banks/bank_ph) |
| payer\_bank\_branch | 可选 | string | 【依据相关渠道】 付款人银行支行                                           |
| timestamp           | 是  | string | unix秒级时间戳                                                  |
| version             | 是  | string | 接口版本: v3.0                                                 |
| uuid                | 是  | string | 请求ID: 550e8400-e29b-41d4-a716-446655440000                 |
| sign                | 是  | string | 签名token                                                    |

### 可选参数说明

| 币种       | 支付方式 | 必填                                                 |
| :------- | :--- | -------------------------------------------------- |
| 🇹🇭 THB | BANK | payer\_name, payer\_account\_no, payer\_bank\_code |
| 🇯🇵 JPY | BANK | payer\_name, payer\_address                        |

### 请求参数示例

```
{
  "mch_id": "Q0P5T8DOGN10000",
  "mch_order_no": "TRADE-405189",
  "mch_user_id": "U405189",
  "currency": "CNY",
  "amount": "99.11",
  "pay_mehod": "GCASH",
  "pay_theme": "link",
  "notify_url": "https://x.com/notify",
  "return_url": "https://x.com/return",
  "timestamp": "1693233334134",
  "version": "v3.0",
  "client_ip": "8.8.8.8",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "sign": "81930c5a04d1c58fd1efe33b06e2ffa7"
}
```

| 响应参数名(data)    | 必选 | 类型     | 说明                 |
| :------------- | :- | :----- | ------------------ |
| mch\_id        | 是  | string | 商户号                |
| mch\_order\_no | 是  | string | 商户订单号              |
| order\_no      | 是  | string | 系统订单号              |
| currency       | 是  | string | CNY, THB, PHP      |
| amount         | 是  | string | 99.00  单位元，支持到两位小数 |
| pay\_method    | 是  | string | 银行名                |
| pay\_theme     | 是  | string | 账号                 |
| status         | 是  | string | 订单状态               |
| pay\_url       | 是  | string | 支付链接，获取后跳转         |

**返回示例(默认收银台模式)**

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USD",
		"amount": "59.12",
		"pay_method": "BANK",
		"pay_theme": "link",
		"status": "PENDING",
		"pay_url": "https://pay.xxx.com/link/DyDpCjDfkr"
	}
}
```

**返回示例(自定义收银台模式) 当前支持JPY**

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USD",
		"amount": "59.12",
		"pay_method": "BANK",
		"pay_theme": "custom",
		"status": "PENDING",
		"pay_params": {
			"payee_name": "日本測試卡",
			"payee_account_no": "123",
			"payee_bank_name": "三菱UFJ銀行",
			"payee_branch_name": "日本測試卡",
			"qr": ""
		}
	}
}
```

### 示例-USDT 收款

* Request

```
{
  "mch_id": "Q0P5T8DOGN10000",
  "mch_order_no": "TRADE-405189",
  "mch_user_id": "U405189",
  "currency": "USDT",
  "amount": "99.11",
  "pay_mehod": "TRC20",
  "notify_url": "https://x.com/notify",
  "return_url": "https://x.com/return",
  "timestamp": "1693233334134",
  "version": "v3.0",
  "client_ip": "8.8.8.8",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "sign": "81930c5a04d1c58fd1efe33b06e2ffa7"
}
```

* Response

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USDT",
		"amount": "59.12",
		"pay_method": "ERC20",
		"status": "PENDING",
		"pay_url": "https://pay.xxx.com/link/DyDpCjDfkr"
	}
}
```
