Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/juadariasmar/inventory_project/llms.txt

Use this file to discover all available pages before exploring further.

The Suppliers API manages the vendor directory for your tenant. Each supplier record stores contact information and is linked to one or more purchase orders. Suppliers can be soft-deactivated via the activo flag without losing historical order data. Attempting to delete a supplier that has associated purchase orders will return a 409 Conflict error to preserve data integrity. Read access (GET) is available to any active tenant member. All write operations — creating, updating, and deleting suppliers — require the ADMIN role.

Endpoints

MethodPathDescription
GET/api/proveedoresList all suppliers for the tenant
POST/api/proveedoresCreate a new supplier
GET/api/proveedores/[id]Get a supplier by ID
PUT/api/proveedores/[id]Update a supplier
DELETE/api/proveedores/[id]Delete a supplier

GET /api/proveedores

Returns all suppliers belonging to the authenticated user’s tenant, ordered alphabetically by name. The default limit is 200 records.

Response fields

Returns an array of Proveedor objects.
id
number
Unique supplier ID.
nombre
string
Supplier name.
nit
string | null
Tax identification number (NIT). Optional.
contacto
string | null
Primary contact person name. Optional.
telefono
string | null
Contact phone number. Optional.
email
string | null
Contact email address. Optional.
direccion
string | null
Physical address. Optional.
activo
boolean
Whether the supplier is currently active. Defaults to true on creation.
creadoEn
string
ISO 8601 timestamp of when the supplier record was created.
curl -b 'session=...' \
  'https://your-domain.com/api/proveedores'

POST /api/proveedores

Creates a new supplier record scoped to the authenticated user’s tenant. Requires ADMIN role. Returns the created Proveedor (HTTP 201).

Request body

nombre
string
required
Supplier name. Cannot be empty.
nit
string
Tax identification number.
contacto
string
Primary contact person’s name.
telefono
string
Phone number.
email
string
Email address.
direccion
string
Physical address.

Response fields

id
number
Assigned supplier ID.
nombre
string
Supplier name.
nit
string | null
Tax ID.
contacto
string | null
Contact person.
telefono
string | null
Phone number.
email
string | null
Email address.
direccion
string | null
Address.
activo
boolean
Active flag, always true on creation.
creadoEn
string
Creation timestamp (ISO 8601).
curl -b 'session=...' \
  -X POST 'https://your-domain.com/api/proveedores' \
  -H 'Content-Type: application/json' \
  -d '{
    "nombre": "Distribuidora Nacional S.A.",
    "nit": "900123456-1",
    "contacto": "Carlos Mejía",
    "telefono": "3001234567",
    "email": "[email protected]",
    "direccion": "Cra 15 #45-20, Bogotá"
  }'

GET /api/proveedores/[id]

Returns a single supplier by its numeric ID. The record is scoped to the tenant — requesting an ID from a different company returns 404.

Path parameters

id
number
required
Numeric supplier ID.

Response fields

id
number
Supplier ID.
nombre
string
Supplier name.
nit
string | null
Tax ID.
contacto
string | null
Contact person.
telefono
string | null
Phone number.
email
string | null
Email address.
direccion
string | null
Address.
activo
boolean
Whether the supplier is active.
creadoEn
string
Creation timestamp (ISO 8601).
curl -b 'session=...' \
  'https://your-domain.com/api/proveedores/7'

PUT /api/proveedores/[id]

Updates an existing supplier record. Only fields present in the request body are applied — omitted fields are left unchanged. Requires ADMIN role.

Path parameters

id
number
required
Numeric supplier ID.

Request body

nombre
string
Updated supplier name. Cannot be set to an empty string.
nit
string
Updated tax ID. Pass an empty string to clear the value.
contacto
string
Updated contact person name.
telefono
string
Updated phone number.
email
string
Updated email address.
direccion
string
Updated address.
activo
boolean
Set to false to deactivate the supplier without deleting the record.
curl -b 'session=...' \
  -X PUT 'https://your-domain.com/api/proveedores/7' \
  -H 'Content-Type: application/json' \
  -d '{
    "telefono": "3109876543",
    "activo": false
  }'

DELETE /api/proveedores/[id]

Permanently deletes a supplier. The operation is blocked with a 409 Conflict response if the supplier has any associated purchase orders. Requires ADMIN role. Returns { "ok": true } on success.

Path parameters

id
number
required
Numeric supplier ID.
curl -b 'session=...' \
  -X DELETE 'https://your-domain.com/api/proveedores/7'

Build docs developers (and LLMs) love