32. 批量发票回传
1. 接口
/mtop/aftersale/openapi/invoice/batch
2. 接口参数
公共参数
请求参数
data:
字段 | 类型 | 是否必填 | 备注 |
---|---|---|---|
receiptList | List<Receipt> |
是 | 待开票列表信息 |
Receipt信息:
字段 | 类型 | 备注 |
---|---|---|
orderId | Long | 订单标号 |
pid | Long | 商品型号 |
type | Integer | 发票类型,固定为5电子发票 |
urlList | List |
电子发票地址,目前存储长度仅为2048个字符,可能超过最大10张发票限制 |
3. 请求示例
{
"receiptList": [
{
"orderId": 4191220530701616,
"pid": 5790,
"type": 5,
"urlList": [
"http://localhost/index.php/sale/Order/mi_test?a=b\\u0026c=d"
]
},
{
"orderId": 4191220530701616,
"pid": 16639,
"type": 5,
"urlList": [
"http://localhost/index.php/sale/Order/mi_test?a=b\\u0026c=d"
]
}
]
}
4. 返回结果
Result
字段 | 类型 | 备注 |
---|---|---|
invoiceList | List<Invoice> |
开票结果, 订单对应的开票 |
Invoice信息:
字段 | 类型 | 备注 |
---|---|---|
orderId | Long | 订单标识 |
pid | Long | 商品型号 |
result | Boolean | 是否开票成功 |
content | String | 开票结果描述, 错误将展示错误信息 |
5. 返回示例
批量开票不返回失败信息, 仅对操作结果进行描述, 返回成功:
{
"code": 0,
"data": {
"invoiceList": [
{
"result": true,
"orderId": 4191220530701616,
"pid": 5790,
"content": "ok"
},
{
"result": true,
"orderId": 4191220530701616,
"pid": 16639,
"content": "ok"
}
]
},
"message": "ok"
}