Skip to main content

Get One Batch

Endpoint Overview

This API endpoint is designed to fetch detailed information about a specific single batch from the Juleb ERP system. By providing the ID of the desired batch.

Endpoint Details

  • Method: GET
  • URL: /api/v1/inventory/batch/{id}

Parameters

  • Path Parameters:
    • id (string, required): The ID of the record to retrieve.
  • Query Parameters:
    • fields (string, not required): Fields to include in the response separated by comma. If not provided, all fields are returned.

Response

  • 200 OK: Successfully retrieved the record.
  • 400 Bad Request: Invalid record fields provided.
  • 401 Unauthorized: Authentication required.
  • 404 Not Found: Record with the provided ID not found.

Response Body

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

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/100`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,lot_number,lot_code,product_id,life_date,j_batch_qty'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response

{
"data": {
"name": "106591541083",
"lot_number": "BP_1737007",
"lot_code": "007",
"product_id": 7224,
"life_date": "2024-03-02T00:00:00.000Z",
"j_batch_qty": 0
}
}