For example if method is layout
then request URL is /api/layout
.
If not specified (POST)
then this is GET-method.
NOTE: all prices transfer to the frontend as integer (in cents), for example 3.99 will be 399 on frontend.
Requested when frontend rendered on server side. Returns base data for all pages.
pizza_types
- list of all pizza types for menu (array with items)name
- pizza nameslug
- slug for pizza page URLphoto
- link to photo previewprices
- list of prices, currency => price- For example: "usd" => 123 ($ 1.23)
user
- data of authorized user (NULL for guest)email
name
is_admin
(bool)currency
,address
,contacts
- data from last order
currencies
- list of available currencies (first element is default currency)- key - "usd" for example
- label - currency sign ("$")
csrf
- CSRF token for POST requests
Input:
email
password
Output:
user
- data of user (such as inlayout
request, see above), NULL if login was failed
POST request without data.
Data of the specified pizza type.
pizza
- such as an item inlayout
request (see abovepizza_types
)description
additional
Order. Request:
pizza
- dictionary- pizza slug => count
currency
email
- for guestname
address
contacts
outside
- delivery outside the city
Note: after successfully user registration he will automatically login
Response:
order_number
- for success, redirect to/cabinet/{order_number}
user
- current user data (such as inlayout
request), created or updatedreq_login
- TRUE if email already exists
Response:
orders
- list of the current user ordersnumber
status
total_price
currency
created_at
finalized_at
Response:
order
info of the specified ordernumber
status
user_name
email
address
contacts
outside
currency
delivery_price
total_price
status
created_at
finalized_at
items
- list of pizza in the orderslug
name
count
Response:
orders
- such as incabinet
method
Response:
order
- such as incabinet/{order-number}
method
Change status of the order.
Request:
status
- "delivery"|"success"|"fail"
Response:
order
- all data of the order after changes (see `admin/{order-number}).