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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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¤cy_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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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¤cy_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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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¤cy_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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the logo of the specified company.
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.
Example request:
curl --request POST \
"http://localhost/api/companies/1/logo" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "logo=@/tmp/phpbujshpdndbln3uTDpbx" const url = new URL(
"http://localhost/api/companies/1/logo"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.