Request
POST https://backend.net0.com/v1/batches
This endpoint allows you to create a new batch taking into account the product/SKU.
curl --location --request POST 'https://backend.net0.com/v1/batches' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"productsBathes": [
{
"productId": 2,
"count": 2
}
],
"referenceNumber": "3747cbhd9937-338snd-373839902",
"name": "Opman Batch",
"manufacturingDate": "2021-12-27T00:37:02.288Z",
"comment": "Test Batch"
}'
Field Parameters
Attribute | Type | Description | In | Required |
---|---|---|---|---|
productsBathes | Array, number | Product bathes is an array containing the productId and the count of the product. | body | true |
referenceNumber | String | The customizable reference number for the product batch. | body | false |
name | String | Name of the product batch. | body | true |
manufacturingDate | String | Manufacturing date of the batch. | body | true |
comment | String | A comment about the batch | body | false |
Response
The response is the created batch.
{
"id": 3,
"name": "Opman Batch",
"totalEmission": 0,
"totalWeight": 40,
"comment": "Test Batch",
"companyId": 2,
"manufacturingDate": "2021-12-27T00:37:02.288Z",
"createdAt": "2021-11-27T00:50:14.046Z",
"updatedAt": "2021-11-27T00:50:14.046Z",
"referenceNumber": "3747cbhd9937-338snd-373839902",
"productsBathes": [
{
"productId": 2,
"batchId": 3,
"count": 2,
"createdAt": "2021-11-27T00:50:14.087Z",
"updatedAt": "2021-11-27T00:50:14.087Z",
"product": {
"id": 2,
"name": "Photoelectric Mug",
"companyId": 2,
"totalEmission": 0,
"weight": 20,
"referenceNumber": "wrwje-wenwfefw-cscsns",
"logoImageUrl": "https://aws.amazonserveivce.net",
"emissionKindId": "b3a6bba1-fb25-4797-9e4a-17154a946868",
"createdAt": "2021-11-24T12:39:37.775Z",
"updatedAt": "2021-11-26T23:54:57.155Z"
}
}
],
"movements": [],
"offsets": []
}