Endpoint
Get All Suppliers
Retrieve all suppliers with their status information.Response
Response Fields
Unique supplier identifier
Tax identification number
Supplier company name (required)
Contact person name
Contact email address
Contact phone number
Physical address
City location
Website URL
Payment terms in days (e.g., 30, 60, 90)
Status parameter ID (links to parametros table)
Status name from parametros table
Status color from parametros table
Number of associated products (always 0 in current implementation)
Create Supplier
Create a new supplier record.Request Parameters
Supplier company name (required field)
Tax identification number
Contact person name
Contact email address
Contact phone number
Physical address
City location
Website URL
Payment terms in days (can be null)
Status parameter ID (can be null)
Validation Rules
- nombre: Required, cannot be empty after trimming
- All other fields are optional
terminosandparametro_idaccept null values- All string fields are trimmed and SQL-escaped
Response
Update Supplier
Update an existing supplier’s information.Request Parameters
Supplier ID to update (must be greater than 0)
Supplier company name
Tax identification number
Contact person name
Contact email address
Contact phone number
Physical address
City location
Website URL
Payment terms in days
Status parameter ID
Validation Rules
- id: Required, must be greater than 0
- nombre: Required, cannot be empty
- Updates
fecha_actualizaciontimestamp automatically - No existence check is performed before update
Response
Delete Supplier
Delete a supplier from the system.Request Parameters
Supplier ID to delete (must be greater than 0)
Validation Rules
- id: Required, must be greater than 0
- No foreign key constraint check is performed
- No existence check is performed before deletion
Response
Unlike other endpoints, the suppliers delete operation does not check for associated products or verify existence before deletion.
Database Schema
Suppliers are stored in theproveedores table:
Status Integration
Suppliers can have status managed through the parametros system:Create Status Parameter
First, create a status parameter using the Parameters API:
Error Codes
| Error Message | Cause | Solution |
|---|---|---|
Datos inválidos | Invalid JSON | Check JSON syntax |
El nombre es obligatorio | Missing nombre | Include nombre in request |
ID inválido | Invalid ID | Provide valid ID > 0 |
Error al crear: [details] | Database error | Check database logs |
Error al actualizar: [details] | Database error | Check database logs |
Error al eliminar: [details] | Database error | Check database logs |