Updating Tax Code
Endpoint: PUT /admin/tax_codes/{id}
Purpose
This endpoint allows administrators to update an existing tax code, modifying its name, label, rate, or method of calculation. It ensures the system reflects accurate and up-to-date tax rules for transaction processing.
Path Parameters:
Field | Type | Description |
---|---|---|
id | integer | The unique identifier of the tax code to be updated |
Query Parameters
This endpoint does not require any query parameters.
Use Case
An admin updates the details of a tax code to change the tax rate, switch between flat rate and API-based method, or update the display name. This allows businesses to adapt tax settings as laws or internal policies evolve.
JSON
{
"tax_code": {
"name": "TAX_CODE_NAME",
"label": "TAX_LABEL",
"method": "FLAT_RATE", // or "API"
"rate": TAX_RATE, // required if method == FLAT_RATE
"api": "API_PROVIDER_NAME" // required if method == API
}
}
Response
The response returns the updated tax code, reflecting the latest configuration including name, label, resolver type, and rate. It ensures administrators can verify changes made to tax rules instantly.
JSON
{
"tax_code": {
"id": TAX_CODE_ID,
"name": "TAX_CODE_NAME",
"label": "TAX_LABEL",
"description": "TAX_DESCRIPTION",
"rate": TAX_RATE,
"resolver_type": "RESOLVER_TYPE", // flat or api
"priority": PRIORITY_LEVEL,
"is_default": IS_DEFAULT
}
}