MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Endpoints

POST api/v1/devices/register

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/devices/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"partner_id\": 16,
    \"branch_id\": 16,
    \"device_type\": \"kiosk\",
    \"device_name\": \"n\"
}"
const url = new URL(
    "http://button_taxi.test/api/v1/devices/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "partner_id": 16,
    "branch_id": 16,
    "device_type": "kiosk",
    "device_name": "n"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/devices/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

partner_id   integer   

The id of an existing record in the partners table. Example: 16

branch_id   integer   

The id of an existing record in the branches table. Example: 16

device_type   string  optional  

Example: kiosk

Must be one of:
  • device
  • tablet
  • kiosk
  • mobile
device_name   string  optional  

Must not be greater than 255 characters. Example: n

Cancel an order POST /api/v1/orders/{id}/cancel

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/orders/architecto/cancel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reason\": \"b\"
}"
const url = new URL(
    "http://button_taxi.test/api/v1/orders/architecto/cancel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reason": "b"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/orders/{id}/cancel

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the order. Example: architecto

Body Parameters

reason   string  optional  

Must not be greater than 500 characters. Example: b

Complete an order POST /api/v1/orders/{id}/complete

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/orders/architecto/complete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/orders/architecto/complete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/orders/{id}/complete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the order. Example: architecto

Display the specified order GET /api/v1/orders/{id}

Example request:
curl --request GET \
    --get "http://button_taxi.test/api/v1/orders/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/orders/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "error": "Unauthenticated",
    "timestamp": "2025-07-04T06:56:25.593973Z"
}
 

Request      

GET api/v1/orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the order. Example: architecto

Store a newly created order POST /api/v1/orders

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"pickup_latitude\": -89,
    \"pickup_longitude\": -179,
    \"dropoff_latitude\": -90,
    \"dropoff_longitude\": -179,
    \"note\": \"m\",
    \"partner_order_id\": \"i\"
}"
const url = new URL(
    "http://button_taxi.test/api/v1/orders"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "pickup_latitude": -89,
    "pickup_longitude": -179,
    "dropoff_latitude": -90,
    "dropoff_longitude": -179,
    "note": "m",
    "partner_order_id": "i"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

pickup_latitude   number   

Must be between -90 and 90. Example: -89

pickup_longitude   number   

Must be between -180 and 180. Example: -179

dropoff_latitude   number  optional  

Must be between -90 and 90. Example: -90

dropoff_longitude   number  optional  

Must be between -180 and 180. Example: -179

note   string  optional  

Must not be greater than 500 characters. Example: m

partner_order_id   string   

Must not be greater than 255 characters. Example: i

GET api/v1/partner

Example request:
curl --request GET \
    --get "http://button_taxi.test/api/v1/partner" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/partner"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "error": "API key is required",
    "message": "Please provide an API key in the X-API-Key header or api_key query parameter"
}
 

Request      

GET api/v1/partner

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authenticate user and return token.

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"architecto\"
}"
const url = new URL(
    "http://button_taxi.test/api/v1/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "gbailey@example.net",
    "password": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Example: gbailey@example.net

password   string   

Example: architecto

Login by employee number (for device authentication).

Example request:
curl --request GET \
    --get "http://button_taxi.test/api/v1/auth/login/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/auth/login/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "error": "API key is required",
    "message": "Please provide an API key in the X-API-Key header or api_key query parameter"
}
 

Request      

GET api/v1/auth/login/{number}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

number   string   

Example: architecto

Get the authenticated User.

Example request:
curl --request GET \
    --get "http://button_taxi.test/api/v1/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "error": "Unauthenticated",
    "timestamp": "2025-07-04T06:56:29.618908Z"
}
 

Request      

GET api/v1/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Log the user out (Invalidate the token).

Example request:
curl --request POST \
    "http://button_taxi.test/api/v1/auth/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://button_taxi.test/api/v1/auth/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/auth/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json