Products
Catalog, prices, and sell/purchase/inventory flags. Requires authentication.
See Resource template.
Main routes
| Method | Path | Description |
|---|---|---|
| GET | /products | List |
| GET | /products/:id | Get |
| POST | /products | Create |
| PUT | /products/:id | Update |
| GET | /products/search | Search |
Create product
POST /products
Content-Type: application/jsonMain fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name |
price | number | yes | Sale price |
cost | number | yes | Cost |
code | string | conditional | Unique code, or use autoCode |
barcode | string | no | Unique if set |
tax_rate | number | no | Tax rate |
is_sellable / is_purchasable / is_inventoriable | boolean | no | Flags |
requiresLotControl / requiresSerialControl | boolean | no | Do not combine both |
Example JSON
json
{
"code": "PROD-001",
"name": "API sample product",
"description": "Created from integration",
"barcode": "7501234567890",
"category_id": 3,
"price": 500.00,
"cost": 320.00,
"tax_rate": 15,
"is_active": true,
"is_sellable": true,
"is_purchasable": true,
"is_inventoriable": true
}Example cURL
bash
curl -X POST "https://api.abaco.hn/products" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"code": "PROD-001",
"name": "API sample product",
"price": 500.00,
"cost": 320.00,
"tax_rate": 15,
"is_active": true,
"is_sellable": true,
"is_purchasable": true,
"is_inventoriable": true
}'Get by ID
GET /products/:idbash
curl -X GET "https://api.abaco.hn/products/5" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET"Use the returned id as productId on document lines.
Common errors
json
{
"error": "Ya existe un producto con ese código"
}| Code | When |
|---|---|
| 400 | Invalid price/cost, duplicate code or barcode, lot+serial together |
| 401 | Invalid credentials |
| 404 | Product not found |