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\": \"ymohr@example.net\",
    \"password\": \"Yrwv;Uc+\"
}"
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": "ymohr@example.net",
    "password": "Yrwv;Uc+"
};

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: ymohr@example.net

password   string   

Example: Yrwv;Uc+

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

Send a reset link to the given user and respond with JSON.

requires authentication

Fortify's own PasswordResetLinkController returns a session-based redirect/view response, which this stateless API can't use.

Always responds with the same generic message regardless of whether the email is registered, to avoid leaking account existence.

Example request:
curl --request POST \
    "http://localhost/api/forgot-password" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"sherwood17@example.net\"
}"
const url = new URL(
    "http://localhost/api/forgot-password"
);

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

let body = {
    "email": "sherwood17@example.net"
};

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

Request      

POST api/forgot-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

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

Reset the user's password and respond with JSON.

requires authentication

Fortify's own NewPasswordController returns a session-based redirect/view response, which this stateless API can't use.

Example request:
curl --request POST \
    "http://localhost/api/reset-password" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"voluptatum\",
    \"email\": \"haylee.boehm@example.org\",
    \"password\": \"quos\"
}"
const url = new URL(
    "http://localhost/api/reset-password"
);

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

let body = {
    "token": "voluptatum",
    "email": "haylee.boehm@example.org",
    "password": "quos"
};

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

Request      

POST api/reset-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

token   string   

Example: voluptatum

email   string   

Must be a valid email address. Example: haylee.boehm@example.org

password   string   

Example: quos

Search dealers by title with optional country_code filter and sorting.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/dealers/search/cumque?country_code=dk&sort_field=title&sort_direction=asc&per_page=20&page=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"searchQuery\": \"qltcarobfjtqek\",
    \"sort_field\": \"country_code\",
    \"sort_direction\": \"asc\",
    \"country_code\": \"dy\",
    \"page\": 25,
    \"per_page\": 24
}"
const url = new URL(
    "http://localhost/api/dealers/search/cumque"
);

const params = {
    "country_code": "dk",
    "sort_field": "title",
    "sort_direction": "asc",
    "per_page": "20",
    "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",
};

let body = {
    "searchQuery": "qltcarobfjtqek",
    "sort_field": "country_code",
    "sort_direction": "asc",
    "country_code": "dy",
    "page": 25,
    "per_page": 24
};

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

Example response (422):

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

{
    "message": "The selected country code is invalid.",
    "errors": {
        "country_code": [
            "The selected country code is invalid."
        ]
    }
}
 

Request      

GET api/dealers/search/{searchQuery?}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

searchQuery   string  optional  

Example: cumque

Query Parameters

country_code   string  optional  

Filter by country code. Example: dk

sort_field   string  optional  

The field to sort by. Valid values: title, country_code. Example: title

sort_direction   string  optional  

The direction to sort by. Example: asc

per_page   integer  optional  

The number of items per page. Example: 20

page   integer  optional  

The page number. Example: 1

Body Parameters

searchQuery   string  optional  

Must not be greater than 100 characters. Example: qltcarobfjtqek

sort_field   string  optional  

Example: country_code

Must be one of:
  • title
  • country_code
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: dy

page   integer  optional  

Must be at least 1. Example: 25

per_page   integer  optional  

Must be at least 1. Must not be greater than 100. Example: 24

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. 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/aut?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/aut"
);

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: aut

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\": 1,
    \"quantity\": 2306896.7381714
}"
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": 1,
    "quantity": 2306896.7381714
};

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: 1

quantity   number   

Example: 2306896.7381714

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/14" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"part_id\": 14,
    \"quantity\": 24470330.84102246,
    \"session_id\": \"ee17137f-7ec7-3e83-a96f-a160895e05e5\"
}"
const url = new URL(
    "http://localhost/api/carts/14"
);

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

let body = {
    "part_id": 14,
    "quantity": 24470330.84102246,
    "session_id": "ee17137f-7ec7-3e83-a96f-a160895e05e5"
};

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: 14

Body Parameters

part_id   integer   

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

quantity   number   

Example: 24470330.841022

session_id   string  optional  

Must be a valid UUID. Example: ee17137f-7ec7-3e83-a96f-a160895e05e5

DELETE cart item if the item belongs to the user.

requires authentication

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

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: 17

Paginated list of countries.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/countries?page=1&per_page=20" \
    --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",
    "per_page": "20",
};
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

per_page   integer  optional  

The number of items per page. Example: 20

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/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

Issue a signed JWT for the authenticated user, for use by the data import app.

requires authentication

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

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/data-import/token

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET all inquiries made to the dealer company Filter by status and archived flag

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/inquiries/dealer/1?dealer_id=40&status%5B%5D[]=quidem&archived=1&sort_field=created_at&sort_direction=asc&page=1&per_page=20" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 18,
    \"status\": [
        \"pending\"
    ],
    \"archived\": \"true\",
    \"sort_field\": \"dealer_title\",
    \"sort_direction\": \"asc\",
    \"page\": 12,
    \"per_page\": 13
}"
const url = new URL(
    "http://localhost/api/inquiries/dealer/1"
);

const params = {
    "dealer_id": "40",
    "status[][0]": "quidem",
    "archived": "1",
    "sort_field": "created_at",
    "sort_direction": "asc",
    "page": "1",
    "per_page": "20",
};
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": 18,
    "status": [
        "pending"
    ],
    "archived": "true",
    "sort_field": "dealer_title",
    "sort_direction": "asc",
    "page": 12,
    "per_page": 13
};

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/dealer/{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

dealer_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

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: 20

Body Parameters

user_id   integer  optional  

Example: 18

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

Example: true

Must be one of:
  • 0
  • 1
  • true
  • false
sort_field   string  optional  

Example: dealer_title

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

Example: asc

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

Example: 12

per_page   integer  optional  

Example: 13

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=iure&sort_direction=tenetur" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 16,
    \"status\": [
        \"rejected\"
    ],
    \"archived\": \"true\",
    \"sort_field\": \"status\",
    \"sort_direction\": \"asc\",
    \"page\": 7,
    \"per_page\": 11
}"
const url = new URL(
    "http://localhost/api/inquiries/1"
);

const params = {
    "sort_field": "iure",
    "sort_direction": "tenetur",
};
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": 16,
    "status": [
        "rejected"
    ],
    "archived": "true",
    "sort_field": "status",
    "sort_direction": "asc",
    "page": 7,
    "per_page": 11
};

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/{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: 1

Query Parameters

sort_field   string  optional  

Optional. Sort by field. Supports: created_at, status, dealer_title. Example: iure

sort_direction   string  optional  

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

Body Parameters

user_id   integer  optional  

Example: 16

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

Example: true

Must be one of:
  • 0
  • 1
  • true
  • false
sort_field   string  optional  

Example: status

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

Example: asc

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

Example: 7

per_page   integer  optional  

Example: 11

POST Inquiry

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/inquiries?dealer_id=40&from_company_id=928&from_name=John+Doe&customer_id=12&currency_code_customer=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 "{
    \"dealer_id\": 42,
    \"from_company_id\": 7,
    \"from_name\": \"Alice Sender\",
    \"customer_id\": 12,
    \"currency_code_customer\": \"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
        }
    ],
    \"address\": {
        \"address1\": \"Main Street 1\",
        \"address2\": \"Suite 2\",
        \"city\": \"Aarhus\",
        \"postal_code\": \"8000\",
        \"country_code\": \"dk\",
        \"phone_number\": \"+4512345678\"
    }
}"
const url = new URL(
    "http://localhost/api/inquiries"
);

const params = {
    "dealer_id": "40",
    "from_company_id": "928",
    "from_name": "John Doe",
    "customer_id": "12",
    "currency_code_customer": "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 = {
    "dealer_id": 42,
    "from_company_id": 7,
    "from_name": "Alice Sender",
    "customer_id": 12,
    "currency_code_customer": "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
        }
    ],
    "address": {
        "address1": "Main Street 1",
        "address2": "Suite 2",
        "city": "Aarhus",
        "postal_code": "8000",
        "country_code": "dk",
        "phone_number": "+4512345678"
    }
};

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

dealer_id   string  optional  

The company id of the dealer. 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_name   string  optional  

The name of the sender. Example: John Doe

customer_id   integer  optional  

The authenticated user placing the inquiry. Must match the current account. Example: 12

currency_code_customer   string  optional  

The currency the customer selected. 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

address   object  optional  

Custom shipping address for this inquiry.

Body Parameters

dealer_id   integer   

Dealer identifier the inquiry is addressed to. The id of an existing record in the companies table. Example: 42

from_company_id   integer  optional  

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

from_name   string   

Sender's display name. Can differ from the authenticated account, e.g. if the inquiry should be addressed to a specific contact person. Example: Alice Sender

customer_id   integer   

The authenticated user placing the inquiry. Must match the current account. The id of an existing record in the users table. Example: 12

Must be one of:
currency_code_customer   string   

ISO 4217 currency code the customer selected while browsing/making the inquiry. Must be 3 characters. 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

address   object   

Custom shipping address for this inquiry.

address1   string   

Street address. Example: Main Street 1

address2   string  optional  

Additional address line. Example: Suite 2

city   string   

City. Must not be greater than 50 characters. Example: Aarhus

postal_code   string   

Postal code. Must not be greater than 15 characters. Example: 8000

country_code   string   

ISO 3166-1 alpha-2 country code. The code of an existing record in the countries table. Must be 2 characters. Example: dk

phone_number   string  optional  

Contact phone number for the shipping address. Must not be greater than 30 characters. Example: +4512345678

Update the specified resource in storage.

requires authentication

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

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

let body = {
    "archived": false,
    "status": "rejected",
    "user_message": "accusantium"
};

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   string   

The ID of the inquiry. Example: tenetur

Body Parameters

archived   boolean  optional  

Example: false

status   string  optional  

Example: rejected

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

Example: accusantium

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

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/parts/search/fuga?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\": \"pyykjzskxovghzwjcnjzwkkg\",
    \"brandSlug\": \"zllgfrgbuqu\",
    \"page\": 57,
    \"dealer_id\": 65,
    \"sort_field\": \"dealer\",
    \"sort_direction\": \"asc\",
    \"country_code\": \"nv\",
    \"currency_code\": \"tgy\"
}"
const url = new URL(
    "http://localhost/api/parts/search/fuga"
);

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": "pyykjzskxovghzwjcnjzwkkg",
    "brandSlug": "zllgfrgbuqu",
    "page": 57,
    "dealer_id": 65,
    "sort_field": "dealer",
    "sort_direction": "asc",
    "country_code": "nv",
    "currency_code": "tgy"
};

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  optional  

Example: fuga

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: pyykjzskxovghzwjcnjzwkkg

brandSlug   string  optional  

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

page   integer  optional  

Must be at least 1. Example: 57

dealer_id   integer  optional  

Must be at least 1. Example: 65

sort_field   string  optional  

Example: dealer

Must be one of:
  • part_number
  • manufacturer_part_number
  • name
  • brand
  • dealer
  • inventory
  • price
  • price_discount
  • brand_title
  • description1
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: nv

currency_code   string   

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

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/tenetur/voluptas?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\": \"csyqevffsrtlvgfwbvftkzik\",
    \"brandSlug\": \"quouzhmyngpzj\",
    \"page\": 89,
    \"dealer_id\": 71,
    \"sort_field\": \"description1\",
    \"sort_direction\": \"asc\",
    \"country_code\": \"kl\",
    \"currency_code\": \"gqx\"
}"
const url = new URL(
    "http://localhost/api/parts/brand/search/tenetur/voluptas"
);

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": "csyqevffsrtlvgfwbvftkzik",
    "brandSlug": "quouzhmyngpzj",
    "page": 89,
    "dealer_id": 71,
    "sort_field": "description1",
    "sort_direction": "asc",
    "country_code": "kl",
    "currency_code": "gqx"
};

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: tenetur

searchQuery   string  optional  

Example: voluptas

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: csyqevffsrtlvgfwbvftkzik

brandSlug   string  optional  

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

page   integer  optional  

Must be at least 1. Example: 89

dealer_id   integer  optional  

Must be at least 1. Example: 71

sort_field   string  optional  

Example: description1

Must be one of:
  • part_number
  • manufacturer_part_number
  • name
  • brand
  • dealer
  • inventory
  • price
  • price_discount
  • brand_title
  • description1
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: kl

currency_code   string   

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

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/?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\": \"desc\"
}"
const url = new URL(
    "http://localhost/api/parts/"
);

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": "desc"
};

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

Example response (404):

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

{
    "message": "The route api/parts could not be found."
}
 

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   
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
  • dealer
  • inventory
sort_direction   string  optional  

Example: desc

Must be one of:
  • asc
  • desc

GET api/general-statistics — Return the most recent statistics snapshot.

requires authentication

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

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/general-statistics

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

GET dealers with optional sorting and pagination.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/dealers?sort_field=title&sort_direction=asc&country_code=dk&per_page=20&page=1&extend=address&has_parts=1&sales_target=All&has_sales_target=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_field\": \"title\",
    \"sort_direction\": \"asc\",
    \"country_code\": \"va\",
    \"page\": 73,
    \"per_page\": 16,
    \"extend\": \"address\",
    \"has_parts\": true,
    \"sales_target\": \"All\",
    \"has_sales_target\": false
}"
const url = new URL(
    "http://localhost/api/dealers"
);

const params = {
    "sort_field": "title",
    "sort_direction": "asc",
    "country_code": "dk",
    "per_page": "20",
    "page": "1",
    "extend": "address",
    "has_parts": "1",
    "sales_target": "All",
    "has_sales_target": "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 = {
    "sort_field": "title",
    "sort_direction": "asc",
    "country_code": "va",
    "page": 73,
    "per_page": 16,
    "extend": "address",
    "has_parts": true,
    "sales_target": "All",
    "has_sales_target": false
};

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/dealers

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

sort_field   string  optional  

Sort by field. Valid values: title, country_code, nearest, random. random renders a shuffled dealer list that stays stable within the cache window (DEALERS_RANDOM_LIST_CACHE_SECONDS, default 300) and changes afterwards. Defaults to title. Example: title

sort_direction   string  optional  

Sort direction. Valid values: asc, desc. Example: asc

country_code   string  optional  

Filter by country code. Example: dk

per_page   integer  optional  

Number of items per page. Example: 20

page   integer  optional  

Page number. Example: 1

extend   string  optional  

Include additional data. Valid values: address. Example: address

has_parts   boolean  optional  

Only include dealers that have parts. Maintained with app/Observers/PartObserver.php observer Example: true

sales_target   string  optional  

Filter by sales target. Valid values: Dealers, All, None. Example: All

has_sales_target   boolean  optional  

Only include dealers whose sales target is All or Dealers (excludes None and no sales target). Example: true

Body Parameters

sort_field   string  optional  

Example: title

Must be one of:
  • title
  • country_code
  • nearest
  • random
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: va

page   integer  optional  

Must be at least 1. Example: 73

per_page   integer  optional  

Must be at least 1. Must not be greater than 100. Example: 16

extend   string  optional  

Example: address

Must be one of:
  • address
has_parts   boolean  optional  

Example: true

sales_target   string  optional  

Example: All

Must be one of:
  • Dealers
  • All
  • None
has_sales_target   boolean  optional  

Example: false

GET api/dealer-information

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/dealer-information" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"updated_since\": \"2026-10-13T14:20:32\"
}"
const url = new URL(
    "http://localhost/api/dealer-information"
);

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

let body = {
    "updated_since": "2026-10-13T14:20:32"
};

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/dealer-information

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

updated_since   string  optional  

Must be a valid date. Example: 2026-10-13T14:20:32

A single dealer, same field shape as the listing (Azure DevOps #58591).

requires authentication

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

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/dealer-information/{company}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company   integer   

The dealer's company id. Example: 999

GET a single dealer by slug.

requires authentication

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

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/dealers/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the dealer. Example: alpha-tractors

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/in" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/events/in"
);

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: in

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

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/companies/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"yguwbtaqcsedr\",
    \"company_type_id\": 14,
    \"country_code\": \"aw\",
    \"vat_number\": \"vfzyjdpf\",
    \"currency_code\": \"xlr\",
    \"sales_target\": \"All\",
    \"website\": \"hiutkrqqr\",
    \"restricted_sell\": false,
    \"address\": {
        \"address1\": \"eaque\",
        \"address2\": \"impedit\",
        \"city\": \"mpxucykrimsopeagt\",
        \"postal_code\": \"rnqpkrmandhj\",
        \"phone_number\": \"unnpuijb\",
        \"company_email\": \"turner.carmen@example.org\",
        \"country_code\": \"gb\"
    }
}"
const url = new URL(
    "http://localhost/api/companies/1"
);

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

let body = {
    "title": "yguwbtaqcsedr",
    "company_type_id": 14,
    "country_code": "aw",
    "vat_number": "vfzyjdpf",
    "currency_code": "xlr",
    "sales_target": "All",
    "website": "hiutkrqqr",
    "restricted_sell": false,
    "address": {
        "address1": "eaque",
        "address2": "impedit",
        "city": "mpxucykrimsopeagt",
        "postal_code": "rnqpkrmandhj",
        "phone_number": "unnpuijb",
        "company_email": "turner.carmen@example.org",
        "country_code": "gb"
    }
};

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

Request      

PUT 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

Body Parameters

title   string  optional  

Must not be greater than 150 characters. Example: yguwbtaqcsedr

company_type_id   integer  optional  

Example: 14

country_code   string  optional  

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

vat_number   string  optional  

Must not be greater than 30 characters. Example: vfzyjdpf

currency_code   string  optional  

Must be 3 characters. Example: xlr

sales_target   string  optional  

Example: All

Must be one of:
  • Dealers
  • All
  • None
website   string  optional  

Must not be greater than 255 characters. Example: hiutkrqqr

restricted_sell   boolean  optional  

Example: false

address   object  optional  
address1   string  optional  

Example: eaque

address2   string  optional  

Example: impedit

city   string  optional  

Must not be greater than 50 characters. Example: mpxucykrimsopeagt

postal_code   string  optional  

Must not be greater than 15 characters. Example: rnqpkrmandhj

phone_number   string  optional  

Must not be greater than 30 characters. Example: unnpuijb

company_email   string  optional  

Must be a valid email address. Must not be greater than 255 characters. Example: turner.carmen@example.org

country_code   string  optional  

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

requires authentication

Converts the uploaded image to WebP (resized down to a maximum of 1024 pixels on the longest side, metadata stripped), stores it on the public disk, and returns the company including the public logo_url to fetch the logo from.

Set which countries the company is allowed to sell to when restricted_sell is true (Azure DevOps #58322). Accepts one or more countries at a time; each is attached or detached independently, so countries not included in the request are left untouched.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/companies/1/allowed-countries" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"countries\": [
        {
            \"country_code\": \"dk\",
            \"allowed\": true
        }
    ]
}"
const url = new URL(
    "http://localhost/api/companies/1/allowed-countries"
);

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

let body = {
    "countries": [
        {
            "country_code": "dk",
            "allowed": true
        }
    ]
};

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

Request      

PUT api/companies/{company_id}/allowed-countries

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

Body Parameters

countries   object[]   

List of countries to allow or disallow.

country_code   string   

Two-letter ISO country code. Example: dk

allowed   boolean   

Whether the company is allowed to sell to this country. Example: true

Countries a customer may ship an inquiry to for this company (Azure DevOps #58720) - every country when restricted_sell is false (the pivot is ignored, matching #58322's rule), otherwise only the countries explicitly allowed. Public/browsable: no company membership required, unlike updateAllowedCountries().

requires authentication

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

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}/available-countries

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

All 11 discount levels for a company (Azure DevOps #58255), any level without a configured row defaulting to 0%.

requires authentication

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

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}/discount-indices

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

Update a single discount level's percentage for a company (Azure DevOps #58255). Uses upsert() rather than updateOrCreate()/save(): CompanyDiscountIndex declares company_id as its Eloquent primary key, but the table's real key is the composite (company_id, discount_index) - a save() on an existing row would update by company_id alone and silently overwrite every discount level for that company, not just this one.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/companies/1/discount-indices/maiores" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"discount_index\": \"50\",
    \"discount_percentage\": 13
}"
const url = new URL(
    "http://localhost/api/companies/1/discount-indices/maiores"
);

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

let body = {
    "discount_index": "50",
    "discount_percentage": 13
};

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

Request      

PUT api/companies/{company_id}/discount-indices/{discountIndex}

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

discountIndex   string   

Example: maiores

Body Parameters

discount_index   integer   

Example: 50

Must be one of:
  • 0
  • 10
  • 20
  • 30
  • 40
  • 50
  • 60
  • 70
  • 80
  • 90
  • 100
discount_percentage   integer   

Must be at least 0. Must not be greater than 100. Example: 13

The company's configured min/max discount ranges by country (Azure DevOps #58741) - unlike discountIndices(), there is no fixed set of levels; only countries the company has actually configured are returned.

requires authentication

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

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}/country-discounts

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

Update a single country's discount range for a company (Azure DevOps #58741). Uses upsert() for the same reason as updateDiscountIndex(): the table's real primary key is the composite (company_id, country_code), which CompanyCountryDiscount cannot declare.

requires authentication

Example request:
curl --request PUT \
    "http://localhost/api/companies/1/country-discounts/dignissimos" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"country_code\": \"bt\",
    \"percent\": 21,
    \"max_discount\": 23
}"
const url = new URL(
    "http://localhost/api/companies/1/country-discounts/dignissimos"
);

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

let body = {
    "country_code": "bt",
    "percent": 21,
    "max_discount": 23
};

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

Request      

PUT api/companies/{company_id}/country-discounts/{countryCode}

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

countryCode   string   

Example: dignissimos

Body Parameters

country_code   string   

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

percent   integer   

Must be at least 0. Must not be greater than 100. Example: 21

max_discount   integer  optional  

Must be at least 0. Must not be greater than 100. Example: 23

Remove a company's discount range for a country (Azure DevOps #58741).

requires authentication

Unlike discount levels, a country with no configured row simply has no discount range - there is no implicit default to fall back to.

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

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/companies/{company_id}/country-discounts/{countryCode}

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

countryCode   string   

Example: magni

Live-check a VAT number while a registration form is being filled in (Azure DevOps #58486), before the dealer/customer/address form is submitted. A real VIES check for EU countries, a format check otherwise - the same rule storeDealer/storeCustomer enforce on submit.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/vat/validate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"country_code\": \"dk\",
    \"vat_number\": \"DK12345678\"
}"
const url = new URL(
    "http://localhost/api/vat/validate"
);

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

let body = {
    "country_code": "dk",
    "vat_number": "DK12345678"
};

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

Request      

POST api/vat/validate

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

country_code   string   

Two-letter ISO country code. Example: dk

vat_number   string   

The VAT number to check. Example: DK12345678

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" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"password\": \"secret-password\",
    \"language_code\": \"en\",
    \"marketing_consent\": false
}"
const url = new URL(
    "http://localhost/api/users/admin"
);

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

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "secret-password",
    "language_code": "en",
    "marketing_consent": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).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

Body Parameters

name   string   

The user's full name. Example: Jane Doe

email   string   

The user's email address, unique. Example: jane@example.com

password   string   

Minimum 8 characters. Example: secret-password

language_code   string   

Two-letter language code. Example: en

marketing_consent   boolean  optional  

Newsletter opt-in. The server stamps marketing_consented_at; the client never sends a timestamp. Example: false

Add a user to the authenticated dealer's currently selected company.

requires authentication

If a user with the given email already exists, they are simply attached to the company and notified - no duplicate account, no email verification (their email was already verified previously). Otherwise a new Dealer user is created; once they confirm their email a password is generated and emailed to them (see EmailVerificationController::verifyCompanyUser).

Example request:
curl --request POST \
    "http://localhost/api/users/company" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"get_part_requests\": false
}"
const url = new URL(
    "http://localhost/api/users/company"
);

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

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "get_part_requests": false
};

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

Request      

POST api/users/company

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The new user's full name. Ignored if a user with the given email already exists. Must not be greater than 255 characters. Example: Jane Doe

email   string   

The user's email address. If a user with this email already exists, they are attached to the company instead of creating a duplicate account. Must be a valid email address. Must not be greater than 255 characters. Example: jane@example.com

get_part_requests   boolean  optional  

Whether this user should be emailed when a new inquiry comes in for the company. Defaults to true. Ignored when attaching an existing user - their current setting is kept. Example: false

Update a user of the caller's company.

requires authentication

Updates a user belonging to the authenticated dealer's currently selected company. Updating a colleague only get_part_requests may be changed; updating yourself name and email may be changed as well.

Example request:
curl --request PUT \
    "http://localhost/api/users/company/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"get_part_requests\": false
}"
const url = new URL(
    "http://localhost/api/users/company/1"
);

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

let body = {
    "get_part_requests": false
};

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

Request      

PUT api/users/company/{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: 1

Body Parameters

get_part_requests   boolean  optional  

Whether this user should be emailed when a new inquiry comes in for the company. Example: false

Remove a user from the caller's company.

requires authentication

Detaches the user from the caller's selected company. When that was the user's last company, the account is soft deleted (tokens revoked, carts removed); inquiries the user created are always preserved. Inviting the same email again through the company user creation endpoint restores a soft deleted account.

Removing the LAST user of the company is a two-step request: without the confirm query parameter it dry runs and reports what would be deleted; with confirm=1 it permanently deletes the parts of every company where this user is the last user, soft deletes those companies and the account, and reports what happened.

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

const params = {
    "confirm": "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 = {
    "confirm": false
};

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

Request      

DELETE api/users/company/{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: 1

Query Parameters

confirm   boolean  optional  

Confirm deleting a company's last user (with its companies and parts). Without it the request is a dry run. Example: true

Body Parameters

confirm   boolean  optional  

Example: false

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&per_page=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",
    "per_page": "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

per_page   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&per_page=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",
    "per_page": "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

per_page   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/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"ltjoyctzdb\",
    \"email\": \"helga.buckridge@example.com\",
    \"password\": \"Ymr?._kDp4P\",
    \"role_id\": \"3\",
    \"selected_company_id\": 2,
    \"status\": \"active\",
    \"language_code\": \"xe\",
    \"get_part_requests\": true,
    \"marketing_consent\": true
}"
const url = new URL(
    "http://localhost/api/users/1"
);

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

let body = {
    "name": "ltjoyctzdb",
    "email": "helga.buckridge@example.com",
    "password": "Ymr?._kDp4P",
    "role_id": "3",
    "selected_company_id": 2,
    "status": "active",
    "language_code": "xe",
    "get_part_requests": true,
    "marketing_consent": 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: 1

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: ltjoyctzdb

email   string  optional  

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

password   string  optional  

Must be at least 8 characters. Example: Ymr?._kDp4P

role_id   integer  optional  

Example: 3

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

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

status   string  optional  

Example: active

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

Must be 2 characters. Example: xe

get_part_requests   boolean  optional  

Example: true

marketing_consent   boolean  optional  

Example: true

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost/api/users/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/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/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: 1

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

requires authentication

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

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: 1

Send a support email. The recipient is fixed by the backend, and a logged-in user's own name/email/role/company override anything the client sends.

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/support/email" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"subject\": \"Help needed\",
    \"message\": \"I need help with my order.\",
    \"sender_email\": \"user@example.com\",
    \"sender_name\": \"John Doe\"
}"
const url = new URL(
    "http://localhost/api/support/email"
);

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

let body = {
    "subject": "Help needed",
    "message": "I need help with my order.",
    "sender_email": "user@example.com",
    "sender_name": "John Doe"
};

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

Request      

POST api/support/email

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

subject   string   

The email subject. Example: Help needed

message   string   

The message body. Example: I need help with my order.

sender_email   string  optional  

Required when not logged in. Ignored for a logged-in user, whose own email is used instead. Example: user@example.com

sender_name   string  optional  

Required when not logged in. Ignored for a logged-in user, whose own name is used instead. Example: John Doe

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

requires authentication

Example request:
curl --request POST \
    "http://localhost/api/users/dealer" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"password\": \"secret-password\",
    \"language_code\": \"en\",
    \"secondary_language_code\": \"da\",
    \"status\": \"pending\",
    \"get_part_requests\": true,
    \"marketing_consent\": true,
    \"message\": \"Please approve my account.\",
    \"company\": {
        \"title\": \"Alpha Tractors\",
        \"country_code\": \"dk\",
        \"currency_code\": \"DKK\",
        \"vat_number\": \"DK12345678\",
        \"sales_target\": \"Dealers\",
        \"website\": \"https:\\/\\/alpha-tractors.example.com\",
        \"address\": {
            \"company_email\": \"inbox@alpha-tractors.example.com\",
            \"phone_number\": \"+45 12 34 56 78\"
        }
    }
}"
const url = new URL(
    "http://localhost/api/users/dealer"
);

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

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "secret-password",
    "language_code": "en",
    "secondary_language_code": "da",
    "status": "pending",
    "get_part_requests": true,
    "marketing_consent": true,
    "message": "Please approve my account.",
    "company": {
        "title": "Alpha Tractors",
        "country_code": "dk",
        "currency_code": "DKK",
        "vat_number": "DK12345678",
        "sales_target": "Dealers",
        "website": "https:\/\/alpha-tractors.example.com",
        "address": {
            "company_email": "inbox@alpha-tractors.example.com",
            "phone_number": "+45 12 34 56 78"
        }
    }
};

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

Request      

POST api/users/dealer

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The user's full name. Example: Jane Doe

email   string   

The user's email address, unique. Example: jane@example.com

password   string   

Minimum 8 characters. Example: secret-password

language_code   string   

Two-letter language code. Example: en

secondary_language_code   string  optional  

Two-letter language code. Example: da

status   string  optional  

Either pending or active. Defaults to pending. Example: pending

get_part_requests   boolean  optional  

Whether the user is emailed when a new inquiry comes in for the company. Example: true

marketing_consent   boolean  optional  

Newsletter opt-in. The server stamps marketing_consented_at; the client never sends a timestamp. Example: true

message   string  optional  

Not persisted; only included in emails. Example: Please approve my account.

company   object   

The dealer company to create.

title   string   

Example: Alpha Tractors

country_code   string   

Two-letter country code. Example: dk

currency_code   string   

Three-letter currency code. Example: DKK

vat_number   string   

Example: DK12345678

sales_target   string   

Dealers, All, or None. Example: Dealers

website   string  optional  

Example: https://alpha-tractors.example.com

address   object   

The company address.

company_email   string   

The company email, used for inquiry mail. Example: inbox@alpha-tractors.example.com

phone_number   string  optional  

Example: +45 12 34 56 78

Create a Customer user (role_id = 3). Company (with vat_number) is required (ADO #58508).

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" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"password\": \"secret-password\",
    \"language_code\": \"en\",
    \"secondary_language_code\": \"da\",
    \"status\": \"pending\",
    \"get_part_requests\": true,
    \"marketing_consent\": true,
    \"message\": \"Please approve my account.\",
    \"company\": {
        \"title\": \"Beta Farms\",
        \"country_code\": \"dk\",
        \"currency_code\": \"DKK\",
        \"vat_number\": \"DK12345678\",
        \"website\": \"https:\\/\\/beta-farms.example.com\",
        \"address\": {
            \"address1\": \"Main Street 1\",
            \"address2\": \"Building B\",
            \"city\": \"Aarhus\",
            \"postal_code\": \"8000\",
            \"country_code\": \"dk\",
            \"company_email\": \"inbox@beta-farms.example.com\",
            \"phone_number\": \"+45 12 34 56 78\"
        }
    }
}"
const url = new URL(
    "http://localhost/api/users/customer"
);

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

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "secret-password",
    "language_code": "en",
    "secondary_language_code": "da",
    "status": "pending",
    "get_part_requests": true,
    "marketing_consent": true,
    "message": "Please approve my account.",
    "company": {
        "title": "Beta Farms",
        "country_code": "dk",
        "currency_code": "DKK",
        "vat_number": "DK12345678",
        "website": "https:\/\/beta-farms.example.com",
        "address": {
            "address1": "Main Street 1",
            "address2": "Building B",
            "city": "Aarhus",
            "postal_code": "8000",
            "country_code": "dk",
            "company_email": "inbox@beta-farms.example.com",
            "phone_number": "+45 12 34 56 78"
        }
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).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

Body Parameters

name   string   

The user's full name. Example: Jane Doe

email   string   

The user's email address, unique. Example: jane@example.com

password   string   

Minimum 8 characters. Example: secret-password

language_code   string   

Two-letter language code. Example: en

secondary_language_code   string  optional  

Two-letter language code. Example: da

status   string  optional  

Either pending or active. Defaults to pending. Example: pending

get_part_requests   boolean  optional  

Whether the user is emailed when a new inquiry comes in for the company. Example: true

marketing_consent   boolean  optional  

Newsletter opt-in. The server stamps marketing_consented_at; the client never sends a timestamp. Example: true

message   string  optional  

Not persisted; only included in emails. Example: Please approve my account.

company   object   

The customer company to create.

title   string   

Example: Beta Farms

country_code   string   

Two-letter country code. Example: dk

currency_code   string  optional  

Three-letter currency code. Example: DKK

vat_number   string   

Example: DK12345678

website   string  optional  

Example: https://beta-farms.example.com

address   object   

The company address.

address1   string   

Example: Main Street 1

address2   string  optional  

Example: Building B

city   string   

Example: Aarhus

postal_code   string   

Example: 8000

country_code   string   

Two-letter country code. Example: dk

company_email   string   

Example: inbox@beta-farms.example.com

phone_number   string  optional  

Example: +45 12 34 56 78

Verify the given user's email address via a signed, stateless link (the user is not authenticated when they click the link, so this cannot rely on Fortify's session-based verification routes).

requires authentication

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

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 (403):

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

{
    "message": "Invalid signature."
}
 

Request      

GET api/email/verify/{id}/{hash}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the verify. Example: culpa

hash   string   

Example: optio

Verify the email for a user added to a company via ADO #58304 (App\Http\Controllers\UserController::storeCompanyUser). Unlike the self-registration flow above, this activates the account immediately and generates+emails a password, since the user is joining an already-vetted, active company rather than registering a new one.

requires authentication

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

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 (403):

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

{
    "message": "Invalid signature."
}
 

Request      

GET api/email/verify/company-user/{id}/{hash}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the company user. Example: iste

hash   string   

Example: dolore

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