Skip to main content

Get Many Lines

Endpoint Overview

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

Endpoint Details

  • Method: GET
  • URL: /api/v1/pos/order/{orderId}/line

Parameters

  • Path Parameters:
    • id (string, required): The ID of the order to retrieve its lines.
  • 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: The requested resource has been returned.
  • 400 Bad Request: Bad request.
  • 401 Unauthorized: Unauthorized.

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/pos/order/7152/line`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,product_id,price_subtotal_incl,qty,is_return',
filter: 'is_return=true',
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response

{
"data": [
{
"name": "adnan/0254",
"product_id": 35767,
"price_subtotal_incl": -345,
"qty": -1,
"is_return": true
},
{
"name": "adnan/0255",
"product_id": 34967,
"price_subtotal_incl": 0,
"qty": -1,
"is_return": true
},
{
"name": "adnan/0256",
"product_id": 34964,
"price_subtotal_incl": 0,
"qty": -1,
"is_return": true
}
],
"meta": {
"count": 3,
"total": 3
},
"pagination": {
"previousPage": null,
"currentPage": 1,
"nextPage": null,
"totalPages": 1
}
}