Update an Account Tax
Endpoint Overview
This API endpoint provides a detailed overview of the endpoint responsible for updating an
existing account tax within the Accounting module of the Juleb ERP. Unlike some other
update endpoints in this API, this one uses a dedicated partial-update DTO — every field,
including name, is optional, so you only need to send the fields you want to change.
Endpoint Details
- Method: PATCH
- URL:
/api/v1/accounting/account_tax/{id}
Parameters
- Path Parameters:
id(string, required): The ID of the account tax to update.
- Query Parameters: None
Request Body
Accepts any subset of the same fields documented on
Create an Account Tax: name, type_tax_use, amount_type,
active, company_id, sequence, amount, description, price_include,
include_base_amount, is_base_affected, analytic, hide_tax_exigibility,
tax_exigibility, cash_basis_transition_account_id, invoice_repartition_line_ids,
refund_repartition_line_ids, country_id, country_code, tax_group_id.
{
"amount": number,
"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
- NodeJS
- curl
- python
- java
const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;
axios.patch(`https://${accountName}.juleb.com/api/v1/accounting/account_tax/15`, {
amount: 16
}, {
headers: {
accept: '*/*',
Authorization: `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
curl -X PATCH \
-H "accept: */*" \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{
"amount": 16
}' \
"https://$ACCOUNT_NAME.juleb.com/api/v1/accounting/account_tax/15"
import os
import requests
account_name = os.getenv('ACCOUNT_NAME')
api_key = os.getenv('API_KEY')
url = f'https://{account_name}.juleb.com/api/v1/accounting/account_tax/15'
headers = {
'accept': '*/*',
'Authorization': f'******',
'Content-Type': 'application/json'
}
data = {
'amount': 16
}
response = requests.patch(url, headers=headers, json=data)
if response.status_code == 202:
print(response.json())
else:
print(f'Error: {response.status_code}', response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) throws Exception {
String accountName = System.getenv("ACCOUNT_NAME");
String apiKey = System.getenv("API_KEY");
String json = "{ \"amount\": 16 }";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://" + accountName + ".juleb.com/api/v1/accounting/account_tax/15"))
.header("accept", "*/*")
.header("Authorization", "Bearer " + apiKey)
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
if (response.statusCode() == 202) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode() + ", " + response.body());
}
}
}
Response
{
"data": {
"id": 15,
"name": "VAT 15%",
"amount": 16
}
}