[POST] .../v1/productionoperation/add
Creates production operations. Use this method to add one or more produced item rows to a production document before the document is posted. The request body is an object containing document_id and a data array; every data item must contain item_id and positive whole-number quantity, quantity cannot exceed 999999999 and data must contain 1 through 250 rows. Production must be enabled, the parent document must exist, be unposted, not deleted and locked by the current user and each item must be compatible with the document type, simple enough for production, not deleted and have a posted tech map for the document stock company. The response returns row_affected and ids for created rows and the current request user must have production operation add permission; missing body, invalid document or data fields, disabled production, denied access, item validation failures, missing tech maps, lock conflicts, posted documents and storage failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| data | Array of ProductionOperationAddData | Required | Operations to create. |
| document_id | Int64 | Required | Production document ID. |
Request Example
{
"document_id": 7401,
"data": [
{
"item_id": 2001,
"quantity": 10
}
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1,
"ids": [
8401
]
}
}