Skip to main content

Get Many Batches

Endpoint Overview​

This endpoint is designed to retrieve information about multiple batches from the Juleb ERP system. It allows you to efficiently fetch data for a group of batches in a single request, rather than making individual requests for each batch.

Endpoint Details​

  • Method: GET
  • URL: /api/v1/inventory/batch

Parameters​

  • Path Parameters: None
  • Query Parameters:
    • fields (string, not required): Fields to include in the response separated by comma. If not provided, all fields are returned.
    • filter (string, not required): Apply conditions to filter the data returned.
    • limit (integer, not required): Limit the number of records returned. Default is 10, Max is 1000.
    • page (integer, not required): Page the records returned. Default is 1.

Response​

  • 200 OK: Successfully retrieved the record.
  • 400 Bad Request: Invalid parameters.
  • 401 Unauthorized: Authentication required.

Response Body​

{
"data": [
...records
],
"meta": {
"count": integer,
"total": integer
},
"pagination": {
"previousPage": integer | null,
"currentPage": integer,
"nextPage": integer | null,
"totalPages": integer
}
}

Example​

Request​

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

axios.get(`https://${accountName}.juleb.com/api/v1/inventory/batch`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,lot_number,lot_code,product_id,life_date,j_batch_qty',
filter: 'life_date>2025-01-01',
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": [
{
"name": "BP_2680008",
"lot_number": "BP_2680008",
"lot_code": "008",
"product_id": 18462,
"life_date": "2025-01-04T00:00:00.000Z",
"j_batch_qty": 1
},
{
"name": "ERWER",
"lot_number": "MED_893002",
"lot_code": "002",
"product_id": 9673,
"life_date": "2025-01-05T00:00:00.000Z",
"j_batch_qty": 30
},
{
"name": "YA0221",
"lot_number": "VS_1001",
"lot_code": "001",
"product_id": 7,
"life_date": "2025-01-12T00:00:00.000Z",
"j_batch_qty": 0
},
{
"name": "testingAPI",
"lot_number": "BP_13989005",
"lot_code": "005",
"product_id": 10,
"life_date": "2025-01-15T00:00:00.000Z",
"j_batch_qty": 0
},
{
"name": "5RZVWXW8R0",
"lot_number": null,
"lot_code": "",
"product_id": 20482,
"life_date": "2025-02-01T00:00:00.000Z",
"j_batch_qty": 1
},
{
"name": "SE5E",
"lot_number": "MED_1857001",
"lot_code": "001",
"product_id": 20482,
"life_date": "2025-02-01T00:00:00.000Z",
"j_batch_qty": -3
},
{
"name": "5RZVWX1W8R0",
"lot_number": null,
"lot_code": "",
"product_id": 20482,
"life_date": "2025-02-01T00:00:00.000Z",
"j_batch_qty": 0
},
{
"name": "5RYVWX1W8R0",
"lot_number": null,
"lot_code": "",
"product_id": 20482,
"life_date": "2025-02-01T00:00:00.000Z",
"j_batch_qty": -1
},
{
"name": "5RYVbX1W8R0",
"lot_number": null,
"lot_code": "",
"product_id": 20482,
"life_date": "2025-02-01T00:00:00.000Z",
"j_batch_qty": -1
},
{
"name": "0000006730027",
"lot_number": "0000006730027",
"lot_code": "027",
"product_id": 34973,
"life_date": "2025-02-05T00:00:00.000Z",
"j_batch_qty": 0
}
],
"meta": {
"count": 10,
"total": 231
},
"pagination": {
"previousPage": null,
"currentPage": 1,
"nextPage": 2,
"totalPages": 24
}
}