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."
}
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 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
}
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 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
}
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 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"
}
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 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
}
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.
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."
]
}
}
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.
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
}
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.
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
}
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.
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());
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.
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());
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.
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."
}
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.
Blog
Search post
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."
}
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.
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."
}
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.
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."
}
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.
List tags
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."
}
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 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."
}
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.
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."
}
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 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."
}
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.
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."
}
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 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."
}
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 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."
}
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.
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());
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 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());
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 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());
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 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."
}
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.
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());
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.
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"
}
}
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.
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."
}
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.
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."
}
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 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."
}
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.
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."
}
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 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."
}
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 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."
}
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.
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."
}
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 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."
}
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 related products
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."
}
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.
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."
}
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 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());
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 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());
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 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());
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.