Skip to main content

Get One Payment

Endpoint Overview​

This API endpoint is designed to fetch detailed information about a single payment line recorded against a specific POS order, by providing the ID of the order and the ID of the payment.

Endpoint Details​

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

Parameters​

  • Path Parameters:
    • orderId (string, required): The ID of the order record.
    • id (string, required): The ID of the payment 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: The requested resource has been returned.
  • 400 Bad Request: Bad request.
  • 401 Unauthorized: Unauthorized.
  • 404 Not Found: Record with the provided ID not found for the given order.

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/pos/order/7162/payment/5201`, {
headers: {
'accept': '*/*',
'Authorization': `******`
},
params: {
fields: 'name,payment_method_id,amount'
}
})
.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
}
}