The TopsPizza.co.uk API (1.0.0)

Download OpenAPI specification:Download

The TopsPizza.co.uk API

Auth

Login

Do user login

Request Body schema: application/json
email
required
string

User's email

password
required
string

password

platform
required
string

Platform the user would recognize

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string",
  • "platform": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Login Facebook

Do customer login with facebook

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
"string"

Login Facebook callback

Facebook login callback

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
{ }

Login Apple

Do customer login with apple

Request Body schema: application/json
email
string

Responses

Request samples

Content type
application/json
{
  • "email": "string"
}

Response samples

Content type
"string"

Logout

Do customer logout

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": "string"
}

Register

Do customer register

Request Body schema: application/json
name
required
string

Customer's name

email
required
string

Customer's email

password
required
string

password

password_confirmation
required
string

confirm password

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "password": "string",
  • "password_confirmation": "string"
}

Response samples

Content type
application/json
"string"

Forgot password

Will send reset password link in email

Request Body schema: application/json
email
string

Customer's email

Responses

Request samples

Content type
application/json
{
  • "email": "string"
}

Response samples

Content type
{ }

Reset password

Do customer reset password

Request Body schema: application/json
token
string

Token given in reset-password link through email

email
string

Customer's email

password
string

Customer's new password

password_confirmation
string

Customer's new password confirmation

Responses

Request samples

Content type
application/json
{
  • "token": "string",
  • "email": "string",
  • "password": "string",
  • "password_confirmation": "string"
}

Response samples

Content type
{ }

Settings

Get app min version

Get App Min Version

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get server time

Get Server Time

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Customers

Get customer

Get Customer by id

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
string

The encrypted customer id

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Update customer

Update Customer Data

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
required
string

The encrypted customer id

first_name
string

The first name

last_name
string

The last name

email
string

The email

rate
number

The customer ratings

note
string

The note

phone_number
number

The phone number

phone_number_mobile
string

The mobile phone number

newsletter_subscribed
string
Enum: 0 1

The newsletter subscription, 0 means unsubscribed and 1 means subscribed

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "string",
  • "rate": 0,
  • "note": "string",
  • "phone_number": 0,
  • "phone_number_mobile": "string",
  • "newsletter_subscribed": 0
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Delete customer

Delete Customer Account

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
required
string

The user id

expires
required
number

The link expiry timestamp

signature
required
string

The signature code for link validation

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "expires": 0,
  • "signature": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": "string"
}

Create customer

Create Customer Data

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
first_name
required
string

The first name

phone_number_mobile
required
string

The mobile phone number

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "phone_number_mobile": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get loyalty

Get Customer Loyalty points

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Find customer

Find Customer data

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
phone_number
required
number

The customer mobile phone number

customer_id
required
string

The encrypted customer id

Responses

Request samples

Content type
application/json
{
  • "phone_number": 0,
  • "customer_id": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get Addresses

Get Customer Addresses / Get Postcode Addresses

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
postcode
string

The postcode

Responses

Request samples

Content type
application/json
{
  • "postcode": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Update address

Update customer address or create if not exists

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
number

The user address id

postcode
required
string

The postcode

postcode_id
string

The postcode id

customer_id
required
string

The customer id

note
string

The address note

is_default
string

The default

street
required
number

The street

number
number

The number

city
string

The city

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "postcode": "string",
  • "postcode_id": "string",
  • "customer_id": "string",
  • "note": "string",
  • "is_default": "string",
  • "street": 0,
  • "number": 0,
  • "city": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Update rate

Rate Customer

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
required
string

The encrypted customer id

rate
required
number
Enum: 0 1 2 3 4 5

The customer ratings

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "rate": 0
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Rate customer

Add ratings to customer

Request Body schema: application/json
customer_id
required
string

The encrypted customer id

rate
number
Enum: 0 1 2

The rating for customer. 0 means blocked, 1 means bad and 2 means good.

note
string

The note/feedback on the customer

Responses

Request samples

Content type
application/json
{
  • "customer_id": "string",
  • "rate": 0,
  • "note": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Request delete

Request account delete

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": "string"
}

Stores

Get stores

Get list of Stores

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Search store

Get Store

Request Body schema: application/json
store_id
integer

The Store Id

postcode
string

The store postcode

Responses

Request samples

Content type
application/json
{
  • "store_id": 0,
  • "postcode": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Orders

Get orders

Get customer orders or store orders

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
id
string

The encrypted store id

customer_id
string

The encrypted customer id

type
required
string
Enum: "customer" "store"
per_page
required
number

Number of orders per page

page
required
number

The page number

startDate
date

The start date

endDate
date

The end date

status
string
Enum: "payment_pending" "paid" "payment_failed" "pending" "accepted" "cooking" "cooked" "to_be_delivered" "picked_up_for_delivery" "left_the_shop" "delivered" "out_of_coverage" "double_order" "shop_closing" "bad_weather" "refunded" "refund" "canceled"

The status

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "customer_id": "string",
  • "type": "customer",
  • "per_page": 0,
  • "page": 0,
  • "startDate": null,
  • "endDate": null,
  • "status": "payment_pending"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Create orders

Create customer order

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
platform
required
string
Enum: "web" "app" "pos"

The platform

id
string

The encrypted customer id

cart
required
Array of arrays

The cart items

requested_at
required
number

The requested at time

order_type
required
string
Enum: "delivery" "collection" "shop"

The order type

address
number

The delivery address id

store_id
required
number

The store Id

payment_method
required
string
Enum: "cash" "card"

The payment type

voucher_id
number

The voucher id

user_id
string

The encrypted user id

directDiscountAmount
number

The direct discount value given by pos user

directDiscountReason
string

The reason for the direct discount

comment
number

The comment from customer

notesForDelivery
string

The notes for delivery

notesForStaff
number

The notes for staff

notesForChef
string

The notes for chef

notesForOrder
string

The notes for order

Responses

Request samples

Content type
application/json
{
  • "platform": "web",
  • "id": "string",
  • "cart": [ ],
  • "requested_at": 0,
  • "order_type": "delivery",
  • "address": 0,
  • "store_id": 0,
  • "payment_method": "cash",
  • "voucher_id": 0,
  • "user_id": "string",
  • "directDiscountAmount": 0,
  • "directDiscountReason": "string",
  • "comment": 0,
  • "notesForDelivery": "string",
  • "notesForStaff": 0,
  • "notesForChef": "string",
  • "notesForOrder": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Update order

Update order Data

path Parameters
id
required
integer

The order id

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Request Body schema: application/json
status
string
Enum: "payment_pending" "paid" "payment_failed" "pending" "accepted" "cooking" "to_be_delivered" "picked_up_for_delivery" "left_the_shop" "delivered" "out_of_coverage" "double_order" "shop_closing" "bad_weather" "refunded" "refund" "canceled"

The order statuses

reason
string

Cancelled by store reason

store_id
string

The id of the store

estimated_at
string

The estimated time

delivered_at
string

The delivered time

object

Data from driver's app

Responses

Request samples

Content type
application/json
{
  • "status": "payment_pending",
  • "reason": "string",
  • "store_id": "string",
  • "estimated_at": "string",
  • "delivered_at": "string",
  • "delivery_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string"
}

Rate order

Add ratings to order

Request Body schema: application/json
order_id
required
number

The order id

rating
required
number
Enum: 0 1 2 3 4 5

The order ratings

note
string

The feedback note

Responses

Request samples

Content type
application/json
{
  • "order_id": 0,
  • "rating": 0,
  • "note": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get receipt

Get order receipt

path Parameters
id
required
integer

The order id

query Parameters
format
string
Default: "json"
Enum: "json" "pdf" "base64" "html"

You can receive a receipt in different formats

header Parameters
Authorization
required
string <Bearer>

Api token placed into the header to allow access to the api service Authorization Bearer auth_token

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Banners

Get banners

Get Banners

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Info pages

Get info pages

Get Info Pages

Request Body schema: application/json
platform
required
string
Enum: "web" "app"

Frontend platform

store_id
integer

The store id

Responses

Request samples

Content type
application/json
{
  • "platform": "web",
  • "store_id": 0
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": [
    ]
}

Vouchers

Get voucher

Get voucher by code

Request Body schema: application/json
platform
required
string
Enum: "web" "app"

Frontend platform

store_id
required
integer

The store id

auto_apply
required
integer
Enum: 0 1

1 means auto-apply while 0 means not

code
required
string

Voucher code

cart_total
float

The cart total

Responses

Request samples

Content type
application/json
{
  • "platform": "web",
  • "store_id": 0,
  • "auto_apply": 0,
  • "code": "string",
  • "cart_total": null
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get auto apply vouchers

Get all active vouchers only auto apply

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}

Get voucher terms

Get terms for active vouchers for specific store, only active and auto apply

Request Body schema: application/json
store_id
required
number

Store id

Responses

Request samples

Content type
application/json
{
  • "store_id": 0
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "string",
  • "data": {
    }
}