Skip to main content
The Configuration API allows you to manage system-wide settings and tax rates used throughout the platform.

Taxes

Manage tax rates that can be applied to products and sales.

List Taxes

Returns all tax configurations in the system.

Response

id
integer
required
Tax unique identifier
name
string
required
Tax name (e.g., “IVA”, “Exento”)
rate
decimal
required
Tax rate as a decimal (e.g., 0.19 for 19%)
is_active
boolean
required
Whether the tax is currently active
is_default
boolean
required
Whether this is the default tax for new products

Example

curl -X GET "https://api.torn.cl/api/config/taxes/" \
  -H "Authorization: Bearer YOUR_TOKEN"
[
  {
    "id": 1,
    "name": "IVA",
    "rate": 0.19,
    "is_active": true,
    "is_default": true
  },
  {
    "id": 2,
    "name": "Exento",
    "rate": 0.0,
    "is_active": true,
    "is_default": false
  }
]

Create Tax

Creates a new tax configuration.

Request Body

name
string
required
Tax name (e.g., “IVA”, “Reducido”)
rate
decimal
required
Tax rate as a decimal. For 19%, use 0.19
is_active
boolean
default:"true"
Whether the tax is active
is_default
boolean
default:"false"
Whether this should be the default tax

Response

Returns the created tax object with status code 201.

Example

curl -X POST "https://api.torn.cl/api/config/taxes/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "IVA Reducido",
    "rate": 0.10,
    "is_active": true,
    "is_default": false
  }'
{
  "id": 3,
  "name": "IVA Reducido",
  "rate": 0.10,
  "is_active": true,
  "is_default": false
}

Update Tax

Updates an existing tax configuration.

Path Parameters

tax_id
integer
required
ID of the tax to update

Request Body

name
string
Tax name
rate
decimal
Tax rate as a decimal
is_active
boolean
Whether the tax is active
is_default
boolean
Whether this is the default tax
All fields are optional. Only provided fields will be updated.

Response

Returns the updated tax object.

Example

curl -X PUT "https://api.torn.cl/api/config/taxes/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rate": 0.19,
    "is_active": true
  }'

System Settings

Manage global system configuration.

Get Settings

Returns the current system settings. If no settings exist, default settings are initialized.

Response

id
integer
required
Settings identifier (always 1)
print_format
string
required
Printer format configuration (e.g., “80mm”, “58mm”)
iva_default_id
integer
Default tax (IVA) ID to apply to new products

Example

curl -X GET "https://api.torn.cl/api/config/settings/" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "id": 1,
  "print_format": "80mm",
  "iva_default_id": 1
}

Update Settings

Updates the global system configuration.

Request Body

print_format
string
Printer format. Common values: “80mm”, “58mm”, “A4”
iva_default_id
integer
Default tax ID to apply to new products
All fields are optional. Only provided fields will be updated.

Response

Returns the updated settings object.

Example

curl -X PUT "https://api.torn.cl/api/config/settings/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "print_format": "58mm",
    "iva_default_id": 1
  }'
{
  "id": 1,
  "print_format": "58mm",
  "iva_default_id": 1
}

Configuration Best Practices

Tax Configuration

  1. Default Tax: Always set one tax as default for automatic application to new products
  2. Rate Format: Use decimal format (0.19 for 19%, not 19)
  3. Exempt Products: Create a 0% tax rate for exempt products
  4. Deactivation: Instead of deleting taxes, deactivate them to preserve historical records
Choose the print format based on your thermal printer:
  • 80mm: Standard thermal printers (most common)
  • 58mm: Compact thermal printers (mobile POS)
  • A4: Laser printers for invoices

Example Setup

# 1. Create standard IVA tax
curl -X POST "https://api.torn.cl/api/config/taxes/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "IVA",
    "rate": 0.19,
    "is_active": true,
    "is_default": true
  }'

# 2. Create exempt tax
curl -X POST "https://api.torn.cl/api/config/taxes/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Exento",
    "rate": 0.0,
    "is_active": true,
    "is_default": false
  }'

# 3. Configure system settings
curl -X PUT "https://api.torn.cl/api/config/settings/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "print_format": "80mm",
    "iva_default_id": 1
  }'

Build docs developers (and LLMs) love