Creating Specific Tax Rules
Endpoints: POST /admin/tax_rules
Purpose
The POST /admin/tax_rules
API allows the creation of new tax rules within the system. It accepts essential details such as the tax rule's name, description, and associated tax profile. If the id
is not provided, the system auto-generates one. This endpoint facilitates the dynamic addition of tax rules to support evolving tax regulations.
Path Parameters
No path parameters for this endpoint.
Query Parameters
This endpoint does not have any query parameters.
Use Case
This endpoint is useful for businesses that need to define and enforce new tax policies across multiple zones. For example, if a company wants to introduce a new VAT rate or customize tax collection for specific regions, they can use this API to create the required tax rule.
Request Body
Key | Type | Description |
---|---|---|
id | String | Unique identifier for the tax rule. |
name | String | Name of the tax rule. |
description | String | Detailed description of the tax rule. |
tax_profile_id | String | Identifier linking to the associated tax profile. |
{
"tax_rule": {
"id": "TAX_RULE_ID",
"name": "TAX_RULE_NAME",
"description": "TAX_RULE_DESCRIPTION",
"tax_profile_id": TAX_PROFILE_ID
}
}
Response
A successful response returns the newly created tax rule along with its metadata.
{
"tax_rule": {
"id": TAX_RULE_ID,
"name": "UPDATED_TAX_RULE_NAME",
"code": {
"id": CODE_ID,
"name": "UPDATED_CODE_NAME",
"is_default": IS_DEFAULT_CODE
},
"description": "UPDATED_TAX_RULE_DESCRIPTION",
"default": IS_DEFAULT,
"rounding_type": "ROUNDING_TYPE",
"decimal_point": DECIMAL_POINT,
"zones": [
{
"id": ZONE_ID,
"name": "ZONE_NAME",
"is_system_generated": IS_SYSTEM_GENERATED,
"is_default": IS_DEFAULT_ZONE
}
],
"created_at": "CREATED_AT_TIMESTAMP",
"updated_at": "UPDATED_AT_TIMESTAMP"
}
}