Skip to main content

Create an Account Tax

Endpoint Overview​

This API endpoint provides a detailed overview of the endpoint responsible for creating an account tax within the Accounting module of the Juleb ERP.

Endpoint Details​

  • Method: POST
  • URL: /api/v1/accounting/account_tax

Parameters​

  • Path Parameters: None
  • Query Parameters: None

Request Body​

{
"name": string,
"type_tax_use": "sale",
"amount_type": "percent",
"active": boolean,
"company_id": integer,
"sequence": integer,
"amount": number,
"description": string,
"price_include": boolean,
"include_base_amount": boolean,
"is_base_affected": boolean,
"analytic": boolean,
"hide_tax_exigibility": boolean,
"tax_exigibility": "on_invoice",
"cash_basis_transition_account_id": integer,
"invoice_repartition_line_ids": integer[],
"refund_repartition_line_ids": integer[],
"country_id": integer,
"country_code": string,
"tax_group_id": integer
}

Field Reference​

FieldTypeRequiredDescription
namestringYesTax name (e.g. "VAT 15%").
type_tax_usestringNoTax scope: sale, purchase, or none. Defaults to sale.
amount_typestringNoComputation method: group, fixed, percent, or division. Defaults to percent.
activebooleanNoWhether the tax is active. Defaults to true.
company_idintegerNoCompany this tax belongs to.
sequenceintegerNoDisplay/application order. Defaults to 1.
amountnumberNoTax rate/amount (e.g. 15 for 15%). Defaults to 0.0.
descriptionstringNoShort label shown on documents.
price_includebooleanNoWhether the tax is already included in the product's price. Defaults to false.
include_base_amountbooleanNoWhether this tax's amount is included in the base for subsequent taxes. Defaults to false.
is_base_affectedbooleanNoWhether this tax's base is affected by taxes applied before it. Defaults to false.
analyticbooleanNoWhether to post analytic accounting lines for this tax. Defaults to false.
hide_tax_exigibilitybooleanNoHides the tax-exigibility setting on the tax form. Defaults to false.
tax_exigibilitystringNoWhen the tax becomes due: on_invoice or on_payment. Defaults to on_invoice.
cash_basis_transition_account_idintegerNoTransition account used for cash-basis taxes.
invoice_repartition_line_idsinteger[]NoInvoice distribution/repartition line IDs.
refund_repartition_line_idsinteger[]NoCredit-note (refund) distribution/repartition line IDs.
country_idintegerNoCountry this tax applies to.
country_codestringNoISO country code this tax applies to.
tax_group_idintegerNoTax group ID this tax is reported under.

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/accounting/account_tax`, {
name: 'VAT 15%',
type_tax_use: 'sale',
amount_type: 'percent',
amount: 15,
company_id: 1
}, {
headers: {
accept: '*/*',
Authorization: `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": {
"id": 15,
"name": "VAT 15%",
"type_tax_use": "sale",
"amount_type": "percent",
"amount": 15,
"company_id": 1
}
}