MENU navbar-image

Introduction

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

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Endpoints

GET api/user

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/user" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/user"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/login

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/login" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"yritchie@example.org\",
    \"password\": \"a*K%91\"
}"
const url = new URL(
    "http://localhost/api/login"
);

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

let body = {
    "email": "yritchie@example.org",
    "password": "a*K%91"
};

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

Request      

POST api/login

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Example: yritchie@example.org

password   string   

Example: a*K%91

Destroy an authenticated session.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/logout" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/logout"
);

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

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

Request      

POST api/logout

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/brands Paginated list of brands.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/brands?all=1%2A&page=2&per_page=20&first_letter=A" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/brands"
);

const params = {
    "all": "1*",
    "page": "2",
    "per_page": "20",
    "first_letter": "A",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/brands

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

all   string  optional  

Get all brands. Example: 1*

page   integer  optional  

The page number. Defaults to 1. Example: 2

per_page   integer  optional  

The number of items per page. Defaults to 10. Example: 20

first_letter   string  optional  

The first letter of the brand. Example: A

Display the specified brand from slug.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/brands/slug/aksel-ketner" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/brands/slug/aksel-ketner"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/brands/slug/{brandSlug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

brandSlug   string   

The slug of the brand. Example: aksel-ketner

GET api/brands/{code} Display the specified brand by code.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/brands/AK" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/brands/AK"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/brands/{code}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

code   string   

The brand code. Example: AK

GET all cart items for the user or session.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/carts/error?currency_code=DKK" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/carts/error"
);

const params = {
    "currency_code": "DKK",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/carts/{sessionId?}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string  optional  

Example: error

Query Parameters

currency_code   string  optional  

The currency code to use for the cart items. Example: DKK

POST a new cart item.

requires authentication

It will be registered for the user if logged in, otherwise it will be registered for the session.

Example request:
curl --request POST \
    "http://localhost/api/carts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"part_id\": 19,
    \"quantity\": 7462047.7
}"
const url = new URL(
    "http://localhost/api/carts"
);

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

let body = {
    "part_id": 19,
    "quantity": 7462047.7
};

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

Request      

POST api/carts

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

part_id   integer   

The id of an existing record in the parts table. Example: 19

quantity   number   

Example: 7462047.7

PUT cart item.

requires authentication

It will be updated for the user if logged in, otherwise it will be updated for the session.

Example request:
curl --request PUT \
    "http://localhost/api/carts/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"part_id\": 16,
    \"quantity\": 150731250.5,
    \"session_id\": \"4a53b7f5-1945-32b3-8563-7f0b50f098b8\"
}"
const url = new URL(
    "http://localhost/api/carts/1"
);

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

let body = {
    "part_id": 16,
    "quantity": 150731250.5,
    "session_id": "4a53b7f5-1945-32b3-8563-7f0b50f098b8"
};

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

Request      

PUT api/carts/{cart_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

cart_id   integer   

The ID of the cart. Example: 1

Body Parameters

part_id   integer   

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

quantity   number   

Example: 150731250.5

session_id   string  optional  

Must be a valid UUID. Example: 4a53b7f5-1945-32b3-8563-7f0b50f098b8

DELETE cart item if the item belongs to the user.

requires authentication

Example request:
curl --request DELETE \
    "http://localhost/api/carts/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/carts/1"
);

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

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

Request      

DELETE api/carts/{cart_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

cart_id   integer   

The ID of the cart. Example: 1

Paginated list of countries.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/countries?page=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/countries"
);

const params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/countries

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page number. Example: 1

Display the specified country.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/countries/ae" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/countries/ae"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/countries/{country_code}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

country_code   string   

Example: ae

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/companies" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/companies"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/companies

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/companies/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/companies/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/companies/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/currencies" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/currencies"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/currencies

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET all inquiries for the authenticated user (customer) Filters by status[] (optional) and paginates.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/inquiries/1?sort_field=molestiae&sort_direction=omnis" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 15,
    \"status\": [
        \"pending\"
    ],
    \"archived\": false,
    \"sort_field\": \"created_at\",
    \"sort_direction\": \"desc\",
    \"page\": 17,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/api/inquiries/1"
);

const params = {
    "sort_field": "molestiae",
    "sort_direction": "omnis",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "user_id": 15,
    "status": [
        "pending"
    ],
    "archived": false,
    "sort_field": "created_at",
    "sort_direction": "desc",
    "page": 17,
    "per_page": 20
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/inquiries/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Query Parameters

sort_field   string  optional  

Optional. Sort by field. Supports: created_at, status, retailer_title. Example: molestiae

sort_direction   string  optional  

Optional. Sort direction: asc or desc. Default: asc. Example: omnis

Body Parameters

user_id   integer  optional  

Example: 15

status   string[]  optional  
Must be one of:
  • pending
  • completed
  • rejected
archived   boolean  optional  

Example: false

sort_field   string  optional  

Example: created_at

Must be one of:
  • created_at
  • status
  • retailer_title
sort_direction   string  optional  

Example: desc

Must be one of:
  • asc
  • desc
page   integer  optional  

Example: 17

per_page   integer  optional  

Example: 20

GET all inquiries and related inquiry_parts for all users of the current users company Filter by status and user

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/inquiries/retailer/1?retailer_id=40&status%5B%5D[]=voluptatem&archived=1&user_id=9843&sort_field=created_at&sort_direction=asc&page=1&per_page=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 19,
    \"status\": [
        \"pending\"
    ],
    \"archived\": false,
    \"sort_field\": \"retailer_title\",
    \"sort_direction\": \"asc\",
    \"page\": 10,
    \"per_page\": 16
}"
const url = new URL(
    "http://localhost/api/inquiries/retailer/1"
);

const params = {
    "retailer_id": "40",
    "status[][0]": "voluptatem",
    "archived": "1",
    "user_id": "9843",
    "sort_field": "created_at",
    "sort_direction": "asc",
    "page": "1",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "user_id": 19,
    "status": [
        "pending"
    ],
    "archived": false,
    "sort_field": "retailer_title",
    "sort_direction": "asc",
    "page": 10,
    "per_page": 16
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/inquiries/retailer/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Query Parameters

retailer_id   string  optional  

Filter by company. Example: 40

status[]   string[]  optional  

Filter by status. Provide as repeated query params (status[]=pending&status[]=completed). Allowed values: pending, completed, rejected.

archived   boolean  optional  

Optional. Filter by archived flag. Use archived=true to return only archived inquiries, archived=false for only non-archived. If omitted, returns all. Example: true

user_id   string  optional  

Filter by user. Example: 9843

sort_field   string  optional  

The field to sort by. Valid values are: created_at. Example: created_at

sort_direction   string  optional  

The direction to sort by. Example: asc

page   integer  optional  

The page number. Example: 1

per_page   integer  optional  

The number of items per page. Example: 10

Body Parameters

user_id   integer  optional  

Example: 19

status   string[]  optional  
Must be one of:
  • pending
  • completed
  • rejected
archived   boolean  optional  

Example: false

sort_field   string  optional  

Example: retailer_title

Must be one of:
  • created_at
  • status
  • retailer_title
sort_direction   string  optional  

Example: asc

Must be one of:
  • asc
  • desc
page   integer  optional  

Example: 10

per_page   integer  optional  

Example: 16

POST Inquiry

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/inquiries?retailer_id=40&from_company_id=928&from_email=johndoe%40example.com&from_name=John+Doe&to_email=janedoe%40example.com&to_name=Jane+Doe&subject=Inquiry+about+parts&currency_code=DKK&generated_message=Part+number%3A+12345%2C+Quantity%3A+10&user_message=Hi.+How+much+is+shipping+to+Denmark+for+these+parts%3F&send_copy_to_email=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"retailer_id\": 42,
    \"from_company_id\": 7,
    \"from_email\": \"alice@example.com\",
    \"from_name\": \"Alice Sender\",
    \"to_email\": \"bob@retailer.com\",
    \"to_name\": \"Bob Retailer\",
    \"subject\": \"Request for quote\",
    \"currency_code\": \"USD\",
    \"generated_message\": \"Hello, I would like to request a quote for the following parts…\",
    \"user_message\": \"Please prioritize delivery by next week if possible.\",
    \"send_copy_to_email\": false,
    \"parts\": [
        {
            \"part_id\": 1001,
            \"quantity\": 2,
            \"price\": 49.95
        },
        {
            \"part_id\": 1002,
            \"quantity\": 5,
            \"price\": 19.5
        }
    ]
}"
const url = new URL(
    "http://localhost/api/inquiries"
);

const params = {
    "retailer_id": "40",
    "from_company_id": "928",
    "from_email": "johndoe@example.com",
    "from_name": "John Doe",
    "to_email": "janedoe@example.com",
    "to_name": "Jane Doe",
    "subject": "Inquiry about parts",
    "currency_code": "DKK",
    "generated_message": "Part number: 12345, Quantity: 10",
    "user_message": "Hi. How much is shipping to Denmark for these parts?",
    "send_copy_to_email": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "retailer_id": 42,
    "from_company_id": 7,
    "from_email": "alice@example.com",
    "from_name": "Alice Sender",
    "to_email": "bob@retailer.com",
    "to_name": "Bob Retailer",
    "subject": "Request for quote",
    "currency_code": "USD",
    "generated_message": "Hello, I would like to request a quote for the following parts…",
    "user_message": "Please prioritize delivery by next week if possible.",
    "send_copy_to_email": false,
    "parts": [
        {
            "part_id": 1001,
            "quantity": 2,
            "price": 49.95
        },
        {
            "part_id": 1002,
            "quantity": 5,
            "price": 19.5
        }
    ]
};

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

Request      

POST api/inquiries

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

retailer_id   string  optional  

The company id of the retailer. Example: 40

from_company_id   string  optional  

The company id of the company that the inquiry is sent from. The user has to be related to that company Example: 928

from_email   string  optional  

The email of the sender. Example: johndoe@example.com

from_name   string  optional  

The name of the sender. Example: John Doe

to_email   string  optional  

The email of the recipient. Example: janedoe@example.com

to_name   string  optional  

The name of the recipient. Example: Jane Doe

subject   string  optional  

The subject of the inquiry. Example: Inquiry about parts

currency_code   string  optional  

The currency code. Example: DKK

generated_message   string  optional  

The generated message. Example: Part number: 12345, Quantity: 10

user_message   string  optional  

The user message. Example: Hi. How much is shipping to Denmark for these parts?

send_copy_to_email   boolean  optional  

Send a copy of the inquiry to the sender. Example: true

Body Parameters

retailer_id   integer   

Retailer identifier the inquiry is addressed to. Example: 42

from_company_id   integer   

Company ID of the sender. Must be a company the authenticated user belongs to. Example: 7

from_email   string   

Sender's email address. Must be a valid email address. Example: alice@example.com

from_name   string   

Sender's display name. Example: Alice Sender

to_email   string   

Receiver's email address. Must be a valid email address. Example: bob@retailer.com

to_name   string   

Receiver's display name. Example: Bob Retailer

subject   string   

Subject of the email/inquiry. Example: Request for quote

currency_code   string   

ISO 4217 currency code used for prices in this inquiry. Example: USD

generated_message   string   

System-generated message body (eg. template output). Example: Hello, I would like to request a quote for the following parts…

user_message   string   

Additional message content provided by the user. Example: Please prioritize delivery by next week if possible.

send_copy_to_email   boolean  optional  

Whether to send a copy of the inquiry to the sender email. Example: false

parts   object[]   

Line items included in the inquiry.

part_id   integer   

ID of the requested part. Example: 1234

quantity   integer   

Requested quantity for the part. Example: 3

price   number   

Unit price for the part in the specified currency. Example: 12.99

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/inquiries/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"archived\": true,
    \"status\": \"pending\",
    \"user_message\": \"esse\"
}"
const url = new URL(
    "http://localhost/api/inquiries/1"
);

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

let body = {
    "archived": true,
    "status": "pending",
    "user_message": "esse"
};

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

Request      

PUT api/inquiries/{inquiry_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

inquiry_id   integer   

The ID of the inquiry. Example: 1

Body Parameters

archived   boolean  optional  

Example: true

status   string  optional  

Example: pending

Must be one of:
  • pending
  • completed
  • rejected
user_message   string  optional  

Example: esse

Paginated list of parts.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/parts?retailer_id=7&brand_code=cl&brand_slug=claas&country_code=dk&sort_field=manufacturer_part_number&sort_direction=asc&no_of_items=10&page=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/parts"
);

const params = {
    "retailer_id": "7",
    "brand_code": "cl",
    "brand_slug": "claas",
    "country_code": "dk",
    "sort_field": "manufacturer_part_number",
    "sort_direction": "asc",
    "no_of_items": "10",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/parts

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

retailer_id   integer  optional  

The ID of the retailer/company. Example: 7

brand_code   string  optional  

The code of the brand. Example: cl

brand_slug   string  optional  

The slug of the brand. Example: claas

country_code   string  optional  

The country code. Example: dk

sort_field   string  optional  

The field to sort by. Valid values are: manufacturer_part_number, name and inventory. Example: manufacturer_part_number

sort_direction   string  optional  

The direction to sort by. Example: asc

no_of_items   integer  optional  

The number of items per page. Example: 10

page   integer  optional  

The page number. Example: 1

Display the specified parts.

requires authentication

Include parts that match the manufacturer_part_number Include parts that do not have a manufacturer_part_number but match the part_number

Example request:
curl --request GET \
    --get "http://localhost/api/parts/minima?sort_field=price&sort_direction=asc" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_field\": \"part_number\",
    \"sort_direction\": \"asc\"
}"
const url = new URL(
    "http://localhost/api/parts/minima"
);

const params = {
    "sort_field": "price",
    "sort_direction": "asc",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "sort_field": "part_number",
    "sort_direction": "asc"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/parts/{partNumber}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

partNumber   string   

Example: minima

part   string   

The ID of the part. Example: 1

Query Parameters

sort_field   string  optional  

The field to sort by. Valid values are: part_number, price and inventory. Example: price

sort_direction   string  optional  

The direction to sort by. Example: asc

Body Parameters

sort_field   string  optional  

Example: part_number

Must be one of:
  • manufacturer_part_number
  • part_number
  • price
  • name
  • brand
  • inventory
sort_direction   string  optional  

Example: asc

Must be one of:
  • asc
  • desc

Display a listing of parts matching the search query and filters.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/parts/search/error?brand_slug=john-deere&country_code=DK&sort_field=part_number&sort_direction=asc&page=1&per_page=10&currency_code=EUR" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"searchQuery\": \"uiffsspwrrjefg\",
    \"brandSlug\": \"quegrvwmoo\",
    \"page\": 57,
    \"sort_field\": \"part_number\",
    \"sort_direction\": \"desc\",
    \"country_code\": \"ns\",
    \"currency_code\": \"joo\"
}"
const url = new URL(
    "http://localhost/api/parts/search/error"
);

const params = {
    "brand_slug": "john-deere",
    "country_code": "DK",
    "sort_field": "part_number",
    "sort_direction": "asc",
    "page": "1",
    "per_page": "10",
    "currency_code": "EUR",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "searchQuery": "uiffsspwrrjefg",
    "brandSlug": "quegrvwmoo",
    "page": 57,
    "sort_field": "part_number",
    "sort_direction": "desc",
    "country_code": "ns",
    "currency_code": "joo"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/parts/search/{searchQuery}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

searchQuery   string   

Example: error

Query Parameters

brand_slug   string  optional  

The brand slug to filter parts by. Example: john-deere

country_code   string  optional  

The country code to filter parts by. Example: DK

sort_field   string  optional  

The field to sort by. Example: part_number

sort_direction   string  optional  

The direction to sort by. Example: asc

page   integer  optional  

The page number to display. Example: 1

per_page   integer  optional  

The number of items to display per page. Example: 10

currency_code   string  optional  

The currency code to filter parts by. Example: EUR

Body Parameters

searchQuery   string  optional  

Must be at least 1 character. Must not be greater than 100 characters. Example: uiffsspwrrjefg

brandSlug   string  optional  

The title_slug of an existing record in the brands table. Must not be greater than 255 characters. Example: quegrvwmoo

page   integer  optional  

Must be at least 1. Example: 57

sort_field   string  optional  

Example: part_number

Must be one of:
  • part_number
  • manufacturer_part_number
  • name
  • brand
  • inventory
sort_direction   string  optional  

Example: desc

Must be one of:
  • asc
  • desc
country_code   string  optional  

The code of an existing record in the countries table. Must be 2 characters. Example: ns

currency_code   string   

The code of an existing record in the currencies table. Must be 3 characters. Example: joo

Display a listing of parts with the specified brand_slug filtered by optional search query.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/parts/brand/search/doloremque/tempora?country_code=DK&sort_field=part_number&sort_direction=asc&page=1&per_page=10&currency_code=EUR" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"searchQuery\": \"s\",
    \"brandSlug\": \"iasxuouesdahdpyxeex\",
    \"page\": 76,
    \"sort_field\": \"inventory\",
    \"sort_direction\": \"asc\",
    \"country_code\": \"fe\",
    \"currency_code\": \"row\"
}"
const url = new URL(
    "http://localhost/api/parts/brand/search/doloremque/tempora"
);

const params = {
    "country_code": "DK",
    "sort_field": "part_number",
    "sort_direction": "asc",
    "page": "1",
    "per_page": "10",
    "currency_code": "EUR",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "searchQuery": "s",
    "brandSlug": "iasxuouesdahdpyxeex",
    "page": 76,
    "sort_field": "inventory",
    "sort_direction": "asc",
    "country_code": "fe",
    "currency_code": "row"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/parts/brand/search/{brandSlug}/{searchQuery}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

brandSlug   string   

Example: doloremque

searchQuery   string   

Example: tempora

Query Parameters

country_code   string  optional  

The country code to filter parts by. Example: DK

sort_field   string  optional  

The field to sort by. Example: part_number

sort_direction   string  optional  

The direction to sort by. Example: asc

page   integer  optional  

The page number to display. Example: 1

per_page   integer  optional  

The number of items to display per page. Example: 10

currency_code   string  optional  

The currency code to filter parts by. Example: EUR

Body Parameters

searchQuery   string  optional  

Must be at least 1 character. Must not be greater than 100 characters. Example: s

brandSlug   string  optional  

The title_slug of an existing record in the brands table. Must not be greater than 255 characters. Example: iasxuouesdahdpyxeex

page   integer  optional  

Must be at least 1. Example: 76

sort_field   string  optional  

Example: inventory

Must be one of:
  • part_number
  • manufacturer_part_number
  • name
  • brand
  • inventory
sort_direction   string  optional  

Example: asc

Must be one of:
  • asc
  • desc
country_code   string  optional  

The code of an existing record in the countries table. Must be 2 characters. Example: fe

currency_code   string   

The code of an existing record in the currencies table. Must be 3 characters. Example: row

Display a listing of parts with the specified brand_slug filtered by optional search query.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/parts/brand/search/nisi?country_code=DK&sort_field=part_number&sort_direction=asc&page=1&per_page=10&currency_code=EUR" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"searchQuery\": \"mddfwptklgetpowhrnur\",
    \"brandSlug\": \"joywnkssclbwbgl\",
    \"page\": 42,
    \"sort_field\": \"brand\",
    \"sort_direction\": \"desc\",
    \"country_code\": \"gc\",
    \"currency_code\": \"xhc\"
}"
const url = new URL(
    "http://localhost/api/parts/brand/search/nisi"
);

const params = {
    "country_code": "DK",
    "sort_field": "part_number",
    "sort_direction": "asc",
    "page": "1",
    "per_page": "10",
    "currency_code": "EUR",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "searchQuery": "mddfwptklgetpowhrnur",
    "brandSlug": "joywnkssclbwbgl",
    "page": 42,
    "sort_field": "brand",
    "sort_direction": "desc",
    "country_code": "gc",
    "currency_code": "xhc"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/parts/brand/search/{brandSlug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

brandSlug   string   

Example: nisi

Query Parameters

country_code   string  optional  

The country code to filter parts by. Example: DK

sort_field   string  optional  

The field to sort by. Example: part_number

sort_direction   string  optional  

The direction to sort by. Example: asc

page   integer  optional  

The page number to display. Example: 1

per_page   integer  optional  

The number of items to display per page. Example: 10

currency_code   string  optional  

The currency code to filter parts by. Example: EUR

Body Parameters

searchQuery   string  optional  

Must be at least 1 character. Must not be greater than 100 characters. Example: mddfwptklgetpowhrnur

brandSlug   string  optional  

The title_slug of an existing record in the brands table. Must not be greater than 255 characters. Example: joywnkssclbwbgl

page   integer  optional  

Must be at least 1. Example: 42

sort_field   string  optional  

Example: brand

Must be one of:
  • part_number
  • manufacturer_part_number
  • name
  • brand
  • inventory
sort_direction   string  optional  

Example: desc

Must be one of:
  • asc
  • desc
country_code   string  optional  

The code of an existing record in the countries table. Must be 2 characters. Example: gc

currency_code   string   

The code of an existing record in the currencies table. Must be 3 characters. Example: xhc

GET retailers (Company model) by geolocation.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/retailer" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/retailer"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/retailer

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/events/callback

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/events/callback" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/events/callback"
);

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

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

Request      

POST api/events/callback

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/events/{topic}

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/events/sed" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/events/sed"
);

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

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

Request      

POST api/events/{topic}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

topic   string   

Example: sed

Create an Admin user (role_id = 1).

requires authentication

Only admins may create admin users.

Example request:
curl --request POST \
    "http://localhost/api/users/admin" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/admin"
);

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

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

Request      

POST api/users/admin

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Paginated list of users. Only allowed for admin users.

requires authentication

Search across name, email, and related company name.

Example request:
curl --request GET \
    --get "http://localhost/api/users?sort_field=name&sort_direction=asc&no_of_items=10&page=1&query=aage" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users"
);

const params = {
    "sort_field": "name",
    "sort_direction": "asc",
    "no_of_items": "10",
    "page": "1",
    "query": "aage",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/users

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

sort_field   string  optional  

The field to sort by. Valid values are: name, email, role_id and status. Example: name

sort_direction   string  optional  

The direction to sort by. Example: asc

no_of_items   integer  optional  

The number of items per page. Example: 10

page   integer  optional  

The page number. Example: 1

query   string  optional  

Search across name, email, and related company name. Example: aage

Paginated list of users related to a specific company. Only allowed for admin users or users connected to the company.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/users/company/1?sort_field=name&sort_direction=asc&no_of_items=10&page=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/company/1"
);

const params = {
    "sort_field": "name",
    "sort_direction": "asc",
    "no_of_items": "10",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/users/company/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Query Parameters

sort_field   string  optional  

The field to sort by. Valid values are: name, email, role_id and status. Example: name

sort_direction   string  optional  

The direction to sort by. Example: asc

no_of_items   integer  optional  

The number of items per page. Example: 10

page   integer  optional  

The page number. Example: 1

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/users/41" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"qrmawrnuj\",
    \"email\": \"ltillman@example.com\",
    \"password\": \"\\\\\\\\k\\/d1mnI&\",
    \"role_id\": \"1\",
    \"selected_company_id\": 3,
    \"status\": \"pending\",
    \"language_code\": \"wd\",
    \"get_part_requests\": true
}"
const url = new URL(
    "http://localhost/api/users/41"
);

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

let body = {
    "name": "qrmawrnuj",
    "email": "ltillman@example.com",
    "password": "\\\\k\/d1mnI&",
    "role_id": "1",
    "selected_company_id": 3,
    "status": "pending",
    "language_code": "wd",
    "get_part_requests": true
};

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

Request      

PUT api/users/{user_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user_id   integer   

The ID of the user. Example: 41

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: qrmawrnuj

email   string  optional  

Must be a valid email address. Must not be greater than 255 characters. Example: ltillman@example.com

password   string  optional  

Must be at least 8 characters. Example: \\k/d1mnI&

role_id   integer  optional  

Example: 1

Must be one of:
  • 1
  • 2
  • 3
selected_company_id   integer  optional  

The id of an existing record in the companies table. Example: 3

status   string  optional  

Example: pending

Must be one of:
  • pending
  • active
language_code   string  optional  

Must be 2 characters. Example: wd

get_part_requests   boolean  optional  

Example: true

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/users/41" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/41"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "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
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/users/{user_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user_id   integer   

The ID of the user. Example: 41

Allow an admin to switch/impersonate an existing Retailer or Customer user.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/users/switch/41" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/switch/41"
);

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

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

Request      

POST api/users/switch/{user_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user_id   integer   

The ID of the user. Example: 41

Create a Retailer user (role_id = 2) and its required company.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/users/retailer" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/retailer"
);

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

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

Request      

POST api/users/retailer

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a Customer user (role_id = 3). Company is optional.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/users/customer" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/customer"
);

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

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

Request      

POST api/users/customer

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/events/test

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/events/test" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/events/test"
);

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

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

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

This is a test
 

Request      

GET api/events/test

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json