Getting All Tax Rules
Endpoints: GET /admin/tax_rules
Purpose
The GET /admin/tax_rules
API retrieves a list of all tax rules configured in the system. It provides essential information about each tax rule, including their names, associated zones, rounding type, and creation details. This endpoint supports pagination for managing large sets of tax rules.
Path Parameters
No path parameters for this endpoint.
Query Parameters
Parameter | Type | Description |
---|---|---|
limit | Integer | Number of products per request. |
offset | Integer | Starting point for pagination. |
order_by | String | Field to sort results by. |
direction | String | Sort order by ascending or descending. |
Use Case
This endpoint is useful for administrators who want to view and manage the tax rules applied to different geographic zones. For instance, if a business operates across multiple regions with varying tax regulations, this API provides an overview of all active tax rules, ensuring accurate tax compliance.
Request Body
No data is required for the request body.
Response
A successful response returns a paginated list of tax rules with key details.
{
"tax_rules": [
{
"id": TAX_RULE_ID,
"name": "TAX_RULE_NAME",
"code": {},
"description": 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"
}
],
"pagination": {
"records": TOTAL_RECORDS,
"limit": PAGE_LIMIT,
"offset": PAGE_OFFSET,
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
Getting Specific Tax Rules
Endpoints: GET /admin/tax_rules/{id}
Purpose
The GET /admin/tax_rules/{id}
API retrieves detailed information about a specific tax rule by its unique identifier. It provides comprehensive details such as the tax rule's name, code, applicable zones, rounding configuration, and timestamps.
Path Parameters
Parameter | Type | Description |
---|---|---|
id | integer | The unique identifier of the categories |
Query Parameters
This endpoint does not have any query parameters.
Use Case
Administrators use this endpoint to inspect and validate the configuration of a particular tax rule. For example, if a business needs to confirm the rounding type for a region or verify if a tax rule is applied correctly to a zone, this API provides precise information about the selected tax rule.
Request Body
No data is required for the request body.
Response
A successful response returns the complete details of the requested tax rule, including all associated zones and configuration parameters.
{
"tax_rule": {
"id": TAX_RULE_ID,
"name": "TAX_RULE_NAME",
"code": {
"id": CODE_ID,
"name": "CODE_NAME",
"is_default": IS_DEFAULT_CODE
},
"description": 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"
}
}