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
Tax identification number (RUT) in format ‘12345678-9’. Must be unique and valid.
Legal or business name of the provider.
Business activity or industry.
Response
Unique provider identifier.
Tax identification number.
Whether the provider is active (default: true).
Timestamp when the provider was created.
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
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
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
Unique provider identifier.
Request Body
All fields are optional. Only provided fields will be updated.
New RUT value (must be unique and valid).
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
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