# API Documentation
## Introduction
This API allows you to interact with services to retrieve information about stores, store categories, and products.
## Authentication
Before making any requests, you need to authenticate with the API using the `auth/anonymous` endpoint.
### Authenticate (POST)
- **Endpoint:** `${BASE_URL}/auth/anonymous`
- **Method:** `POST`
- **Headers:**
- `App-Token`: **TOKEN**
- `Access-Control-Allow-Origin`: *
- `Content-Type`: application/json; charset=utf-8
- **Body:**
```json
{
"device_id": "your_device_id",
"platform": "web" // ios, android
}
```
<details>
<summary><b>Response</b></summary>
```json
{
"data":{
"token":"token_example",
"refresh_token":"0f7db7d0-a30b-11ee-a8e4-93f0223947af",
"token_expire":1703541039
},
"success":true
}
```
</details>
- **Requirements from response:**
```json
{
"data":{
"token":"access token",
"refresh_token":"refresh token",
},
}
```
## Store Operations
### Get Store Categories (GET)
- **Endpoint:** `${BASE_URL}/places/{store_id}/categories`
- **Method:** `GET`
- **Headers:** Same as authentication
<details>
<summary><b>Response</b></summary>
```json
{
"success": true,
"status_code": 200,
"data": [
{
"id": "category-id-1",
"name": "Category 1",
"sort": 0,
"subcategories": [],
"services": [
{
"id": "service-id-1",
"name": "Service 1",
"place_id": "place-id-1",
"description": "This is a service description.",
"base_unit_price": null,
"composition": null,
"purpose": null,
"storage_requirements": null,
"expires_in": null,
"vendor_country": null,
"package_info": null,
"photo": {
"original": "https://placeholder-url.com/original.jpg",
"image_1200": "https://placeholder-url.com/image_1200.jpg",
"image_900": "https://placeholder-url.com/image_900.jpg",
"image_600": "https://placeholder-url.com/image_600.jpg",
"thumb_300": "https://placeholder-url.com/thumb_300.jpg",
"thumbnail": "https://placeholder-url.com/thumbnail.jpg",
"thumb_200": "https://placeholder-url.com/thumb_200.jpg",
"thumb_100": "https://placeholder-url.com/thumb_100.jpg",
"thumb_50": "https://placeholder-url.com/thumb_50.jpg",
"resize_type": "aspect_fill"
},
"hidden": false,
"is_available": true,
"use_points": false,
"price": 999,
"discounted_price": null,
"currency": "ABC",
"amount": 999,
"measure": "generic_measure"
},
{
"id": "service-id-2",
"name": "Service 2",
"place_id": "place-id-2",
"description": "This is another service description.",
"base_unit_price": null,
"composition": null,
"purpose": null,
"storage_requirements": null,
"expires_in": null,
"vendor_country": null,
"package_info": null,
"photo": {
"original": "https://placeholder-url.com/original2.jpg",
"image_1200": "https://placeholder-url.com/image_1200_2.jpg",
"image_900": "https://placeholder-url.com/image_900_2.jpg",
"image_600": "https://placeholder-url.com/image_600_2.jpg",
"thumb_300": "https://placeholder-url.com/thumb_300_2.jpg",
"thumbnail": "https://placeholder-url.com/thumbnail_2.jpg",
"thumb_200": "https://placeholder-url.com/thumb_200_2.jpg",
"thumb_100": "https://placeholder-url.com/thumb_100_2.jpg",
"thumb_50": "https://placeholder-url.com/thumb_50_2.jpg",
"resize_type": "aspect_fill"
},
"hidden": false,
"is_available": true,
"use_points": false,
"price": 888,
"discounted_price": null,
"currency": "ABC",
"amount": 777,
"measure": "generic_measure",
"sort": 2,
"addon_types": []
}
],
"image": null,
"dark_image": null,
"image_web": null
}
]
}
```
</details>
- **Requirements from response:**
```json
{
"success": true,
"status_code": 200,
"data": [
{
"id": "category-id-1",
"name": "Category 1",
"sort": 0,
"subcategories": [],
"services": [
{
"id": "service-id-1",
"name": "Service 1",
"place_id": "place-id-1",
"description": "This is a service description.",
"base_unit_price": null,
"is_available": true,
"price": 999,
"currency": "USD",
"amount": 999,
"measure": "gram"
}
],
}
]
}
```
### Get Category Products (GET)
- **Endpoint:** `${BASE_URL}/places/{store_id}/categories/{category_id}`
- **Method:** `GET`
- **Headers:** Same as authentication
<details>
<summary><b>Response</b></summary>
```json
{
"success": true,
"status_code": 200,
"data": [
{
"id": "c5c5c892-34ae-488a-bd30-3941f7c9bade",
"name": "GENERIC_VALUE",
"start_time": null,
"finish_time": null,
"start_display_time": null,
"sort": 14,
"services": [
{
"id": "f95feb4a-c11e-42e7-a61d-993bfbaae9d3",
"name": "GENERIC_VALUE",
"place_id": "3a158564-d396-4ad0-88ae-d68dcbe58436",
"description": "GENERIC_VALUE",
"base_unit_price": null,
"composition": null,
"purpose": null,
"storage_requirements": null,
"expires_in": null,
"vendor_country": null,
"package_info": null,
"photo": {
"original": "GENERIC_VALUE",
"image_1200": "GENERIC_VALUE",
"image_900": "GENERIC_VALUE",
"image_600": "GENERIC_VALUE",
"thumb_300": "GENERIC_VALUE",
"thumbnail": "GENERIC_VALUE",
"thumb_200": "GENERIC_VALUE",
"thumb_100": "GENERIC_VALUE",
"thumb_50": "GENERIC_VALUE",
"resize_type": "aspect_fill"
},
"hidden": false,
"is_available": true,
"use_points": false,
"price": 450,
"discounted_price": null,
"currency": "RUB",
"amount": 330,
"measure": "gram",
"sort": 1,
"addon_types": []
},
{
"id": "dabc1424-1a38-4939-b61a-8da11283c4ef",
"name": "GENERIC_VALUE",
"place_id": "3a158564-d396-4ad0-88ae-d68dcbe58436",
"description": "GENERIC_VALUE",
"base_unit_price": null,
"composition": null,
"purpose": null,
"storage_requirements": null,
"expires_in": null,
"vendor_country": null,
"package_info": null,
"photo": {
"original": "GENERIC_VALUE",
"image_1200": "GENERIC_VALUE",
"image_900": "GENERIC_VALUE",
"image_600": "GENERIC_VALUE",
"thumb_300": "GENERIC_VALUE",
"thumbnail": "GENERIC_VALUE",
"thumb_200": "GENERIC_VALUE",
"thumb_100": "GENERIC_VALUE",
"thumb_50": "GENERIC_VALUE",
"resize_type": "aspect_fill"
},
"hidden": false,
"is_available": true,
"use_points": false,
"price": 350,
"discounted_price": null,
"currency": "RUB",
"amount": 300,
"measure": "gram",
"sort": 3,
"addon_types": [
{
"id": "3986cab5-2dec-4cee-87d6-609ef11b3df3",
"foreign_id": "",
"name": "GENERIC_VALUE",
"sort": null,
"is_required": false,
"type": "single",
"addons": [
{
"id": "c2d1245c-cdd1-4a7d-80f8-83fe18f32149",
"foreign_id": "",
"name": "GENERIC_VALUE",
"sort": 1,
"price": 0,
"currency": "RUB",
"price_for_receipt": 0,
"min_quantity": null,
"max_quantity": null,
"default_quantity": null,
"free_quantity": null
},
{
"id": "9774e5a1-1918-4638-ac3e-0db9e9fecbbf",
"foreign_id": "",
"name": "GENERIC_VALUE",
"sort": 2,
"price": 700,
"currency": "RUB",
"price_for_receipt": 0,
"min_quantity": null,
"max_quantity": null,
"default_quantity": null,
"free_quantity": null
}
],
"min_quantity": null,
"max_quantity": null
}
]
},
{
"id": "d87b865e-7e5a-48a1-a1e5-c8ed236a02d4",
"name": "GENERIC_VALUE",
"place_id": "3a158564-d396-4ad0-88ae-d68dcbe58436",
"description": "GENERIC_VALUE",
"base_unit_price": null,
"composition": null,
"purpose": null,
"storage_requirements": null,
"expires_in": null,
"vendor_country": null,
"package_info": null,
"photo": {
"original": "GENERIC_VALUE",
"image_1200": "GENERIC_VALUE",
"image_900": "GENERIC_VALUE",
"image_600": "GENERIC_VALUE",
"thumb_300": "GENERIC_VALUE",
"thumbnail": "GENERIC_VALUE",
"thumb_200": "GENERIC_VALUE",
"thumb_100": "GENERIC_VALUE",
"thumb_50": "GENERIC_VALUE",
"resize_type": "aspect_fill"
},
"hidden": false,
"is_available": true,
"use_points": false,
"price": 650,
"discounted_price": null,
"currency": "RUB",
"amount": 500,
"measure": "gram",
"sort": 2,
"addon_types": []
}
]
}
]
}
```
</details>
- **Requirements from response:**
```json
{
"success": true,
"status_code": 200,
"data": [
{
"id": "c5c5c892-34ae-488a-bd30-3941f7c9bade",
"name": "GENERIC_VALUE",
"services": [
{
"id": "f95feb4a-c11e-42e7-a61d-993bfbaae9d3",
"name": "GENERIC_VALUE",
"place_id": "3a158564-d396-4ad0-88ae-d68dcbe58436",
"description": "GENERIC_VALUE",
"base_unit_price": null,
"is_available": true,
"price": 450,
"currency": "RUB",
"amount": 330,
"measure": "gram"
},
]
}
]
}
```
### Get Stores by Location (GET)
- **Endpoint:** `${BASE_URL}/places/search`
- **Method:** `GET`
- **Headers:** Same as authentication
- **Parameters:**
- `latitude`: Latitude of the location
- `longitude`: Longitude of the location
- `networks_slugs`: Network slugs (optional)
<details>
<summary><b>Response</b></summary>
```json
{
"success": true,
"status_code": 200,
"meta": {
"count": 2,
"next": "https://api.example.com/v1/places/search?latitude=40.7128&limit=20&longitude=-74.0060&offset=20",
"previous": null
},
"data": [
{
"id": "1",
"name": "Sample Restaurant 1",
"address": "123 Main St",
"phone": "1234567890",
"orders_type": ["delivery", "takeaway"],
"longitude": -74.0059,
"latitude": 40.7127,
"image": {
"original": "https://example.com/images/sample1.jpg",
"thumbnail": "https://example.com/thumbnails/sample1.jpg"
},
"slug": "sample-restaurant-1",
"price_level": {
"id": 2,
"name": "Medium"
},
"currency": "USD",
"cover": {
"original": "https://example.com/covers/cover1.jpg",
"thumbnail": "https://example.com/thumbnails/cover1.jpg"
},
"cooking_time": 45,
"delivery_time": null,
"rating": 4.5,
"rating_info": {
"value": "4.5",
"approx_ratings_count": "500+ reviews",
"exact_ratings_count": "520 reviews",
"style": "green"
},
"provides_delivery": true,
"important_description": "Free Wi-Fi available.",
"cutlery_available": true,
"tags": ["Italian", "Pizza", "Family-friendly"],
"hidden": false,
"is_open": true,
"open_hours_text": "Accepting orders until 10:00 PM",
"cuisine": {
"id": 1,
"name": "Italian",
"slug": "italian",
"type": "cuisine",
"color": null,
"icon": "https://example.com/icons/italian.png"
},
"place_info_tags": [
{
"name": "Italian Cuisine",
"color": null
},
{
"name": "Pizza",
"color": null
},
{
"name": "Medium Price",
"color": null
}
],
"delivery_info_tags": [
{
"name": "Deliver in 30 minutes",
"color": null
},
{
"name": "$5 Delivery Fee",
"color": null
},
{
"name": "Free delivery over $50",
"color": "#34C759"
}
],
"rating_count": 520,
"estimated_delivery_time": "30 minutes",
"estimated_takeaway_time": "20 minutes",
"delivery_type": "default",
"delivery_always_paid": false,
"delivery_price": 5,
"minimum_free_delivery": 50,
"minimum_free_delivery_order_price": 50,
"minimum_order_amount": 0,
"city": {
"id": "1",
"name": "Sample City",
"domain": "samplecity"
},
"network": {
"id": "1",
"name": "Sample Network",
"slug": "sample-network"
},
"category": {
"id": "1",
"name": "Restaurants",
"short_name": "Restaurants",
"slug": "restaurants"
},
"is_exclusive": true,
"allow_courier_auto_assign": true,
"enable_promotion": false,
"hidden_type": "open"
},
{
"id": "2",
"name": "Sample Restaurant 2",
"address": "456 Oak St",
"phone": "9876543210",
"orders_type": ["delivery", "takeaway"],
"longitude": -74.007,
"latitude": 40.712,
"image": {
"original": "https://example.com/images/sample2.jpg",
"thumbnail": "https://example.com/thumbnails/sample2.jpg"
},
"slug": "sample-restaurant-2",
"price_level": {
"id": 3,
"name": "High"
},
"currency": "USD",
"cover": {
"original": "https://example.com/covers/cover2.jpg",
"thumbnail": "https://example.com/thumbnails/cover2.jpg"
},
"cooking_time": 60,
"delivery_time": null,
"rating": 4.8,
"rating_info": {
"value": "4.8",
"approx_ratings_count": "300+ reviews",
"exact_ratings_count": "310 reviews",
"style": "green"
},
"provides_delivery": true,
"important_description": "Outdoor seating available.",
"cutlery_available": true,
"tags": ["Steakhouse", "Fine Dining", "Outdoor Seating"],
"hidden": false,
"is_open": true,
"open_hours_text": "Accepting orders until 11:00 PM",
"cuisine": {
"id": 2,
"name": "Steakhouse",
"slug": "steakhouse",
"type": "cuisine",
"color": null,
"icon": "https://example.com/icons/steakhouse.png"
},
"place_info_tags": [
{
"name": "Steakhouse",
"color": null
},
{
"name": "Fine Dining",
"color": null
},
{
"name": "High Price",
"color": null
}
],
"delivery_info_tags": [
{
"name": "Deliver in 45 minutes",
"color": null
},
{
"name": "$8 Delivery Fee",
"color": null
},
{
"name": "Free delivery over $75",
"color": "#34C759"
}
],
"rating_count": 310,
"estimated_delivery_time": "45 minutes",
"estimated_takeaway_time": "25 minutes",
"delivery_type": "default",
"delivery_always_paid": false,
"delivery_price": 8,
"minimum_free_delivery": 75,
"minimum_free_delivery_order_price": 75,
"minimum_order_amount": 0,
"city": {
"id": "1",
"name": "Sample City",
"domain": "samplecity"
},
"network": {
"id": "1",
"name": "Sample Network",
"slug": "sample-network"
},
"category": {
"id": "1",
"name": "Restaurants",
"short_name": "Restaurants",
"slug": "restaurants"
},
"is_exclusive": true,
"allow_courier_auto_assign": true,
"enable_promotion": false,
"hidden_type": "open"
}
]
}
```
</details>