版本:202201
批量创建采购项
POST/openapi/2022-01/procurements/:id/items
批量添加采购项到指定采购单中。
请求
Path参数
id string必填
Procurement's ID
- application/json
- 请求体
- 示例
请求体
- Array [
- ]
items object[]必填
product_idstring必填
Product's ID
variant_idstring必填
Variant's ID
transfer_quantityint32必填
{
"items": [
{
"product_id": "string",
"variant_id": "string",
"transfer_quantity": 0
}
]
}
响应
- 200
- 404
- 422
- 500
200
- application/json
- 数据结构
- 示例
- Result
数据结构
- Array [
- ]
fail_items object[]
product_idstring
示例:
9cf836e2-2147-4326-b153-2ab6a778f2a0variant_idstring
示例:
d2c81bb4-d846-4811-a2d4-c19362fd907dtransfer_quantityinteger
默认值:
0示例:
100{
"fail_items": [
{
"product_id": "9cf836e2-2147-4326-b153-2ab6a778f2a0",
"variant_id": "d2c81bb4-d846-4811-a2d4-c19362fd907d",
"transfer_quantity": 100
}
]
}
{
"fail_items": [
{
"product_id": "9cf836e2-2147-4326-b153-2ab6a778f2a0",
"variant_id": "d2c81bb4-d846-4811-a2d4-c19362fd907d",
"transfer_quantity": 100
}
]
}
404
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"inventory not found"
]
}
{
"errors": [
"inventory not found"
]
}
422
- application/json
- 数据结构
- 示例
- Result
数据结构
- oneOf
- object
- object
errorsstring[]
{
"errors": [
"The procurement cannot be operated"
]
}
{
"errors": [
"Duplicated variant"
]
}
500
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"sql: converting argument $2 type: invalid UUID length: 35"
]
}
{
"errors": [
"sql: converting argument $2 type: invalid UUID length: 35"
]
}