Base Path
Authentication
All endpoints require authentication via theget_current_user dependency. Include your JWT token in the Authorization header:
Key Features
- CRUD Operations: Create, read, update, and delete product records
- Advanced Search: Text-based search across multiple fields with filtering
- Bulk Import: Import/update multiple products via JSON payload
- Technical Datasheets: Upload and manage PDF technical documentation
- Audit Trail: All product operations are automatically audited
Product Model
Products include the following key fields:| Field | Type | Description |
|---|---|---|
id | integer | Unique product identifier |
producto | string | Product name |
ifa | string | Active pharmaceutical ingredient (IFA) |
forma_farmaceutica | string | Pharmaceutical form |
presentacion_farmaceutica | string | Pharmaceutical presentation |
via | string | Route of administration |
estado_registro | string | Registration status |
numero_registro | string | Sanitary registration number (unique identifier) |
fecha_venc_registro | date | Registration expiration date |
fecha_primer_registro | date | First registration date |
comercializa | boolean | Currently marketed |
pais_comercializacion | string | Marketing country |
laboratorio_pais | string | Laboratory/country |
ficha_tecnica_url | string | URL to technical datasheet PDF |
comentarios | string | Additional comments |
Endpoints
Create Product
POST /products/
Create a new product record.
201 Created
List Products
GET /products/
Retrieve a paginated list of products with optional filtering and sorting.
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | "" | Search text (searches producto, ifa, numero_registro) |
estado | string | ”all” | Filter by registration status |
comercializa | string | ”all” | Filter by marketing status (“si”, “no”, “all”) |
sort | string | ”producto” | Sort field (producto, ifa, id, created_at, numero_registro) |
order | string | ”asc” | Sort order (asc, desc) |
offset | integer | 0 | Pagination offset |
limit | integer | 50 | Results per page (max 200) |
numero_registro | string | null | Exact match filter by registration number |
200 OK
Search Products (Autocomplete)
GET /products/search
Fast search endpoint optimized for autocomplete functionality.
termorq(required): Search term (min 2 characters)limit(optional, default: 8, max: 50): Maximum results
Get Product by ID
GET /products/{product_id}
Retrieve a single product by its ID.
200 OK or 404 Not Found
Update Product
PUT /products/{product_id}
Update an existing product. Only provided fields will be updated.
200 OK
The update operation automatically tracks changes and stores them in the audit log with a diff of modified fields.
Delete Product
DELETE /products/{product_id}
Permanently delete a product record.
200 OK
Lookup by Registration Number
GET /products/by-registro
Find a product by its sanitary registration number.
registroornumero_registro: Registration number (exact match)
Bulk Import
POST /products/bulk
Create or update multiple products in a single operation.
numero_registro. If a match is found, the product is updated; otherwise, a new product is created.
Request Body:
200 OK
- Each item must include at minimum:
productoandnumero_registro - Unknown fields are ignored
- Invalid items are skipped and reported in
errors
Technical Datasheet Management
Upload Technical Datasheet
POST /products/{product_id}/ficha-tecnica
Upload a PDF technical datasheet for a product.
201 Created
Get Technical Datasheet URL
GET /products/{product_id}/ficha-tecnica
Retrieve the URL of the product’s technical datasheet.
200 OK or 404 Not Found
Delete Technical Datasheet
DELETE /products/{product_id}/ficha-tecnica
Remove the technical datasheet reference and delete the physical file.
200 OK
Audit Trail
All product operations are automatically audited with the following actions:PRODUCT_CREATE- Product creationPRODUCT_LIST- Product listingPRODUCT_UPDATE- Product updates (includes change diff)PRODUCT_DELETE- Product deletionPRODUCT_BULK_IMPORT- Bulk import operationsPRODUCT_FICHA_UPLOAD- Technical datasheet uploadPRODUCT_FICHA_DELETE- Technical datasheet deletion