Taxes API Endpoints

Tax Management

The Taxes API provides endpoints for managing tax configurations in your system. These endpoints allow you to create, retrieve, update, and delete tax objects that can be applied to products, services, and transactions.

Base URL: https://www.venddor.com.br/api
GET POST /taxes

Access all tax objects or create a new tax configuration.

Supported Methods

Method Description
GET Retrieve all tax objects
POST Create a new tax object
GET Response Example
POST Request Example
{
  "data": [
    {
      "id": "tax_001",
      "name": "ICMS - São Paulo",
      "description": "State Tax for São Paulo",
      "rate": 18.0,
      "type": "percentage",
      "is_compound": false,
      "regions": ["SP"],
      "active": true,
      "created_at": "2024-12-10T08:15:30Z"
    },
    {
      "id": "tax_002",
      "name": "ISS - Serviços",
      "description": "Service Tax",
      "rate": 5.0,
      "type": "percentage",
      "is_compound": true,
      "product_categories": ["services"],
      "active": true,
      "created_at": "2024-12-15T10:30:45Z"
    }
  ],
  "meta": {
    "total": 6,
    "page": 1,
    "per_page": 10
  }
}
{
  "name": "PIS/COFINS",
  "description": "Federal contribution taxes",
  "rate": 9.25,
  "type": "percentage",
  "is_compound": true,
  "priority": 1,
  "active": true,
  "exemptions": [
    {
      "type": "customer_category",
      "values": ["non_profit", "government"]
    }
  ]
}
Tip: When creating compound taxes, use the priority field to control the order in which taxes are calculated. Lower values will be calculated first.
GET PUT DELETE /taxes/:id

Access, update, or delete a specific tax object by its ID.

Path Parameters

Parameter Type Description
id* string The unique identifier of the tax object

Supported Methods

Method Description
GET Retrieve a specific tax object
PUT Update a specific tax object
DELETE Delete a specific tax object

Example PUT Request

{
  "rate": 19.0,
  "description": "Updated State Tax for São Paulo",
  "active": true,
  "regions": ["SP", "RJ"]
}

Response Status Codes

Status Code Description
200 OK Operation completed successfully
400 Bad Request Invalid request parameters
404 Not Found Tax object with the specified ID does not exist
409 Conflict Cannot delete a tax that is in use by products or orders
Important: Modifying tax rates may affect pricing calculations for existing products and orders. Consider the impact before making changes to active tax configurations.