订单
# 提交订单信息
### 注意
同一个渠道下,同一个订单号重复提交,开票助手会做新增操作。
### 请求URL
- `/openapi/order/add`
### 请求方式
- POST
### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------- | ---- | ------------------------- |
| storeId|Long|否|开票助手门店id|
| storeNo|String|否|第三方门店id(与storeId选填其一)|
| orderList|List<订单详情>|是|订单列表|
| orderList[#].erpOrderNo|String|是|ERP订单号|
| orderList[#].partnerOrderNo|String|否|渠道订单号|
| orderList[#].orderPrice|Double|是|订单金额|
| orderList[#].items|List<商品详情>|是|订单商品列表|
| orderList[#].items[#].identifier |String|是|商品唯一识别编码。需提前在商户后台上维护,且保证在商户下唯一,后续无法变更。如,酒店行业约定以“ZSF0000001”作为住宿费这一商品的唯一识别码。(待开申请必填)|
| orderList[#].items[#].quantity|Double|否|数量|
| orderList[#].items[#].unitPrice|Double|否|单价(含税)|
| orderList[#].items[#].totalPrice|Double|是|总价(含税)。注:若单价、数量、均不为空,则要求:总价=单价*数量(待开申请必填)|
注意:
订单金额 = 商品总价之和
最终开票金额 = 订单金额 - 总折扣金额
### 请求示例
```json
{
"storeId":100021,
"orderList":[
{
"erpOrderNo":"erp1231231",
"orderPrice":24.8,
"items":[
{
"identifier":"ZSF0000001",
"quantity":2,
"unitPrice":12.4,
"totalPrice":24.8
}
]
},
{
"erpOrderNo":"erp1231232",
"orderPrice":30,
"items":[
{
"identifier":"ZSF0000002",
"quantity":2,
"unitPrice":15,
"totalPrice":30
}
]
}
]
}
```
### 返回参数说明
|参数名|类型|说明|
|:----- |:-----|----- |
|code|int|状态码|
|message |string |错误信息,code!=0时有值|
|data|String|订单批次号|
### 返回示例
- 成功示例
```json
{
"code":0,
"data":"10202kdjskd3434k34"
}
```
- 失败示例
```json
{
"code":4002,
"message":"门店不存在"
}
```
# 获取订单信息
### 请求URL
- `/openapi/order/get`
### 请求方式
- POST
### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------- | ---- | ------------------------- |
| storeId|Long|否|开票助手门店id|
| storeNo|String|否|第三方门店id(与storeId选填其一)|
| orderBatchNo | String| 是 | 订单批次号|
注意:选填其一即可
### 请求示例
```json
{
"storeId":1000021,
"orderBatchNo": "10202kdjskd3434k34"
}
```
### 返回参数说明
|参数名|类型|说明|
|:----- |:-----|----- |
|code|int|状态码|
|message |string |错误信息,code != 0时有值|
|data|`List<OrderDto>`|返回订单信息|
OrderDto:
| 字段名 | 类型 | 说明 |
| ------------ | ------------ | ------------ |
| orderDtos|`List<OrderDto>`|订单信息|
| orderDtos[#].partnerOrderNo|String|渠道订单号|
| orderDtos[#].erpOrderNo|String|erp订单号|
| orderDtos[#].orderprice|String|订单金额|
| orderDtos[#].orderTime|Date|下单时间|
| orderDtos[#].beginDate|String|入住日期|
| orderDtos[#].endDate|String|离店日期|
| orderDtos[#].guestNames|List<String>|入住人|
| orderDtos[#].orderDetailDtos|`List<OrderDetailDto>`|订单商品详情|
| orderDtos[#].orderDetailDtos[#].quantity|Double|数量|
| orderDtos[#].orderDetailDtos[#].unitPrice|Double|单价(含税)|
| orderDtos[#].orderDetailDtos[#].totalPrice|Double|总价(含税)|
| orderDtos[#].orderDetailDtos[#].discountPrice|Double|折扣金额|
| orderDtos[#].orderDetailDtos[#].finalPrice|Double|总价减去折扣的最终金额|
| orderDtos[#].orderDetailDtos[#].taxTypeNo |String|税收分类编码|
| orderDtos[#].orderDetailDtos[#].taxRate |String|税率 单位(百分比%)|
| orderDtos[#].orderDetailDtos[#].name |String|商品名称|
| orderDtos[#].orderDetailDtos[#].identifier |String|商品唯一识别编码|
| orderDtos[#].orderDetailDtos[#].itemSpec |String|商品规则,规格型号|
| orderDtos[#].orderDetailDtos[#].unit |String|单位|
| orderDtos[#].orderDetailDtos[#].abbreviation |String|简称|
### 返回示例
- 成功示例
```json
{
"code": 0,
"data": [
{
"partnerOrderNo": "order120292",
"orderPrice": 24.8,
"orderDetailDtos": [
{
"quantity": 2,
"unitPrice": 12.4,
"totalPrice": 24.8,
"discountPrice": 0,
"finalPrice": 24.8,
"taxTypeNo": "3070402000000000000",
"taxRate": "3",
"name": "住宿费",
"identifier": "ZSF0000001",
"abbreviation": "住宿服务"
}
]
},
{
"partnerOrderNo": "order1202923",
"orderPrice": 24.8,
"orderDetailDtos": [
{
"quantity": 2,
"unitPrice": 12.4,
"totalPrice": 24.8,
"discountPrice": 0,
"finalPrice": 24.8,
"taxTypeNo": "3070402000000000000",
"taxRate": "3",
"name": "住宿费",
"identifier": "ZSF0000001",
"abbreviation": "住宿服务"
}
]
},
{
"partnerOrderNo": "order12029231",
"orderPrice": 24.8,
"orderDetailDtos": [
{
"quantity": 2,
"unitPrice": 12.4,
"totalPrice": 24.8,
"discountPrice": 0,
"finalPrice": 24.8,
"taxTypeNo": "3070402000000000000",
"taxRate": "3",
"name": "住宿费",
"identifier": "ZSF0000001",
"abbreviation": "住宿服务"
}
]
}
]
}
```
- 失败示例
```json
{
"code":-1,
"message":"storeId和storeNo不能都为空"
}
```