Skip to main content

Create a Product Brand

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for creating a product brand within the Inventory module of the Juleb ERP.

Endpoint Details​

  • Method: POST
  • URL: /api/v1/inventory/product-brand

Parameters​

  • Path Parameters: None
  • Query Parameters: None

Request Body​

{
"name": string,
"description": string,
"partner_id": integer,
"sales_target": number,
"sales_target_no": number
}

Field Reference​

FieldTypeRequiredDescription
namestringYesBrand name.
descriptionstringNoBrand description.
partner_idintegerNoRelated partner/supplier ID.
sales_targetnumberNoSales target amount for this brand.
sales_target_nonumberNoSales target number/count for this brand.

Response​

  • 201 OK: Successfully created the record.
  • 400 Bad Request: Bad request.
  • 401 Unauthorized: Unauthorized.

Response Body​

{
"data": {
...record fields
}
}

Example​

Request​

const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;

axios.post(`https://${accountName}.juleb.com/api/v1/inventory/product-brand`, {
name: 'Juleb Generics',
partner_id: 20,
sales_target: 50000
}, {
headers: {
accept: '*/*',
Authorization: `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": {
"id": 5,
"name": "Juleb Generics",
"partner_id": 20,
"sales_target": 50000
}
}