MENU navbar-image

Introduction

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

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

Authenticating requests

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

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

Endpoints

GET api/user

requires authentication

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

const headers = {
    "Authorization": "Bearer {API_TOKEN}",
    "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 {API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Products

GET api/products

requires authentication

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

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

let body = {
    "per_page": 16
};

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

Example response (200):


{
    "data": [
        {
            "uuid": "et-animi-quos",
            "source": "stella",
            "variants": [
                {
                    "uuid": "fugiat-sunt-nihil-accusantium",
                    "name": "harum mollitia modi",
                    "size": "L",
                    "color": "DeepSkyBlue",
                    "image_url": "https://via.placeholder.com/640x480.png/0077cc?text=fashion+ab",
                    "category_code": "quo-omnis",
                    "subcategory_code": "aut-adipisci-quidem",
                    "description_short": "Qui commodi incidunt iure odit.",
                    "description": "Modi ipsum nostrum omnis autem et. Aut dolores enim non facere tempora ex voluptatem. Praesentium quis adipisci molestias fugit. Distinctio eum doloremque id aut libero aliquam veniam corporis.",
                    "stock": 263,
                    "price": 6018
                }
            ]
        },
        {
            "uuid": "nemo-odit-quia",
            "source": "xdc",
            "variants": [
                {
                    "uuid": "dignissimos-neque-blanditiis",
                    "name": "odio veritatis excepturi",
                    "size": "L",
                    "color": "Orchid",
                    "image_url": "https://via.placeholder.com/640x480.png/001100?text=fashion+fugit",
                    "category_code": "laboriosam-est",
                    "subcategory_code": "tenetur-ratione-nemo",
                    "description_short": "Accusamus ut et recusandae.",
                    "description": "Ex repellendus assumenda et tenetur ab reiciendis. Perspiciatis deserunt ducimus corrupti et dolores quia. Assumenda odit doloribus repellat officiis corporis nesciunt ut.",
                    "stock": 135,
                    "price": 9134
                }
            ]
        }
    ]
}
 

Request      

GET api/products

Headers

Authorization        

Example: Bearer {API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

per_page   integer  optional    

Must be at least 1. Example: 16