Skip to main content

Overview

The Providers API allows you to manage supplier (proveedor) records - the entities from whom you purchase products and inventory. Each provider has contact information, tax identification (RUT), and an active status.

Create Provider

Request Body

rut
string
required
Tax identification number (RUT) in format ‘12345678-9’. Must be unique and valid.
razon_social
string
required
Legal or business name of the provider.
giro
string
Business activity or industry.
direccion
string
Physical address.
email
string
Contact email address.
telefono
string
Contact phone number.
ciudad
string
City.

Response

id
integer
Unique provider identifier.
rut
string
Tax identification number.
razon_social
string
Legal or business name.
giro
string
Business activity.
direccion
string
Physical address.
email
string
Contact email.
telefono
string
Contact phone.
ciudad
string
City.
is_active
boolean
Whether the provider is active (default: true).
created_at
datetime
Timestamp when the provider was created.
updated_at
datetime
Timestamp of last update.
curl -X POST https://api.example.com/providers/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "rut": "76543210-9",
    "razon_social": "Distribuidora Central S.A.",
    "giro": "Importación y distribución",
    "direccion": "Av. Industrial 2500",
    "ciudad": "Santiago",
    "email": "[email protected]",
    "telefono": "+56 2 2987 6543"
  }'
{
  "id": 1,
  "rut": "76543210-9",
  "razon_social": "Distribuidora Central S.A.",
  "giro": "Importación y distribución",
  "direccion": "Av. Industrial 2500",
  "ciudad": "Santiago",
  "email": "[email protected]",
  "telefono": "+56 2 2987 6543",
  "is_active": true,
  "created_at": "2026-03-08T10:30:00Z",
  "updated_at": null
}

List Providers

Response

Returns an array of active provider objects. Inactive providers are excluded from the list.
curl -X GET https://api.example.com/providers/ \
  -H "Authorization: Bearer YOUR_TOKEN"
[
  {
    "id": 1,
    "rut": "76543210-9",
    "razon_social": "Distribuidora Central S.A.",
    "giro": "Importación y distribución",
    "direccion": "Av. Industrial 2500",
    "ciudad": "Santiago",
    "email": "[email protected]",
    "telefono": "+56 2 2987 6543",
    "is_active": true,
    "created_at": "2026-03-08T10:30:00Z",
    "updated_at": null
  },
  {
    "id": 2,
    "rut": "88776655-4",
    "razon_social": "Mayorista del Norte Ltda.",
    "giro": "Venta mayorista",
    "direccion": "Los Carreras 890",
    "ciudad": "Antofagasta",
    "email": "[email protected]",
    "telefono": "+56 55 2234 5678",
    "is_active": true,
    "created_at": "2026-03-07T15:20:00Z",
    "updated_at": null
  }
]

Search Providers

Query Parameters

q
string
Search query. Matches against RUT (with or without dots/dashes) or business name. Returns up to 10 results. Only searches active providers.

Response

Returns an array of matching active provider objects (maximum 10).
curl -X GET "https://api.example.com/providers/search?q=Central" \
  -H "Authorization: Bearer YOUR_TOKEN"
[
  {
    "id": 1,
    "rut": "76543210-9",
    "razon_social": "Distribuidora Central S.A.",
    "giro": "Importación y distribución",
    "direccion": "Av. Industrial 2500",
    "ciudad": "Santiago",
    "email": "[email protected]",
    "telefono": "+56 2 2987 6543",
    "is_active": true,
    "created_at": "2026-03-08T10:30:00Z",
    "updated_at": null
  }
]

Get Provider

Path Parameters

provider_id
integer
required
Unique provider identifier.

Response

Returns a single provider object.
curl -X GET https://api.example.com/providers/1 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "id": 1,
  "rut": "76543210-9",
  "razon_social": "Distribuidora Central S.A.",
  "giro": "Importación y distribución",
  "direccion": "Av. Industrial 2500",
  "ciudad": "Santiago",
  "email": "[email protected]",
  "telefono": "+56 2 2987 6543",
  "is_active": true,
  "created_at": "2026-03-08T10:30:00Z",
  "updated_at": null
}

Update Provider

Path Parameters

provider_id
integer
required
Unique provider identifier.

Request Body

All fields are optional. Only provided fields will be updated.
rut
string
New RUT value (must be unique and valid).
razon_social
string
Legal or business name.
giro
string
Business activity.
direccion
string
Physical address.
email
string
Contact email.
telefono
string
Contact phone.
ciudad
string
City.
is_active
boolean
Active status.

Response

Returns the updated provider object.
curl -X PUT https://api.example.com/providers/1 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "email": "[email protected]",
    "telefono": "+56 2 2987 9999"
  }'
{
  "id": 1,
  "rut": "76543210-9",
  "razon_social": "Distribuidora Central S.A.",
  "giro": "Importación y distribución",
  "direccion": "Av. Industrial 2500",
  "ciudad": "Santiago",
  "email": "[email protected]",
  "telefono": "+56 2 2987 9999",
  "is_active": true,
  "created_at": "2026-03-08T10:30:00Z",
  "updated_at": "2026-03-08T11:45:00Z"
}

Delete Provider

Path Parameters

provider_id
integer
required
Unique provider identifier.

Response

Returns a confirmation message on success.
curl -X DELETE https://api.example.com/providers/1 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "detail": "Proveedor desactivado"
}

Provider Management Notes

  • Providers use soft delete - when deleted, they are marked as is_active: false rather than being permanently removed
  • Only active providers appear in list and search results
  • Provider records are linked to purchases, so maintaining historical data is important
  • RUT validation follows Chilean tax ID format
  • Search functionality normalizes RUT queries (removes dots and dashes) for easier lookup

Build docs developers (and LLMs) love