MENU navbar-image

Introduction

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

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

Authenticating requests

This API is not authenticated.

Address

Get list of address by customer

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/addresses could not be found."
}
 

Request      

GET api/v1/ecommerce/addresses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create new address for customer

requires authentication

Example request:
curl --request POST \
    "http://shofy.test/api/v1/ecommerce/addresses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"John Doe\",
    \"email\": \"john.doe@example.com\",
    \"phone\": \"0123456789\",
    \"country\": \"United States or US\",
    \"state\": \"California\",
    \"city\": \"Los Angeles\",
    \"address\": \"123 Main St\",
    \"is_default\": true,
    \"zip_code\": \"90001\"
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/addresses"
);

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

let body = {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "0123456789",
    "country": "United States or US",
    "state": "California",
    "city": "Los Angeles",
    "address": "123 Main St",
    "is_default": true,
    "zip_code": "90001"
};

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

Example response (200):


{
    "error": false,
    "data": {
        "id": 1,
        "name": "John Doe",
        "phone": "0123456789",
        "email": "john.doe@example.com",
        "country": "United States",
        "state": "California",
        "city": "Los Angeles",
        "address": "123 Main St",
        "zip_code": "90001",
        "is_default": true
    },
    "message": null
}
 

Request      

POST api/v1/ecommerce/addresses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the address owner. Example: John Doe

email   string   

The email address. Example: john.doe@example.com

phone   string   

The phone number. Example: 0123456789

country   string  optional  

The country name or country code. Example: United States or US

state   string  optional  

The state/province name. Example: California

city   string  optional  

The city name. Example: Los Angeles

address   string  optional  

The street address. Example: 123 Main St

is_default   boolean  optional  

Set as default address. Example: true

zip_code   string  optional  

The postal/zip code. Example: 90001

Update an address

requires authentication

Example request:
curl --request PUT \
    "http://shofy.test/api/v1/ecommerce/addresses/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"John Doe\",
    \"email\": \"john.doe@example.com\",
    \"phone\": \"0123456789\",
    \"country\": \"United States or US\",
    \"state\": \"California\",
    \"city\": \"Los Angeles\",
    \"address\": \"123 Main St\",
    \"is_default\": true,
    \"zip_code\": \"90001\"
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/addresses/1"
);

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

let body = {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "0123456789",
    "country": "United States or US",
    "state": "California",
    "city": "Los Angeles",
    "address": "123 Main St",
    "is_default": true,
    "zip_code": "90001"
};

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

Example response (200):


{
    "error": false,
    "data": {
        "id": 1,
        "name": "John Doe",
        "phone": "0123456789",
        "email": "john.doe@example.com",
        "country": "United States",
        "state": "California",
        "city": "Los Angeles",
        "address": "123 Main St",
        "zip_code": "90001",
        "is_default": true
    },
    "message": null
}
 

Request      

PUT api/v1/ecommerce/addresses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the address. Example: 1

Body Parameters

name   string   

The name of the address owner. Example: John Doe

email   string   

The email address. Example: john.doe@example.com

phone   string   

The phone number. Example: 0123456789

country   string  optional  

The country name or country code. Example: United States or US

state   string   

The state/province name. Example: California

city   string   

The city name. Example: Los Angeles

address   string   

The street address. Example: 123 Main St

is_default   boolean  optional  

Set as default address. Example: true

zip_code   string  optional  

The postal/zip code. Example: 90001

Delete an address

requires authentication

Example request:
curl --request DELETE \
    "http://shofy.test/api/v1/ecommerce/addresses/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/addresses/1"
);

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

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

Example response (200):


{
    "error": false,
    "data": null,
    "message": "Address deleted successfully"
}
 

Request      

DELETE api/v1/ecommerce/addresses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the address. Example: 1

Get list of available countries

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

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

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

Example response (200):


{
    "error": false,
    "data": [
        {
            "name": "Vietnam",
            "code": "VN"
        }
    ],
    "message": null
}
 

Request      

GET api/v1/ecommerce/countries

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authentication

Register

Example request:
curl --request POST \
    "http://shofy.test/api/v1/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"e.g: John\",
    \"last_name\": \"e.g: Smith\",
    \"name\": \"consequatur\",
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\",
    \"phone\": \"consequatur\",
    \"password_confirmation\": \"consequatur\"
}"
const url = new URL(
    "http://shofy.test/api/v1/register"
);

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

let body = {
    "first_name": "e.g: John",
    "last_name": "e.g: Smith",
    "name": "consequatur",
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,",
    "phone": "consequatur",
    "password_confirmation": "consequatur"
};

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

Example response (200):


{
    "error": false,
    "data": null,
    "message": "Registered successfully! We emailed you to verify your account!"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "email": [
            "The email field is required."
        ],
        "password": [
            "The password field is required."
        ]
    }
}
 

Request      

POST api/v1/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

first_name   string  optional  

This field is required when name is not present. Must not be greater than 120 characters. Must be at least 2 characters. Example: e.g: John

last_name   string  optional  

This field is required when name is not present. Must not be greater than 120 characters. Must be at least 2 characters. Example: e.g: Smith

name   string   

The name of the user. Example: consequatur

email   string   

The email of the user. Example: qkunze@example.com

password   string   

The password of user to create. Example: O[2UZ5ij-e/dl4m{o,

phone   string   

The phone of the user. Example: consequatur

password_confirmation   string   

The password confirmation. Example: consequatur

Login

Example request:
curl --request POST \
    "http://shofy.test/api/v1/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
    "http://shofy.test/api/v1/login"
);

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

let body = {
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,"
};

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

Example response (200):


{
    "error": false,
    "data": {
        "token": "1|aF5s7p3xxx1lVL8hkSrPN72m4wPVpTvTs..."
    },
    "message": null
}
 

Request      

POST api/v1/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: qkunze@example.com

password   string   

The password of user to create. Example: O[2UZ5ij-e/dl4m{o,

Check email existing or not

Example request:
curl --request POST \
    "http://shofy.test/api/v1/email/check" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\"
}"
const url = new URL(
    "http://shofy.test/api/v1/email/check"
);

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

let body = {
    "email": "qkunze@example.com"
};

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

Example response (200):


{
    "error": false,
    "data": {
        "exists": true
    },
    "message": null
}
 

Request      

POST api/v1/email/check

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: qkunze@example.com

Forgot password

Send a reset link to the given user.

Example request:
curl --request POST \
    "http://shofy.test/api/v1/password/forgot" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\"
}"
const url = new URL(
    "http://shofy.test/api/v1/password/forgot"
);

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

let body = {
    "email": "qkunze@example.com"
};

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

Request      

POST api/v1/password/forgot

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: qkunze@example.com

Resend email verification

Resend the email verification notification.

Example request:
curl --request POST \
    "http://shofy.test/api/v1/resend-verify-account-email" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\"
}"
const url = new URL(
    "http://shofy.test/api/v1/resend-verify-account-email"
);

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

let body = {
    "email": "qkunze@example.com"
};

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

Request      

POST api/v1/resend-verify-account-email

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: qkunze@example.com

Logout

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/logout could not be found."
}
 

Request      

GET api/v1/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Blog

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/search" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"consequatur\"
}"
const url = new URL(
    "http://shofy.test/api/v1/search"
);

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

let body = {
    "q": "consequatur"
};

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/v1/search could not be found."
}
 

List posts

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/posts could not be found."
}
 

Request      

GET api/v1/posts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

List categories

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/categories could not be found."
}
 

Request      

GET api/v1/categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

List tags

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/tags could not be found."
}
 

Request      

GET api/v1/tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Filters posts

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/posts/filters?page=17&per_page=17&search=consequatur&after=consequatur&author=consequatur&author_exclude=consequatur&before=consequatur&exclude=consequatur&include=consequatur&order=consequatur&order_by=consequatur&categories=consequatur&categories_exclude=consequatur&tags=consequatur&tags_exclude=consequatur&featured=consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://shofy.test/api/v1/posts/filters"
);

const params = {
    "page": "17",
    "per_page": "17",
    "search": "consequatur",
    "after": "consequatur",
    "author": "consequatur",
    "author_exclude": "consequatur",
    "before": "consequatur",
    "exclude": "consequatur",
    "include": "consequatur",
    "order": "consequatur",
    "order_by": "consequatur",
    "categories": "consequatur",
    "categories_exclude": "consequatur",
    "tags": "consequatur",
    "tags_exclude": "consequatur",
    "featured": "consequatur",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/posts/filters could not be found."
}
 

Request      

GET api/v1/posts/filters

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

Current page of the collection. Default: 1 Example: 17

per_page   integer  optional  

Maximum number of items to be returned in result set.Default: 10 Example: 17

search   string  optional  

Limit results to those matching a string. Example: consequatur

after   string  optional  

Limit response to posts published after a given ISO8601 compliant date. Example: consequatur

author   string  optional  

Limit result set to posts assigned to specific authors. Example: consequatur

author_exclude   string  optional  

Ensure result set excludes posts assigned to specific authors. Example: consequatur

before   string  optional  

Limit response to posts published before a given ISO8601 compliant date. Example: consequatur

exclude   string  optional  

Ensure result set excludes specific IDs. Example: consequatur

include   string  optional  

Limit result set to specific IDs. Example: consequatur

order   string  optional  

Order sort attribute ascending or descending. Default: desc .One of: asc, desc Example: consequatur

order_by   string  optional  

Sort collection by object attribute. Default: updated_at. One of: author, created_at, updated_at, id, slug, title Example: consequatur

categories   string  optional  

Limit result set to all items that have the specified term assigned in the categories taxonomy. Example: consequatur

categories_exclude   string  optional  

Limit result set to all items except those that have the specified term assigned in the categories taxonomy. Example: consequatur

tags   string  optional  

Limit result set to all items that have the specified term assigned in the tags taxonomy. Example: consequatur

tags_exclude   string  optional  

Limit result set to all items except those that have the specified term assigned in the tags taxonomy. Example: consequatur

featured   string  optional  

Limit result set to items that are sticky. Example: consequatur

Get post by slug

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

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/posts/consequatur could not be found."
}
 

Request      

GET api/v1/posts/{slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the post. Example: consequatur

Query Parameters

slug   string  optional  

Find by slug of post. Example: consequatur

Filters categories

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/categories/filters could not be found."
}
 

Request      

GET api/v1/categories/filters

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get category by slug

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

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/categories/consequatur could not be found."
}
 

Request      

GET api/v1/categories/{slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the category. Example: consequatur

Query Parameters

slug   string  optional  

Find by slug of category. Example: consequatur

Brands

Get list of brands

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/ecommerce/brands" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"is_featured\": false
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/brands"
);

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

let body = {
    "is_featured": false
};

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/v1/ecommerce/brands could not be found."
}
 

Request      

GET api/v1/ecommerce/brands

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

brands   string  optional  

nullable array List of brand IDs if you need filter by brands, (e.g. [1,2,3]).

page   integer  optional  

Page number. Default: 1.

per_page   integer  optional  

Number of items per page. Default: 16.

Body Parameters

brands   string[]  optional  

The id of an existing record in the ec_product_brands table.

is_featured   boolean  optional  

Example: false

Get brand details by slug

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/brands/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/brands/{slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the brand. Example: consequatur

Get products by brand

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/brands/1/products could not be found."
}
 

Request      

GET api/v1/ecommerce/brands/{id}/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the brand. Example: 1

Cart

Add product to cart

Example request:
curl --request POST \
    "http://shofy.test/api/v1/ecommerce/cart" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": 1,
    \"qty\": 1
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/cart"
);

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

let body = {
    "product_id": 1,
    "qty": 1
};

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

Request      

POST api/v1/ecommerce/cart

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

product_id   integer   

ID of the product. Example: 1

qty   integer   

Quantity of the product. Default: 1. Example: 1

Update quantity of a product in cart

Example request:
curl --request PUT \
    "http://shofy.test/api/v1/ecommerce/cart/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": 1,
    \"qty\": 1
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/cart/consequatur"
);

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

let body = {
    "product_id": 1,
    "qty": 1
};

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

Request      

PUT api/v1/ecommerce/cart/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cart. Example: consequatur

Body Parameters

product_id   integer   

ID of the product. Example: 1

qty   integer   

Quantity of the product. Example: 1

Remove a cart item by its ID.

Example request:
curl --request DELETE \
    "http://shofy.test/api/v1/ecommerce/cart/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"consequatur\"
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/cart/consequatur"
);

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

let body = {
    "product_id": "consequatur"
};

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

Request      

DELETE api/v1/ecommerce/cart/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cart. Example: consequatur

Body Parameters

product_id   string   

The id of an existing record in the ec_products table. Example: consequatur

Get a cart item by id.

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/ecommerce/cart/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_id\": 1,
    \"id\": \"e70c6c88dae8344b03e39bb147eba66a\"
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/cart/consequatur"
);

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

let body = {
    "customer_id": 1,
    "id": "e70c6c88dae8344b03e39bb147eba66a"
};

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/v1/ecommerce/cart/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/cart/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cart. Example: consequatur

Body Parameters

customer_id   integer  optional  

is ID of the customer. Example: 1

id   string   

ID of the cart item. Example: e70c6c88dae8344b03e39bb147eba66a

Refresh cart items

Example request:
curl --request POST \
    "http://shofy.test/api/v1/ecommerce/cart/refresh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"products\": [
        {
            \"product_id\": 1,
            \"quantity\": 1
        }
    ]
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/cart/refresh"
);

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

let body = {
    "products": [
        {
            "product_id": 1,
            "quantity": 1
        }
    ]
};

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

Request      

POST api/v1/ecommerce/cart/refresh

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

products   string[]   

List of products.

product_id   integer   

The id of an existing record in the ec_products table. Example: 17

quantity   integer   

Must be at least 1. Example: 45

*   object  optional  
product_id   integer   

ID of the product. Example: 1

quantity   integer   

Quantity of the product. Example: 1

Calculate tax for products in cart

Example request:
curl --request POST \
    "http://shofy.test/api/v1/ecommerce/checkout/taxes/calculate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"products\": [
        {
            \"id\": 1,
            \"quantity\": 2
        }
    ],
    \"country\": \"US\",
    \"state\": \"CA\",
    \"city\": \"Los Angeles\",
    \"zip_code\": \"90001\"
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/checkout/taxes/calculate"
);

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

let body = {
    "products": [
        {
            "id": 1,
            "quantity": 2
        }
    ],
    "country": "US",
    "state": "CA",
    "city": "Los Angeles",
    "zip_code": "90001"
};

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

Example response (200):


{
    "items": [
        {
            "product_id": 1,
            "price": 100,
            "price_formatted": "$100.00",
            "quantity": 2,
            "tax_rate": 10,
            "tax_amount": 20,
            "tax_amount_formatted": "$20.00",
            "subtotal": 200,
            "subtotal_formatted": "$200.00",
            "total": 220,
            "total_formatted": "$220.00"
        }
    ],
    "totals": {
        "sub_total": 200,
        "sub_total_formatted": "$200.00",
        "tax_amount": 20,
        "tax_amount_formatted": "$20.00",
        "total": 220,
        "total_formatted": "$220.00"
    }
}
 

Request      

POST api/v1/ecommerce/checkout/taxes/calculate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

products   string[]   

List of products.

id   integer   

Product ID. Example: 1

quantity   integer   

Product quantity. Example: 2

country   string  optional  

Country code. Example: US

state   string  optional  

State code. Example: CA

city   string  optional  

City name. Example: Los Angeles

zip_code   string  optional  

ZIP code. Example: 90001

Endpoints

GET api/v1/ecommerce/checkout/cart/{id}

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/checkout/cart/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/checkout/cart/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the cart. Example: consequatur

Orders

Get list of orders by customer

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/orders could not be found."
}
 

Request      

GET api/v1/ecommerce/orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get order detail

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/orders/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the order. Example: consequatur

Product Categories

Get list of product categories

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/ecommerce/product-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"is_featured\": true
}"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/product-categories"
);

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

let body = {
    "is_featured": true
};

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/v1/ecommerce/product-categories could not be found."
}
 

Request      

GET api/v1/ecommerce/product-categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

categories   string  optional  

nullable array List of category IDs if you need filter by categories, (e.g. [1,2,3]).

page   integer  optional  

Page number. Default: 1.

per_page   integer  optional  

Number of items per page. Default: 16.

Body Parameters

categories   string[]  optional  

The id of an existing record in the ec_product_categories table.

is_featured   boolean  optional  

Example: true

Get product category details by slug

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/product-categories/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/product-categories/{slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the product category. Example: consequatur

Get products by category

Example request:
curl --request GET \
    --get "http://shofy.test/api/v1/ecommerce/product-categories/1/products" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://shofy.test/api/v1/ecommerce/product-categories/1/products"
);

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/product-categories/1/products could not be found."
}
 

Request      

GET api/v1/ecommerce/product-categories/{id}/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product category. Example: 1

Products

Get list of products

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/products could not be found."
}
 

Request      

GET api/v1/ecommerce/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

include   string  optional  

Comma-separated list of relations to include (e.g. 'categories,tags').

is_featured   integer  optional  

Filter by featured status (0 or 1).

category   string  optional  

Filter by category slug.

tag   string  optional  

Filter by tag slug.

brand   string  optional  

Filter by brand slug.

categories   string[]  optional  

Filter by category IDs.

brands   string[]  optional  

Filter by brand IDs.

collections   string[]  optional  

Filter by collection IDs.

search   string  optional  

Search term.

order_by   string  optional  

Sort field.

order   string  optional  

Sort direction (asc or desc).

per_page   integer  optional  

Number of items per page.

Get product details by slug

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/products/consequatur could not be found."
}
 

Request      

GET api/v1/ecommerce/products/{slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the product. Example: consequatur

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/products/consequatur/related could not be found."
}
 

Get product's reviews

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/ecommerce/products/consequatur/reviews could not be found."
}
 

Request      

GET api/v1/ecommerce/products/{slug}/reviews

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the product. Example: consequatur

Profile

Get the user profile information.

requires authentication

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

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

fetch(url, {
    method: "GET",
    headers,
}).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/v1/me could not be found."
}
 

Request      

GET api/v1/me

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Update profile

requires authentication

Example request:
curl --request PUT \
    "http://shofy.test/api/v1/me" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"vmqeopfuudtdsufvyvddqamniihfqcoynlazghdtqtqxbajwbpilpmufinllwloauydlsmsjur\",
    \"last_name\": \"yvojcybzvrbyickznkygloigmkwxphlvazjrcnfbaqywuxhgjjmzuxjubqouzswiwxtrkimfca\",
    \"name\": \"consequatur\",
    \"phone\": \"consequatur\",
    \"dob\": \"consequatur\",
    \"gender\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"email\": \"qkunze@example.com\"
}"
const url = new URL(
    "http://shofy.test/api/v1/me"
);

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

let body = {
    "first_name": "vmqeopfuudtdsufvyvddqamniihfqcoynlazghdtqtqxbajwbpilpmufinllwloauydlsmsjur",
    "last_name": "yvojcybzvrbyickznkygloigmkwxphlvazjrcnfbaqywuxhgjjmzuxjubqouzswiwxtrkimfca",
    "name": "consequatur",
    "phone": "consequatur",
    "dob": "consequatur",
    "gender": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "email": "qkunze@example.com"
};

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

Request      

PUT api/v1/me

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

first_name   string  optional  

This field is required when name is not present. Must not be greater than 120 characters. Must be at least 2 characters. Example: vmqeopfuudtdsufvyvddqamniihfqcoynlazghdtqtqxbajwbpilpmufinllwloauydlsmsjur

last_name   string  optional  

This field is required when name is not present. Must not be greater than 120 characters. Must be at least 2 characters. Example: yvojcybzvrbyickznkygloigmkwxphlvazjrcnfbaqywuxhgjjmzuxjubqouzswiwxtrkimfca

name   string   

Name. Example: consequatur

phone   string   

Phone. Example: consequatur

dob   date  optional  

nullable Date of birth (format: Y-m-d). Example: consequatur

gender   string  optional  

Gender (male, female, other). Example: consequatur

description   string  optional  

Description Example: Dolores dolorum amet iste laborum eius est dolor.

email   string  optional  

Email. Example: qkunze@example.com

Update Avatar

requires authentication

Example request:
curl --request POST \
    "http://shofy.test/api/v1/update/avatar" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "avatar=@/private/var/folders/pv/8ss1l0s14ylczgg_279blg680000gn/T/phpI2plFk" 
const url = new URL(
    "http://shofy.test/api/v1/update/avatar"
);

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

const body = new FormData();
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

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

Request      

POST api/v1/update/avatar

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

avatar   file   

Avatar file. Example: /private/var/folders/pv/8ss1l0s14ylczgg_279blg680000gn/T/phpI2plFk

Update password

requires authentication

Example request:
curl --request PUT \
    "http://shofy.test/api/v1/update/password" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\",
    \"old_password\": \"consequatur\"
}"
const url = new URL(
    "http://shofy.test/api/v1/update/password"
);

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

let body = {
    "password": "O[2UZ5ij-e\/dl4m{o,",
    "old_password": "consequatur"
};

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

Request      

PUT api/v1/update/password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

password   string   

The new password of user. Example: O[2UZ5ij-e/dl4m{o,

old_password   string   

The current password of user. Example: consequatur