Skip to main content

Update a Product Template

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for updating an existing product template within the Inventory module of the Juleb ERP. All fields are optional — only send the fields you want to change.

Endpoint Details​

  • Method: PATCH
  • URL: /api/v1/inventory/product-template/{id}

Parameters​

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

Request Body​

Accepts any subset of the same fields documented on Create a Product Template: type, categ_id, name, list_price, taxes_id, supplier_taxes_id, j_active_ingredient, uom_id, uom_po_id, default_code, barcode, tracking, gtin, is_rsd_product, j_name_ar, active, product_brand_id, pos_categ_id, j_manufacture_country, j_category_2-j_category_7, j_brand, j_brand_ar, consumption_rule, responsible_id.

{
"list_price": integer,
"active": boolean
}

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/inventory/product-template/9123`, {
list_price: 12,
active: true
}, {
headers: {
accept: '*/*',
Authorization: `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": {
"id": 9123,
"name": "Paracetamol 500mg",
"list_price": 12,
"active": true
}
}