Skip to main content

Get Many Orders

Endpoint Overview​

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

Endpoint Details​

  • Method: GET
  • URL: /api/v1/pos/order

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/pos/order`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,date_order,amount_total,cashier,session_id',
filter: 'amount_total>1000',
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": [
{
"name": "Branch 3 - test/0003",
"date_order": "2023-05-02T10:07:32.000Z",
"amount_total": 1814,
"cashier": "Juleb Support",
"session_id": 624
},
{
"name": "Branch 3 - test/0002",
"date_order": "2023-05-02T09:50:36.000Z",
"amount_total": 4764.650000000001,
"cashier": "Juleb Support",
"session_id": 623
},
{
"name": "Branch1/0018",
"date_order": "2022-03-13T13:24:58.000Z",
"amount_total": 2620,
"cashier": "Juleb Bot",
"session_id": 13
},
{
"name": "Shop/0503",
"date_order": "2022-03-22T15:09:10.000Z",
"amount_total": 4516.05,
"cashier": "Juleb Bot",
"session_id": 39
},
{
"name": "Shop/0645",
"date_order": "2022-03-22T17:57:10.000Z",
"amount_total": 8620,
"cashier": "Juleb Bot",
"session_id": 39
},
{
"name": "Shop/0752",
"date_order": "2022-03-27T10:51:12.000Z",
"amount_total": 18050,
"cashier": "Juleb Bot",
"session_id": 43
},
{
"name": "Branch1/1266",
"date_order": "2022-03-27T16:55:13.000Z",
"amount_total": 8099.7,
"cashier": "Juleb Bot",
"session_id": 42
},
{
"name": "Demo-Zamam/0004",
"date_order": "2022-06-14T08:43:03.000Z",
"amount_total": 1915.17,
"cashier": "Demo-Zamam",
"session_id": 69
},
{
"name": "almuzaini - pharmacy/0002",
"date_order": "2022-07-28T05:36:30.000Z",
"amount_total": 1049.45,
"cashier": "Gowthami",
"session_id": 105
},
{
"name": "almuzaini - pharmacy/0003",
"date_order": "2022-07-28T06:24:06.000Z",
"amount_total": 3032.03,
"cashier": "Gowthami",
"session_id": 105
}
],
"meta": {
"count": 10,
"total": 3753
},
"pagination": {
"previousPage": null,
"currentPage": 1,
"nextPage": 2,
"totalPages": 376
}
}