Skip to main content

Update a POS Category

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for updating an existing POS category within the POS module of the Juleb ERP.

name is still required

This endpoint reuses the same request body as Create a POS Category, so name must still be included even when only updating other fields.

Endpoint Details​

  • Method: PATCH
  • URL: /api/v1/pos/pos-category/{id}

Parameters​

  • Path Parameters:
    • id (string, required): The ID of the POS category to update.
  • Query Parameters: None

Request Body​

Same fields as Create a POS Category: name (required), parent_id, sequence.

{
"name": string,
"sequence": integer
}

Response​

  • 202 Accepted: Successfully updated the record.
  • 400 Bad Request: Bad request.
  • 401 Unauthorized: Unauthorized.
  • 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.patch(`https://${accountName}.juleb.com/api/v1/pos/pos-category/8`, {
name: 'Pain Relief',
sequence: 20
}, {
headers: {
accept: '*/*',
Authorization: `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": {
"id": 8,
"name": "Pain Relief",
"sequence": 20
}
}