Version: 202201
Batch Create Procurement Items
POST/openapi/2022-01/procurements/:id/items
Allows the bulk addition of procurement items to a procurement record.
Request
Path Parameters
id stringrequired
Procurement's ID
- application/json
- Body
- Example
Body
- Array [
- ]
items object[]required
product_idstringrequired
Product's ID
variant_idstringrequired
Variant's ID
transfer_quantityint32required
{
"items": [
{
"product_id": "string",
"variant_id": "string",
"transfer_quantity": 0
}
]
}
Responses
- 200
- 404
- 422
- 500
200
- application/json
- Schema
- Example
- Result
Schema
- Array [
- ]
fail_items object[]
product_idstring
Example:
9cf836e2-2147-4326-b153-2ab6a778f2a0variant_idstring
Example:
d2c81bb4-d846-4811-a2d4-c19362fd907dtransfer_quantityinteger
Default value:
0Example:
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
- Schema
- Example
- Result
Schema
errorsstring[]
{
"errors": [
"inventory not found"
]
}
{
"errors": [
"inventory not found"
]
}
422
- application/json
- Schema
- Example
- Result
Schema
- oneOf
- object
- object
errorsstring[]
{
"errors": [
"The procurement cannot be operated"
]
}
{
"errors": [
"Duplicated variant"
]
}
500
- application/json
- Schema
- Example
- Result
Schema
errorsstring[]
{
"errors": [
"sql: converting argument $2 type: invalid UUID length: 35"
]
}
{
"errors": [
"sql: converting argument $2 type: invalid UUID length: 35"
]
}