Skip to main content

Create a receipt

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for creating a receipt (incoming stock from a vendor/partner) within the Inventory module of the Juleb ERP. A single call can create one or many receipts at once.

autoCreateBatch is always on for receipts

Receipts always auto-create a missing batch/lot (the same behavior as autoCreateBatch: true on other picking endpoints) since stock is coming in rather than going out. expiry is still required on any line whose batch doesn't exist yet.

Endpoint Details​

  • Method: POST
  • URL: /api/v1/inventory/picking/receipt

Parameters​

  • Path Parameters: None
  • Query Parameters: None

Request Body​

The request body must wrap the receipt (or receipts) to create under a PartnerPicking key - either a single object, or an array to create several receipts in one call. Same shape and fields as Create a delivery (companyId, partnerId / partner_code, reason, note, origin, autoValidate, rsd_deserialization, global_import, international_export, lines[]):

{
"PartnerPicking": {
"companyId": integer,
"partnerId": integer,
"partner_code": string,
"reason": string,
"note": string,
"origin": string,
"autoValidate": boolean,
"rsd_deserialization": boolean,
"global_import": boolean,
"international_export": boolean,
"lines": [
{
"productId": integer,
"default_code": string,
"productQty": integer,
"batch": string,
"expiry": string
}
]
}
}

Response​

  • 201 OK: Successfully created the record.
  • 400 Bad Request: Bad request.
  • 401 Unauthorized: Unauthorized.

Response Body​

{
"data": {
...record fields
}
}

Example​

Request​

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

axios.post(`https://${accountName}.juleb.com/api/v1/inventory/picking/receipt`, {
PartnerPicking: {
companyId: 1,
partnerId: 51,
lines: [
{
productId: 34969,
productQty: 100,
batch: "13200099",
expiry: "02-12-2026"
}
]
}
}, {
headers: {
'accept': '*/*',
'Authorization': `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": {
"id": 11010,
"name": "Demo/IN/00412",
"origin": null,
"note": null,
"state": "assigned",
"location_id": 5,
"location_dest_id": 11,
"picking_type_id": 1,
"partner_id": 51,
"company_id": 1,
"is_return": false
}
}