Skip to main content

Create New Config

Endpoint Overview

This API endpoint provides a detailed overview of the endpoint responsible for creating a config within the POS module of the Juleb ERP.

Endpoint Details

  • Method: POST
  • URL: /api/v1/pos/config

Parameters

  • Path Parameters: None

  • Query Parameters: None

  • Request Body:

{
"name": string,
"allow_out_of_stock":boolean,
"company_id": integer
}

Response

  • 201 OK: Successfully created the record.
  • 400 Bad Request: Invalid parameters.
  • 401 Unauthorized: Authentication required.

Response Body

Id of the created record.

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/pos/config`,
{
companyId: 37,
name: 'api_test',
allow_out_of_stock: false,
},
{
headers: {
accept: '*/*',
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
}
)
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error('Error:', error);
});

Response

375