订单相关接口¶
POST 创建交易订单¶
POST /prod-api/order/trade/order/createOrder
Body 请求参数
{
"extras": [
{
"itemCode": "extra_domain_package",
"itemValue": 0
},
{
"itemCode": "extra_bandwidth_package",
"itemValue": 0
}
],
"packageId": 31003,
"voucherNo": "",
"term": {
"value": 1,
"unit": "month"
},
"orderRelationType": "new_buy",
"relationConfig": "{}"
}
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | none | |
| body | body | object | 是 | none | |
| » extras | body | [object] | 是 | none | |
| »» itemCode | body | string | 是 | itemCode | extra_domain_package:表示顶级域名数量 |
| »» itemValue | body | integer(int32) | 是 | 值 | none |
| » orderRelationConfig | body | string | 否 | 订单配置 | 当订单类型是升购的时候使用,需要把加上订单号 oid |
| » orderRelationType | body | string | 是 | none | |
| » packageId | body | integer(int64) | 是 | 套餐 ID | none |
| » term | body | OrderTermVO | 是 | 购买时长 | none |
| »» discountRate | body | number | 是 | 折扣率 | none |
| »» unit | body | string | 是 | 单位 | none |
| »» value | body | integer(int32) | 是 | 值 | none |
| » voucherNo | body | string | 否 | none |
详细说明¶
»» itemCode: extra_domain_package:表示顶级域名数量 extra_bandwidth_package:表示业务带宽 extra_port_package:表示防御端口数
返回示例
200 Response
{
"msg": "订单创建成功",
"code": 200,
"data": {
"createTime": "2025-09-19 14:25:55",
"updateTime": null,
"createBy": null,
"updateBy": null,
"id": 391,
"orderNo": "20251231425551",
"ownerUid": 279,
"term": {
"unit": "month",
"value": 1,
"discountRate": 0
},
"userIp": "1.1.2.55",
"status": 0,
"finishTime": null,
"remark": null,
"payOrderId": 335,
"payStatus": false,
"payTime": null,
"payChannelCode": null,
"originPrice": 600000,
"discountPrice": 0,
"adjustPrice": 0,
"payPrice": 600000,
"agentCode": "2021145662055165881",
"voucherNo": null,
"voucherPrice": 0,
"settlementUnit": "CNY",
"deleted": null
},
"error_code": "order_created_successfully"
}
201 Response
返回结果¶
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
| 201 | Created | none | Inline |
| 401 | Unauthorized | none | Inline |
| 403 | Forbidden | none | Inline |
| 404 | Not Found | none | Inline |
返回数据结构¶
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » msg | string | true | none | none | |
| » code | integer | true | none | none | |
| » data | object | true | none | none | |
| »» createTime | string | true | none | none | |
| »» updateTime | null | true | none | none | |
| »» createBy | null | true | none | none | |
| »» updateBy | null | true | none | none | |
| »» id | integer | true | none | none | |
| »» orderNo | string | true | none | none | |
| »» ownerUid | integer | true | none | none | |
| »» term | object | true | none | none | |
| »»» unit | string | true | none | none | |
| »»» value | integer | true | none | none | |
| »»» discountRate | integer | true | none | none | |
| »» userIp | string | true | none | none | |
| »» status | integer | true | none | none | |
| »» finishTime | null | true | none | none | |
| »» remark | null | true | none | none | |
| »» payOrderId | integer | true | none | none | |
| »» payStatus | boolean | true | none | none | |
| »» payTime | null | true | none | none | |
| »» payChannelCode | null | true | none | none | |
| »» originPrice | integer | true | none | none | |
| »» discountPrice | integer | true | none | none | |
| »» adjustPrice | integer | true | none | none | |
| »» payPrice | integer | true | none | none | |
| »» agentCode | string | true | none | none | |
| »» voucherNo | null | true | none | none | |
| »» voucherPrice | integer | true | none | none | |
| »» settlementUnit | string | true | none | none | |
| »» deleted | null | true | none | none | |
| » error_code | string | true | none | none |
数据模型¶
OrderItemExtraVO
{
"itemCode": "string",
"itemName": "string",
"itemUnit": "string",
"itemValue": 0,
"price": 0,
"sort": 0
}
OrderItemExtraVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| itemCode | string | true | none | itemCode | extra_domain_package:表示顶级域名数量 extra_bandwidth_package:表示业务带宽 extra_port_package:表示防御端口数 |
| itemName | string | false | none | none | |
| itemUnit | string | false | none | none | |
| itemValue | integer(int32) | true | none | 值 | none |
| price | integer(int64) | false | none | none | |
| sort | integer(int32) | false | none | none |
OrderTermVO
OrderTermVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| discountRate | number | true | none | 折扣率 | none |
| unit | string | true | none | 单位 | none |
| value | integer(int32) | true | none | 值 | none |
TradeOrderCreateReqVO
{
"extras": [
{
"itemCode": "string",
"itemValue": 0
}
],
"orderRelationConfig": "string",
"orderRelationType": "string",
"packageId": 0,
"term": {
"discountRate": 0,
"unit": "string",
"value": 0
},
"voucherNo": "string"
}
TradeOrderCreateReqVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| extras | [object] | false | none | none | |
| » itemCode | string | true | none | itemCode | extra_domain_package:表示顶级域名数量 extra_bandwidth_package:表示业务带宽 extra_port_package:表示防御端口数 |
| » itemValue | integer(int32) | true | none | 值 | none |
| orderRelationConfig | string | false | none | none | |
| orderRelationType | string | true | none | 订单类型 | new_buy:表示新购 renewal:表示续费 upgrade:表示升配 |
| packageId | integer(int64) | true | none | 套餐 ID | none |
| term | OrderTermVO | false | none | 购买时长 | none |
| voucherNo | string | false | none | none |