Partner API
v1REST API for managing offers and orders through your venues. Keys are issued in the Profile → API section.
Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
The key is tied to a company and grants access only to its venues.
Base URL
https://ziyanetme.com/api/v1/
Response Format
All responses are JSON. Success:
{
"ok": true,
"result": { ... }
}
Error:
{
"ok": false,
"error": "ERROR_CODE",
"description": "Human-readable message"
}
Error Codes
| HTTP | error | Reason |
|---|---|---|
| 401 | MISSING_TOKEN | Missing Authorization header |
| 401 | INVALID_TOKEN | Key is invalid or revoked |
| 403 | FORBIDDEN | Venue does not belong to your company |
| 404 | NOT_FOUND | Object not found |
| 422 | — | Validation errors (Laravel) |
Reference Data
reference.get
Returns all reference data needed to create offers: allergens, tags, and product templates.
curl "https://ziyanetme.com/api/v1/reference.get" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"ok": true,
"result": {
"allergens": [
{ "id": 1, "slug": "gluten", "name_en": "Gluten", "name_tr": "Gluten", "icon": "🌾" },
...
],
"tags": [
{ "id": 1, "slug": "vegetarian", "name_en": "Vegetarian", "name_tr": "Vejetaryen" },
...
],
"templates": [
{ "id": 5, "name_en": "Lunchbox", "name_tr": "Öğle yemeği kutusu", "icon": "🥡", "venue_type": "restaurant", "type": 1 },
...
],
"cities": [
{ "id": 1, "slug": "istanbul", "name": "Istanbul", "country_code": "TR" },
...
]
}
}
Venues
Venue Object
Returned by venues.get.
{
"id": 1,
"name": "My Cafe",
"type": "restaurant",
"moderation_status": "approved",
"is_active": true,
"city_id": 3,
"address": "Bağcılar Mah. No:12",
"latitude": 41.0082,
"longitude": 28.9784,
"phone": "+90 212 000 00 00",
"email": "cafe@example.com",
"description": "Fresh food daily",
"social_links": { "instagram": "mycafe" }
}
venues.get
List of your company's venues.
| Parameter | Type | Default | Description |
|---|---|---|---|
| ids | string | — | Comma-separated venue IDs. When set, returns those specific venues. |
Example Request
# All venues curl "https://ziyanetme.com/api/v1/venues.get" \ -H "Authorization: Bearer YOUR_API_KEY" # Specific venues by ID curl "https://ziyanetme.com/api/v1/venues.get?ids=1,2" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"ok": true,
"result": {
"items": [ <Venue>, ... ],
"total": 3
}
}
Offers
Offer Object
Returned by offers.get, offers.create, offers.update.
{
"id": 42,
"venue_id": 1,
"template": { "id": 5, "name": "Lunchbox", "icon": "🥡" },
"description": "Fresh lunch",
"comment": null,
"price": 150.0,
"original_price": 300.0,
"discount_percent": 50,
"currency": "TRY",
"quantity_total": 10,
"quantity_left": 7,
"available_date": "2025-06-01",
"pickup_from": "18:00",
"pickup_until": "20:00",
"status": "active",
"tag_ids": [1, 3],
"allergen_ids": [2],
"created_at": "2025-05-28T12:00:00+03:00"
}
offers.get
List of your company's offers. total in the response is the full count of matching records in the database — use it for pagination.
| Parameter | Type | Default | Description |
|---|---|---|---|
| ids | string | — | Comma-separated offer IDs. When set, returns those specific offers. |
| venue_id | integer | — | Filter by specific venue |
| status | string | active | active — published offers; draft — unpublished |
| date | string | valid | valid — today and future; past — archive; YYYY-MM-DD/YYYY-MM-DD — date range; omit for all dates (default for drafts) |
| offset | integer | 0 | Offset for pagination |
| count | integer | 20 | Number of records (max. 100) |
Example Request
# Active upcoming offers curl "https://ziyanetme.com/api/v1/offers.get" \ -H "Authorization: Bearer YOUR_API_KEY" # Drafts curl "https://ziyanetme.com/api/v1/offers.get?status=draft" \ -H "Authorization: Bearer YOUR_API_KEY" # Archive (past active offers) curl "https://ziyanetme.com/api/v1/offers.get?status=active&date=past" \ -H "Authorization: Bearer YOUR_API_KEY" # Specific offers by ID curl "https://ziyanetme.com/api/v1/offers.get?ids=42,43" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"ok": true,
"result": {
"items": [ <Offer>, ... ],
"total": 47
}
}
offers.create
Create an offer. Request body is JSON.
| Field | Type | Required | Description |
|---|---|---|---|
| venue_id | integer | ✓ | Venue ID |
| template_id | integer | ✓ | Product template ID (from reference.get) |
| price | number | ✓ | Discounted price |
| original_price | number | ✓ | Original price |
| currency | string | ✓ | TRY / USD / EUR |
| quantity_total | integer | ✓ | Total slots |
| available_date | string | ✓ | Date YYYY-MM-DD |
| pickup_from | string | ✓ | Pickup start HH:MM |
| pickup_until | string | ✓ | Pickup end HH:MM |
| description | string | — | Description (max. 500 chars.) |
| comment | string | — | Comment (max. 300 chars.) |
| status | string | — | active (default) / draft |
| tag_ids | integer[] | — | Array of tag IDs (from reference.get) |
| allergen_ids | integer[] | — | Array of allergen IDs present in the offer (from reference.get) |
curl -X POST https://ziyanetme.com/api/v1/offers.create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"venue_id": 1,
"template_id": 5,
"price": 150,
"original_price": 300,
"currency": "TRY",
"quantity_total": 10,
"available_date": "2025-06-01",
"pickup_from": "18:00",
"pickup_until": "20:00",
"tag_ids": [1, 3],
"allergen_ids": [2]
}'
offers.update
Update an offer. Pass only the fields you want to change.
| Field | Type | Description |
|---|---|---|
| id | integer ✓ | Offer ID |
| price | number | New price |
| quantity_total | integer | Not less than already reserved |
| status | string | active / draft |
| tag_ids | integer[] | Replaces the full list of tags |
| allergen_ids | integer[] | Replaces the full list of allergens |
| Other fields are the same as in offers.create | ||
curl -X POST https://ziyanetme.com/api/v1/offers.update \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 42, "status": "draft", "tag_ids": [1]}'
offers.delete
| Field | Type | Description |
|---|---|---|
| id | integer ✓ | ID of the offer to delete |
curl -X POST https://ziyanetme.com/api/v1/offers.delete \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 42}'
Response: {"ok": true, "result": {"deleted": true}}
Orders
Order Object
Returned by orders.get and orders.confirm.
{
"id": 100,
"venue_id": 1,
"status": "confirmed",
"paid_amount": 150.0,
"currency": "TRY",
"user": { "id": 7, "name": "John", "phone": "+90..." },
"items": [
{
"offer_id": 42,
"offer_title": "Lunchbox",
"quantity": 1,
"price": 150.0
}
],
"available_date": "2025-06-01",
"pickup_from": "18:00",
"pickup_until": "20:00",
"created_at": "2025-05-28T12:00:00+03:00"
}
orders.get
List of orders for your venues. total is the full count in the database.
| Parameter | Type | Default | Description |
|---|---|---|---|
| ids | string | — | Comma-separated order IDs |
| venue_id | integer | — | Filter by venue |
| status | string | — | pending / confirmed / picked_up / cancelled |
| sort | string | new | new — newest first |
| offset | integer | 0 | Offset |
| count | integer | 20 | Max. 100 |
# All confirmed orders curl "https://ziyanetme.com/api/v1/orders.get?status=confirmed" \ -H "Authorization: Bearer YOUR_API_KEY" # Specific orders by ID curl "https://ziyanetme.com/api/v1/orders.get?ids=100,101" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
{
"ok": true,
"result": {
"items": [ <Order>, ... ],
"total": 12
}
}
orders.confirm
Confirm a pending order. Returns the updated order object.
| Field | Type | Description |
|---|---|---|
| id | integer ✓ | Order ID to confirm |
curl -X POST https://ziyanetme.com/api/v1/orders.confirm \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 100}'