API Documentation
Getting Started
The Vinosoma REST API allows you to manage your restaurant's wine inventory, register sales, and access restaurant information programmatically.
Base URL
Authentication
Two authentication methods are supported:
- API Key: Add
X-API-Keyheader with your 32-character token - OAuth 2.0: Add
Authorization: Bearer {token}header
Note: Contact your restaurant administrator to obtain API credentials.
Deprecated: The old /restaurant/wine route still works as an alias for /restaurant/inventory, but new integrations should use the inventory path as documented in the Swagger spec. To register a sale, use POST /restaurant/sale/{gtin}.
Example 1: Get Your Restaurant Info
Returns information about the restaurant your API token belongs to (whoami).
Request
curl -X GET "https://app.vinosoma.com/rest/restaurant/info" \
-H "X-API-Key: your-api-key-here"
Response
{
"data": {
"id": 1,
"name": "Restaurant Vino",
"company_id": 5,
"currency_code": "DKK",
"currency_symbol": "kr"
}
}
Example 2: Adjust Inventory Quantity
Add or remove bottles from inventory using a relative change. Use a positive value to add stock, negative to remove. If the wine isn't in your inventory yet, it will be created automatically.
Request
curl -X POST "https://app.vinosoma.com/rest/restaurant/inventory/5701234567890" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"quantity": 5
}'
Response
{
"success": true,
"message": "Added 5 to inventory",
"data": {
"wine_restaurant_id": 42,
"wine_id": 128,
"gtin": "5701234567890",
"previous_amount": 19,
"change": 5,
"new_amount": 24
}
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| quantity | integer | Yes | Bottles to add (positive) or remove (negative). Cannot be 0. |
Need to set absolute values? Use PUT /restaurant/inventory/{gtin} with fields like amount, purchase_price, sales_price, supplier_id, or low_stock_threshold.
Example 3: Register Wine Sale
Register a sale of wine bottles, automatically updating inventory.
Request
curl -X POST "https://app.vinosoma.com/rest/restaurant/sale/5701234567890" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"quantity": 2,
"sales_price": 149.00,
"location_id": 5
}'
Response
{
"success": true,
"message": "Sale registered successfully",
"data": {
"sale_id": 1523,
"wine_id": 128,
"quantity": 2,
"unit_price": 149.0,
"total_price": 298.0,
"currency": "kr",
"previous_stock": 24,
"new_stock": 22
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| gtin | string (path) | Yes | Wine GTIN/barcode (in URL) |
| quantity | integer | No | Number of bottles sold (default: 1) |
| sales_price | float | No | Override price for this sale |
| location_id | integer | No | Restaurant location where sale occurred |
API Endpoints
Restaurant Info
/restaurant/info
- Get your restaurant info (whoami)
Inventory Management
/restaurant/inventory
- List wines in inventory (paginated)
/restaurant/inventory/{gtin}
- Get wine in inventory by GTIN
/restaurant/inventory/{gtin}
- Adjust quantity (relative ±)
/restaurant/inventory/{gtin}
- Set absolute values (amount, prices, etc.)
/restaurant/inventory/{gtin}
- Remove wine completely from inventory
Sales
/restaurant/sale/{gtin}
- Register a wine sale (decreases stock)
Locations (read-only)
/restaurant/location
- List restaurant locations
/restaurant/location/{id}
- Get location details
Webhooks
/restaurant/webhook
- List your webhooks
/restaurant/webhook
- Create new webhook
/restaurant/webhook/{id}
- Get webhook details
/restaurant/webhook/{id}
- Update webhook
/restaurant/webhook/{id}
- Delete webhook
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid input data |
| 401 | Unauthorized - Missing or invalid authentication |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource does not exist |
| 413 | Request Too Large - Request body exceeds 10MB |
| 415 | Unsupported Media Type - Content-Type must be application/json |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error occurred |