Skip to main content

Get Many Payments

Endpoint Overview​

This API endpoint is designed to retrieve information about the payments recorded against a single POS order. An order can have more than one payment line (e.g. part cash, part card), so this endpoint allows you to fetch all of them in a single request.

Endpoint Details​

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

Parameters​

  • Path Parameters:
    • orderId (string, required): The ID of the order to retrieve its payments.
  • 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/payment`, {
headers: {
'accept': '*/*',
'Authorization': `******`
},
params: {
fields: 'name,payment_method_id,amount,payment_date',
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": [
{
"name": "2022-03-16 14:40:12",
"payment_method_id": 5,
"amount": 103425,
"payment_date": "2022-03-16T14:40:12.000Z"
}
],
"meta": {
"count": 1,
"total": 1
},
"pagination": {
"previousPage": null,
"currentPage": 1,
"nextPage": null,
"totalPages": 1
}
}