Partner API

v1

REST 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

HTTPerrorReason
401MISSING_TOKENMissing Authorization header
401INVALID_TOKENKey is invalid or revoked
403FORBIDDENVenue does not belong to your company
404NOT_FOUNDObject not found
422Validation errors (Laravel)

Reference Data

GET 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" }
}
GET venues.get

List of your company's venues.

ParameterTypeDefaultDescription
idsstringComma-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"
}
GET 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.

ParameterTypeDefaultDescription
idsstringComma-separated offer IDs. When set, returns those specific offers.
venue_idintegerFilter by specific venue
statusstringactiveactive — published offers; draft — unpublished
datestringvalidvalid — today and future; past — archive; YYYY-MM-DD/YYYY-MM-DD — date range; omit for all dates (default for drafts)
offsetinteger0Offset for pagination
countinteger20Number 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
  }
}
POST offers.create

Create an offer. Request body is JSON.

FieldTypeRequiredDescription
venue_idintegerVenue ID
template_idintegerProduct template ID (from reference.get)
pricenumberDiscounted price
original_pricenumberOriginal price
currencystringTRY / USD / EUR
quantity_totalintegerTotal slots
available_datestringDate YYYY-MM-DD
pickup_fromstringPickup start HH:MM
pickup_untilstringPickup end HH:MM
descriptionstringDescription (max. 500 chars.)
commentstringComment (max. 300 chars.)
statusstringactive (default) / draft
tag_idsinteger[]Array of tag IDs (from reference.get)
allergen_idsinteger[]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]
  }'
POST offers.update

Update an offer. Pass only the fields you want to change.

FieldTypeDescription
idinteger ✓Offer ID
pricenumberNew price
quantity_totalintegerNot less than already reserved
statusstringactive / draft
tag_idsinteger[]Replaces the full list of tags
allergen_idsinteger[]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]}'
POST offers.delete
FieldTypeDescription
idinteger ✓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"
}
GET orders.get

List of orders for your venues. total is the full count in the database.

ParameterTypeDefaultDescription
idsstringComma-separated order IDs
venue_idintegerFilter by venue
statusstringpending / confirmed / picked_up / cancelled
sortstringnewnew — newest first
offsetinteger0Offset
countinteger20Max. 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
  }
}
POST orders.confirm

Confirm a pending order. Returns the updated order object.

FieldTypeDescription
idinteger ✓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}'