> ## Documentation Index
> Fetch the complete documentation index at: https://developer-cn.cregis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建订单

> 创建收款订单

### 接入API

POST /api/v1/order

### 请求

#### 请求参数

| 名称              | 类型             | 是否必须 | 描述                                               |
| --------------- | -------------- | ---- | ------------------------------------------------ |
| pid             | integer(int64) | 是    | 项目编号                                             |
| nonce           | string         | 是    | 6位随机字符串                                          |
| timestamp       | integer(int64) | 是    | 时间戳                                              |
| sign            | string         | 是    | 签名                                               |
| order\_id       | string         | 是    | 调⽤⽅唯⼀订单编号【不超过128位字符】                             |
| order\_amount   | string         | 是    | 订单交易⾦额【精度可以参考法币信息列表接⼝decimals字段值】                |
| order\_currency | string         | 是    | 订单货币代码，即ISO 4217货币代码,例如 CNY、HKD，参考法币信息列表接⼝       |
| callback\_url   | string         | 否    | 回调地址,该订单信息被处理时会向对应的callback\_url发起回调通知【最多256位字符】 |
| remark          | string         | 否    | 调⽤⽅订单备注信息【不超过256位字符】                             |
| valid\_time     | integer        | 否    | 设置订单超时时间【单位/分钟】，区间【10-60】，如果未填写，系统默认设置为30分钟；     |
| payer\_id       | string         | 否    | 付款⼈id标识【不超过32位字符】                                |
| payer\_name     | string         | 否    | 付款⼈姓名【不超过32位字符】                                  |
| payer\_email    | string         | 否    | 付款⼈邮箱                                            |

###### 请求示例

```json theme={null}
{
    "order_id": "c9231e604da54469a735af3f449c880f",
    "order_amount": "100",
    "order_currency": "CNY",
    "callback_url": "http://xxx.com/order/callback",
    "remark": "payout",
    "payer_id": "p_001",
    "payer_name": "payer",
    "payer_email": "xxxx@cregis.com"
    "valid_time": 60,
    "pid": 1382528827416576,
    "nonce": "hwlkk6",
    "timestamp": 1688004243314,
    "sign": "d6eef2de79e39f434a38efb910213ba6"
}
```

### 返回

#### 返回数据

| 名称   | 类型     | 描述   |
| ---- | ------ | ---- |
| code | string | 返回码  |
| msg  | string | 返回信息 |
| data | Array  | 返回数据 |

#### 返回数据 `data` 数组对象

| 名称              | 类型             | 描述                                        |
| --------------- | -------------- | ----------------------------------------- |
| cregis\_id      | string         | Cregis唯⼀识标                                |
| order\_amount   | string         | 订单交易⾦额【精度可以参考法币信息列表接⼝decimals字段值】         |
| order\_currency | string         | 订单货币代码，即ISO 4217货币代码,例如CNY、HKD，参考法币信息列表接⼝ |
| created\_time   | integer(int64) | 订单创建时间【13位时间戳】                            |
| expire\_time    | integer(int64) | 订单到期时间【13位时间戳】                            |
| payment\_info   | array          | 订单相关讯息                                    |

#### `payment_info` 对象

| 名称                | 类型      | 描述          |
| ----------------- | ------- | ----------- |
| payment\_address  | string  | 充值地址        |
| token\_symbol     | string  | 货币标识        |
| blockchain        | string  | 货币⽹络        |
| token\_name       | string  | 货币名称        |
| logo\_url         | string  | 货币logo地址    |
| token\_decimals   | integer | 货币精度        |
| receive\_amount   | string  | 汇率转换后的订单⾦额  |
| receive\_currency | string  | 汇率转换后订单货币代码 |
| exchange\_rate    | string  | 货币汇率        |

###### 返回示例

```json theme={null}
{
    "code": "00000",
    "msg": "ok",
    "data": {
        "cregis_id": "po20240703132452000",
        "order_amount": "100",
        "order_currency": "CNY",
        "created_time":1720430000000,
        "expire_time":1720430174148,
        "payment_info": [
            {
                "payment_address": "TLKz6k1EvMs2sMwTEbqQ6SZfbhzLU7XsQR",
                "token_symbol": "USDT",
                "blockchain": "TRON#Shasta",
                "token_name": "BEP20#Testnet",
                "logo_url": "",
                "token_decimals": 18,
                "receive_amount": "21.20",
                "receive_currency": "USDT",
                "exchange_rate": "0.000001111"
            },
            {
                "payment_address":
                "0xd38c2cf366a731dcbe4a32c7ef24ff96d080ca7e",
                "token_symbol": "USDC",
                "blockchain": "BNB-BSC",
                "token_name": "USDT-BEP20",
                "logo_url": "",
                "token_decimals": 18,
                "receive_amount": "21.30",
                "receive_currency": "USDC",
                "exchange_rate": "0.0000022222"
            }
        ]
    }
}
```
