Skip to main content

Add Picking Lines

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for adding one or more product lines to an existing picking within the Inventory module of the Juleb ERP.

Endpoint Details​

  • Method: PATCH
  • URL: /api/v1/inventory/picking/{id}/lines

Parameters​

  • Path Parameters:
    • id (string, required): The ID of the picking to add lines to.
  • Query Parameters: None

Request Body​

The lines to add must be wrapped under a PickingLines array (at least one entry required), using the same line shape used when creating a picking:

{
"PickingLines": [
{
"productId": integer,
"default_code": string,
"productQty": integer,
"batch": string,
"expiry": string
}
]
}

See Create a delivery for the full line field reference.

Response​

  • 202 Accepted: The requested resource has been updated.
  • 400 Bad Request: Bad request (e.g. picking with id {id} is not found).
  • 401 Unauthorized: Unauthorized.

Response Body​

An array with one confirmation message (or error object) per line, in the same order they were submitted:

[
"product with id {productId} added successfully with id {moveId}"
]

Example​

Request​

const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;

axios.patch(`https://${accountName}.juleb.com/api/v1/inventory/picking/11004/lines`, {
PickingLines: [
{
productId: 34970,
productQty: 5
}
]
}, {
headers: {
'accept': '*/*',
'Authorization': `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

[
"product with id 34970 added successfully with id 55123"
]