NAV Navbar
Logo
Example

Get Started

Welcome to the Mangoler API Documentation! You can use the API to access different endpoints, which can get information on products, categories and etc.

You can view request examples in the dark area to the right and for the API description and types, you can see the left side.

Prerequisite

In order to use the Mangoler API, you need to set up your Mangoler CMS and make sure it works. You can follow the setup from here.

Physical Files

We providing the full source code of our apps and CMS and you can always access to Mangoler API physical files and extend them based on your needs. We do not recommend you to change the files directly, as you will face conflicts when we release updates.

The feature modules can be find here:

With every API explanation, you can find the PHP Controller and PHP Route files reference in case you want to check the physical files. The controller includes all the endpoint functionality and the route file includes all the API definitions.

Authentication

Authentication is fairly easy in Mangoler. You need to authenticate your request for some endpoints and inform the server that you have the right role to access the data. For instance, you as a ‘user’ always can access the categories list, but you need to provide admin access when you want to create a new category or edit the category.

If you are using Mangoler web app or mobile apps, this will be done automatically. But if you plan to create your own apps, you need to set “token” header value. Tokens are created automatically by the Mangoler APIs and you can simply retrieve them, set them in your HTTP header and send it to the server.

You can always restrict your API access in your PHP application when you need for higher security.

You can find the user token from your CMS admin panel.

Products

Products API gives you a full control of store products and it’s data.

Physical files

File Name Path Description
products.controller api/modules/products Product controller include all the endpoints functionality
products.route api/modules/products Product route include all the endpoints definitions.

Create

Create a new product returns a new id of the product.

Definition
POST /v1/products
Example Request Body
{
   "name":"Product Name",
   "type":"simple",
   "sku":"SKU",
   "description":"Description",
   "images":"[{\"id\":1,\"value\":\"img-2033937649-58dfb925b1293.jpg\"}]",
   "price":"50",
   "category_ids":"[13,12]",
   "stock_quantity":1,
   "in_stock":false,
   "is_manage_stock":true,
   "is_visible":false,
   "weight":"12",
   "dimensions_l":"1",
   "dimensions_w":"1",
   "dimensions_h":"1",
   "date_created":"",
   "spec_ids":"[12,10]",
   "deal_start_date":"2017-04-18 22:29:00",
   "deal_end_date":"2017-04-18 22:29:00",
   "deal_state":true,
   "deal_price":"12",
   "purchase_note":"",
   "sold_individually":false,
   "is_review_enable":false
}
Argument Type Description
type string product type. currently, ‘simple’ type is only available.
name string name of the product.
description string description of a product.
images string images of the product. it’s a JSON object array.
price string original price of the product.
categories string categories of a product as an array.
stock_quantity number quantity of products
is_visible boolean 1 (true) is for publish and 0 (false) is for unpublished.
date_created string date of product creation
spec_ids string list of product specifications as an array.
SKU string SKU of a product.
in_stock string check whether the product still has stock.
is_manage_stock string check whether is stock managed.
weight string weight of the product.
dimensions_l number length of the product.
dimensions_w number width of the product.
dimensions_h number height of the product.
deal_price number product price when it’s on a deal.
deal_state boolean whether the product deal is available.
deal_start_date string start date of the deal.
deal_end_date string end date of the deal.
purchase_note string purchase note of product.
sold_individually boolean is this product sold individually.

Update

Update an existing product returns a true if product update successfully or false if the product failed to update.

Definition
PUT /v1/products/{product_id}
Example Request Body
{
   "name":"Product Name",
   "type":"simple",
   "sku":"SKU",
   "description":"Description",
   "images":"[{\"id\":1,\"value\":\"img-2033937649-58dfb925b1293.jpg\"}]",
   "price":"50",
   "category_ids":"[13,12]",
   "stock_quantity":1,
   "in_stock":false,
   "is_manage_stock":true,
   "is_visible":false,
   "weight":"12",
   "dimensions_l":"1",
   "dimensions_w":"1",
   "dimensions_h":"1",
   "date_created":"",
   "spec_ids":"[12,10]",
   "deal_start_date":"2017-04-18 22:29:00",
   "deal_end_date":"2017-04-18 22:29:00",
   "deal_state":true,
   "deal_price":"12",
   "purchase_note":"",
   "sold_individually":false,
   "is_review_enable":false
}
Param Description
id id of the product
Argument Type Description
type string product type. currently, ‘simple’ type is only available.
name string name of the product.
description string description of the product.
images string images of the product. it’s a JSON object array.
price string original price of the product.
categories string categories of the product as an array.
stock_quantity number quantity of products
is_visible boolean 1(true) is for publish and 0(false) is for unpublish.
date_created string date of product creation
spec_ids string list of product specifications as an array.
SKU string SKU of the product.
in_stock string check whether the product still has stock.
is_manage_stock string check whether is stock managed.
weight string weight of the product.
dimensions_l number length of the product.
dimensions_w number width of the product.
dimensions_h number height of the product.
deal_price number product price when it’s on a deal.
deal_state boolean whether the product deal is available.
deal_start_date string start date of the deal.
deal_end_date string end date of the deal.
purchase_note string purchase note of product.
sold_individually boolean is this product sold individually.

Delete

Delete a product. Return true if product deletes successfully or false if it fails.

Definition
DELETE /v1/products/{product_id}
Param Description
product_id id of product

List published and unpublished

List all the products with published and unpublished state.

Definition
GET /v1/products_all/{offset}/{limit}
Param Description
offset choose the index (0 is the start)
limit for how many

List only published

List all the published products.

Definition
GET /v1/products/{offset}/{limit}
Param Description
offset choose the index (0 is the start)
limit for how many

Count published and unpublished

Count the number of published and unpublished products.

Definition
GET /v1/products_all_count

Count published

Count the number of published products.

Definition
GET /v1/products_count

Find by id

Find a single product by id.

Definition
GET /v1/products/{product_id}
Param Description
product_id id of product

List all deals

List all product deals.

Definition
GET /v1/products_deals/{offset}/{limit}
Param Description
offset choose the index (0 is the start)
limit for how many

Count deals

Count all product deals.

Definition
GET /v1/products_deals/count

Find by category

Find products by single product category. This is helpful if you need to filter the products based on it’s category.

Definition
GET /v1/products_categories/{offset}/{limit}
Param Description
offset choose the index (0 is the start)
limit for how many

Find products by search term.

Definition
GET /v1/products_search/{search_term}
Param Description
search_term search term can be a product name or any phrase from the description.

check stock availability

Check whether product stock is available.

Definition
GET /v1/products_is_stock_available/{product_id}
Param Description
product_id id of product

Sales

Get summery of product sales such as a number of sales and the total amount of sales.

Definition
GET /v1/products_sales/{product_id}
Param Description
product_id id of product

Upload an image

Upload an image to the server and receive the image file name as a response. Later you can save this filename as your image as product images.

Definition
POST /v1/products_upload_image

Argument | Type | Description ——— | ———– file | file | image file as png/jpeg/jpg

Remove an image

Remove an image from your server.

Definition
GET /v1/products_remove_image/{src}
Param Description
src source of the file or file name.

Product Specifications

Product specifications API gives you a full control of different specifications and it’s data.

Physical files

File Name Path Description
product-spec.controller api/modules/product-spec Product spec controller include all the endpoints functionality.
product-spec.route api/modules/product-spec Product spec route include all the endpoints definitions.

Create

Create new product spec.

Definition
POST /v1/product_spec
Example Request
{
   "title":"Summer Colors",
   "values":"red, orange, green",
   "name":"dress-color-summer"
}
Argument Type Description
name string it’s a unique name for the spec which is easier to differentiate them.
title string spec title. This title is for the end user.
values string it’s a spec value which separates by the comma.

Update

Update an existing product spec.

Definition
PUT /v1/product_spec/{id}
Example Request
{
   "title":"Summer Colors",
   "values":"red, orange, green",
   "name":"dress-color-summer"
}
Param Description
id id of spec
Argument Type Description
name string it’s a unique name for the spec which is easier to differentiate them.
title string spec title. This title is for the end user.
values string it’s a spec value which separates by the comma.

Delete

Delete a product spec.

Definition
DELETE /v1/product_spec/{id}
Param Description
id id of spec

List all

List all product spec.

Definition
GET /v1/product_spec

Find by id

Find a single spec by id.

Definition
GET /v1/product_spec/{id}
Param Description
id id of spec

Product Categories

Product categories API gives you a full control of categories data.

Physical files

File Name Path Description
categories.controller api/modules/categories Categories controller include all the endpoints functionality
categories.route api/modules/categories Categories route include all the endpoints definitions.

Create

Create a new category.

Definition
POST /v1/categories
Example Request
{  
   "name":"Jeans",
   "description":"some jeans",
   "parent_id":"8"
}
Argument Type Description
name string name of the category.
description string optional description for the category.
parent_id string parent id is the id of parent category id. If it’s “0” it means the category doesn’t have a parent.

Update

Update an existing product spec.

Definition
PUT /v1/categories/{id}
Example Request
{  
   "name":"Jeans",
   "description":"some jeans",
   "parent_id":"8"
}
Param Description
id id of the category
Argument Type Description
name string name of the category.
description string optional description for the category.
parent_id string parent id is the id of parent category id. If it’s “0” it means the category doesn’t have a parent.

Delete

Delete a product category.

Definition
DELETE /v1/categories/{id}
Param Description
id id of the category

List all

List all product categories.

Definition
GET /v1/categories

Find by id

Find a single category by id.

Definition
GET /v1/categories/{id}
Param Description
id id of the category

Orders

Manage the store orders. The Orders API enable you to manage the orders and also to modify them.

Physical files

File Name Path Description
orders.controller api/modules/orders Orders controller include all the endpoints functionality
orders.route api/modules/orders Orders route include all the endpoints definitions.

Create

Create a new order

Definition
POST /v1/orders
Example Request
{  
   "code":"ZxYJR",
   "date_time":"Apr 04 2017",
   "total_amount":45,
   "customer_shipping_class":"Provider Name",
   "customer_shipping_price":5,
   "addressbook_id":6,
   "payment_type":"Cash On Delivery",
   "status":"Processing",
   "user_id":62,
   "items":[  
      {  
         "order_id":0,
         "product_price":45,
         "product_quantity":1,
         "product_name":"Selected Homme Oxford Shirt",
         "product_category":"[{\"id\":\"14\",\"name\":\"Shirts\",\"description\":\"shirts\",\"parent_id\":\"7\"}]",
         "product_id":42,
         "product_spec":"[{\"id\":\"11\",\"title\":\"Size\",\"name\":\"dress-sizes\",\"value\":\"M\"}]"
      }
   ],
   "coupon_code":"{\"applied\":false,\"amount\":0,\"code\":\"\""
}
Argument Type Description
code string order unique code.
date_time string date and time of the order.
total_amount float total amount of the order.
customer_shipping_class string customer shipping class.
customer_shipping_price float shipping price.
addressbook_id number user address book id.
payment_type string type of the payment.
status string status of the order. The default is Processing. Valid values are “Processing”, “Pending”, “Delivering”, “Delivered”, “Cancelled”
user_id number user id.
items string order items(products). The product_spec and product_category are an array of objects which converted to JSON.
coupon_code string coupon code information.

Delete

Delete single order and it’s items.

Definition
DELETE /v1/orders/{id}
Param Description
id id of order

Find by id

Find a single order by id.

Definition
GET /v1/orders/{id}
Param Description
id id of order

Find order items

Find all the items in a single order.

Definition
DELETE /v1/orders/{id}/items
Param Description
id id of order

List all orders

List all the orders. Only usable for admin panel.

Definition
GET /v1/orders

Search orders by user email address

Search all the orders by user email address.

Definition
GET /v1/orders/search/{email_address}
Param Description
email_address user email address

Get orders by user id

Get a list of orders by user id.

Definition
GET /v1/orders/user/{id}
Param Description
id user id

Update order status

Change order status.

Definition
GET /v1/orders/{id}/status/{status}
Param Description
id order id
status order status

Shopping Cart

Shopping cart APIs let you manage the user shopping cart items and calculate the totals.

Physical files

File Name Path Description
shopping-cart.controller api/modules/shopping-cart Shopping cart controller include all the endpoints functionality
shopping-cart.route api/modules/shopping-cart Shopping cart route include all the endpoints definitions.

Create

Create new item.

Definition
POST /v1/shopping_cart
Example Request
{  
   "product_id":46,
   "quantity":1,
   "spec":"[{\"id\":\"12\",\"title\":\"Size\",\"name\":\"dress-sizes-uk\",\"value\":\"UK 12\"}]"
}
Argument Type Description
product_id number product id.
quantity number the quantity of product.
spec string it’s empty except if the product has specification/attributes. The spec that user was chosen will be saved in this field.

Update

Update an existing page.

Definition
PUT /v1/shopping_cart/{id}
Example Request
{  
   "product_id":46,
   "quantity":1,
   "spec":"[{\"id\":\"12\",\"title\":\"Size\",\"name\":\"dress-sizes-uk\",\"value\":\"UK 12\"}]"
}
Param Description
id id of an item
Argument Type Description
product_id number product id.
quantity number the quantity of product.
spec string it’s empty except if the product has specification/attributes. The spec that user was chosen will be saved in this field.

Delete

Delete an item.

Definition
DELETE /v1/shopping_cart/{id}
Param Description
id id of the item.

Find by id

Find a single item by id.

Definition
GET /v1/shopping_cart/{id}
Param Description
id id of the item.

Find by user id

Find items by user id.

Definition
GET /v1/shopping_cart/user/{user_id}
Param Description
user_id id of a user.

Merge visitor items to login user

You might need to add the visitor cart items while they are not login. In that case, you can generate a temporary user id and create the cart item with it. When the user login into your website, you can send the temp user id with the real user id to this endpoint and this will merge the temp items into the user basket.

Definition
GET /v1/shopping_cart/merge_items/{temp_user_id}/{user_id}
Param Description
temp_user_id temporary user id.
user_id actual user id.

Calculate cart total

Calculate the cart total with or without the tax.

Definition
GET /v1/shopping_cart/total_amount/{is_calculate_tax}/{user_id}
Param Description
is_calculate_tax true or false.
user_id actual user id.

Calculate cart item sub-total

Calculate the cart item sub-total.

Definition
GET /v1/shopping_cart/subtotal_amount/{id}
Param Description
id id of the item.

Users

Users API help you to manage your users, provide them to log in, register and recover their password.

Physical files

File Name Path Description
users.controller api/modules/users Users controller include all the endpoints functionality
users.route api/modules/users Users route include all the endpoints definitions.

Register

Create a new user.

Definition
POST /v1/users
Example Request
{  
   "fullname":"Mark Zuck H",
   "email_address":"user@mangoler.com",
   "password":"something",
   "role":"admin",
   "location":"NA",
   "country":"Denmark",
   "pincode":null,
   "token_char":"",
   "token_expiry":"",
   "fb_id":"NULL",
   "google_id":"NULL"
}
Argument Type Description
full name string full name
email_address string email address
location string current location
role string role of the user. Valid values are: “user” and “admin”.
country string country name
pincode string pin code
token_char string auto generated.
token_expiry string auto generated.
fb_id string facebook user id. If user login with facebook you need to set this value.
google_id string google user id. If user login with a google account you need to set this value.

Delete

Delete a user.

Definition
DELETE /v1/users/{id}
Param Description
id id of a user.

List all

List all users.

Definition
GET /v1/users

Find by id

Find a single user by id.

Definition
GET /v1/users/{id}
Param Description
id id of a user

Update

Update the user setting.

Definition
PUT /v1/users/update/{id}/{changepassword}
Example Request
{  
   "fullname":"Mark Zuck H",
   "email_address":"user@mangoler.com",
   "password":"xxxxx",
   "role":"admin",
   "location":"NA",
   "country":"Denmark",
   "pincode":null,
   "token_char":"xxxx",
   "token_expiry":"xxxx",
   "fb_id":"NULL",
   "google_id":"NULL"
}
Param Description
id id of a user
changepassword true or false. Whether to change the password with the update operation.
Argument Type Description
fullname string full name
email_address string email address
location string current location
role string role of the user. Valid values are: “user” and “admin”.
country string country name
pincode string pin code
token_char string auto generated.
token_expiry string auto generated.
fb_id string facebook user id. If user login with facebook you need to set this value.
google_id string google user id. If user login with a google account you need to set this value.

Login

Log in with an email address.

Definition
POST /v1/users/login
Example Request
{  
   "email_address":"user@mangoler.com",
   "password": "xxx",
   "location": "current_location"
}
Argument Type Description
email_address string user email address.
password string user password.
location string current user location.

Find user by email address

Log in with an email address.

Definition
GET /v1/users/email/{email}
Param Description
email user email address.

Forget password request

When a user forgets their password, use this endpoint and start the process of password recovery.

Definition
GET /v1/users/forget_password/{email}
Param Description
email user email address.

Forget password request confirmation

Use this endpoint to validate the user password recovery request. highlight Definition

GET /v1/users/forget_password_confirm/{email}/{pincode}
Param Description
email user email address.
pincode a temporary pincode which sends to the user email.

Address Book

Manage user address book by Address Book API. Users need to create at least one address in order to checkout. They can view, create, update or delete their addresses.

Physical files

File Name Path Description
addressbook.controller api/modules/addressbook Address book controller include all the endpoints functionality
addressbook.route api/modules/addressbook Address book route include all the endpoints definitions.

Create

Create new address.

Definition
POST /v1/addresses
Example Request
{  
   "fullname":"Jack Ma",
   "address_1":"street name",
   "address_2":"building name",
   "city":"Kuala Lumpur",
   "state":"Kuala Lumpur",
   "country":"Malaysia",
   "zip": 12345,
   "phone_number": "01298174",
   "user_id": 2
}
Argument Type Description
fullname string contact full name.
address_1 string address detail.
address_2 string address detail.
city string name of the city.
state string name of the state.
country string name of the country.
zip string zip code.
phone_number string phone number.
user_id number user id.

Update

Update an existing address.

Definition
PUT /v1/addresses/{id}
Example Request
{  
   "fullname":"Jack Ma",
   "address_1":"street name",
   "address_2":"building name",
   "city":"Kuala Lumpur",
   "state":"Kuala Lumpur",
   "country":"Malaysia",
   "zip": 12345,
   "phone_number": "01298174",
   "user_id": 2
}
Param Description
id id of address
Argument Type Description
fullname string contact full name.
address_1 string address detail.
address_2 string address detail.
city string name of the city.
state string name of the state.
country string name of the country.
zip string zip code.
phone_number string phone number.
user_id number user id.

Delete

Delete an address.

Definition
DELETE /v1/addresses/{id}
Param Description
id id of address.

List all

List all user addresses.

Definition
GET /v1/addresses

Find by id

Find a single address by id.

Definition
GET /v1/addresses/{id}
Param Description
id id of address

Find by user id

Find a single address by user id.

Definition
GET /v1/addresses/user/{userid}
Param Description
userid user id.

Promotions

Manage your promotions by Promotion API. You can create a promotion code and send it to your users. They can redeem them while they checking out their orders. The promotions can be enabled and disable by admin.

Physical files

File Name Path Description
promotions.controller api/modules/promotions Promotion controller include all the endpoints functionality
promotions.route api/modules/promotions Promotion route include all the endpoints definitions.

Create

Create new promotion.

Definition
POST /v1/promotions
Example Request
{  
   "code":"mtev",
   "state": false,
   "amount": "100"
}
Argument Type Description
code string promo code.
state boolean whether it is available or not. 0 (false), 1 (true) either values are correct.
amount string amount of the coupon.

Update

Update an existing promotion.

Definition
PUT /v1/promotions/{id}
Example Request
{  
   "code":"mtev",
   "state": false,
   "amount": "100"
}
Param Description
id id of promotion
Argument Type Description
code string promo code.
state boolean whether it is available or not. 0 (false), 1 (true) either values are correct.
amount string amount of the coupon.

Delete

Delete a promotion.

Definition
DELETE /v1/promotions/{id}
Param Description
id id of promotion.

List all

List all promotions.

Definition
GET /v1/promotions

Find by id

Find a single promotion by id.

Definition
GET /v1/promotions/{id}
Param Description
id id of promotion

find by code

Find a single promotion by code.

Definition
GET /v1/promotions/code/{code}
Param Description
code code of promotion

App Settings

App settings include all your mobile app and web apps global settings such as currency, logo, email addresses and etc.

Physical files

File Name Path Description
setting.controller api/modules/setting Setting controller include all the endpoints functionality
setting.route api/modules/setting Setting route include all the endpoints definitions.

Update

Update the setting data.

Definition
PUT /v1/setting
Example Request
{
   "currency":"PLN",
   "logo_light":"img-1563470750-574c2b183dcde.png",
   "logo_dark":"img-1422090890-57b71655dbf17.png",
   "payment_type":"paypal-cash",
   "contact_smtp_username":"xxxx@yourdomain.com",
   "contact_smtp_password":"password",
   "order_status_smtp_username":"xxxx@yourdomain.com",
   "order_status_smtp_password":"password",
   "support_smtp_username":"xxxx@yourdomain.com",
   "support_smtp_password":"password",
   "smtp_port":"587",
   "smtp_host":"smtp.zoho.com",
   "app_name":"Mangoler",
   "paypal_mode":"sandbox",
   "paypal_email":"xxx@gmail.com",
   "paypal_live_api":"YOUR_PRODUCTION_CLIENT_ID",
   "paypal_sandbox_api":"JI61nVj6isEnJ3bnUTRt52S21oRfMG",
   "ga_mobile":"UA-25177977-6",
   "ga_web":"UA-251129xx-x",
   "fb_appid":"842292633406503",
   "pushwoosh_appid":"DE11C-2B1FC",
   "pushwoosh_google_projectid":"1080394190177",
   "foursquare_client_id":"3L1ZFWFLD13XVWX0CDYOQI5WED",
   "foursquare_secret_key":"XE0ZFX34GX&v=20151231"
}
Argument Type Description
currency string store currency.
logo_light string logo with white background version.
logo_dark string logo with dark background version.
payment_type string valid values are “cash”, “paypal” or “paypal-cash”.
contact_smtp_username string contact form email details.
contact_smtp_password string contact form email details.
order_status_smtp_username string It will be used when a user receives the order confirmation and admin receive new order notification.
order_status_smtp_password string It will be used when a user receives the order confirmation and admin receive new order notification.
support_smtp_username string support email is used by different APIs such as when user register.
support_smtp_password string support email is used by different APIs such as when user register.
smtp_port string SMTP port.
smtp_host string SMTP host.
app_name string application name is using in mobile apps and website.
paypal_mode string paypal provide two modes: ‘sandbox’ which use for testing and ‘live’ which use when you are using your live paypal API key.
paypal_email string paypal email.
paypal_live_api string paypal live api.
paypal_sandbox_api string paypal sandbox api.
ga_mobile string google analytics code for mobile apps.
ga_web string google analytics code for website/web app.
fb_appid string facebook app id. Mangoler uses this id for facebook login.
pushwoosh_appid string pushwoosh app id.
pushwoosh_google_projectid string pushwoosh google project id.
foursquare_client_id string foursquare client id.
foursquare_secret_key string foursquare secret key.

Get app info

Get only application info. This API is suitable when you need to use it for apps and website. Because it only exposes the none-confidential information from setting.

Definition
GET /v1/setting/app_info

Get email details

Get only email details from setting.

Definition
GET /v1/setting/email_info

Sliders

Manage image sliders.

Physical files

File Name Path Description
sliders.controller api/modules/sliders Slider controller include all the endpoints functionality
sliders.route api/modules/sliders Slider route include all the endpoints definitions.

Create

Create new slider.

Definition
POST /v1/sliders
Example Request
{  
   "name":"slider 2",
   "filename":"img-1336572767-58e38e3f377a9.png",
   "link_type":"category",
   "link":"7"
}
Argument Type Description
name string name of the slide.
filename string image file name.
link_type string whether the link is to ‘category’ or ‘product’.
link string it’s the id of category or product.

Update

Update an existing slider.

Definition
PUT /v1/sliders/{id}
Example Request
{  
   "name":"slider 2",
   "filename":"img-1336572767-58e38e3f377a9.png",
   "link_type":"category",
   "link":7
}
Param Description
id id of a slider
Argument Type Description
name string name of the slide.
filename string image file name.
link_type string whether the link is to ‘category’ or ‘product’.
link number it’s the id of category or product.

Delete

Delete a slider.

Definition
DELETE /v1/sliders/{id}
Param Description
id id of a slider.

List all

List all sliders.

Definition
GET /v1/sliders

Find by id

Find a single slider by id.

Definition
GET /v1/sliders/{id}
Param Description
id id of a slider

Upload an image

Upload an image to the server and receive the image file name as a response. Later you can save this filename as your image as product images.

Definition
POST /v1/sliders/upload_image

Argument | Type | Description ——— | ———– file | file | image file as png/jpeg/jpg

Flat Rate Shipping

Manage flat rate shipping data.

Physical files

File Name Path Description
shipping.controller api/modules/shipping Shipping controller include all the endpoints functionality
shipping.route api/modules/shipping Shipping route include all the endpoints definitions.

Create

Create new shipping classes.

Definition
POST /v1/shipping_classes
Example Request
{  
   "price": 45,
   "title":"DHL",
   "name": "Normal DHL",
   "description": ""
}
Argument Type Description
price string price of the shipping.
title string title of the shipping.
name string unique name of the shipping.
description string optional description of shipping.

Update

Update an existing shipping class.

Definition
PUT /v1/shipping_classes/{id}
Example Request
{  
   "price": 45,
   "title":"DHL",
   "name": "Normal DHL",
   "description": ""
}
Param Description
id id of shipping class
Argument Type Description
price string price of the shipping.
title string title of the shipping.
name string unique name of the shipping.
description string optional description of shipping.

Delete

Delete a shipping class.

Definition
DELETE /v1/shipping_classes/{id}
Param Description
id id of shipping class.

List all

List all shipping classes.

Definition
GET /v1/shipping_classes

Find by id

Find a single shipping class by id.

Definition
GET /v1/shipping_classes/{id}
Param Description
id id of shipping class.

Pages

Manage static pages. Static pages can have an HTML content.

Physical files

File Name Path Description
pages.controller api/modules/pages Page controller include all the endpoints functionality
pages.route api/modules/pages Page route include all the endpoints definitions.

Create

Create new page.

Definition
POST /v1/pages
Example Request
{  
   "title":"new page",
   "content":"<div><!--block-->quote</div>"
}
Argument Type Description
title string title of the page
content string content of the page. HTML allowed.

Update

Update an existing page.

Definition
PUT /v1/pages/{id}
Example Request
{  
   "title":"new page",
   "content":"<div><!--block-->quote</div>"
}
Param Description
id id of a page
Argument Type Description
title string title of the page
content string content of the page. HTML allowed.

Delete

Delete a page.

Definition
DELETE /v1/pages/{id}
Param Description
id id of a page.

List all

List all pages.

Definition
GET /v1/pages

Find by id

Find a single page by id.

Definition
GET /v1/pages/{id}
Param Description
id id of a page

Dynamic Pricing

Dynamic pricing helps you to create a bulk discount or discounts with the certain condition. You can create two different rules: 1. Apply on category level 2. Apply on the product level. The pricing rules are overridden original price and sales price.

Physical files

File Name Path Description
dynamic-pricing.controller api/modules/dynamic-pricing Dynamic Pricing controller include all the endpoints functionality
dynamic-pricing.route api/modules/dynamic-pricing Dynamic Pricing route include all the endpoints definitions.

Create

Create the new rule.

Definition
POST /v1/dynamic_pricing
Example Request
{  
   "name":"Storewide Discount",
   "state":true,
   "min_quantity":3,
   "max_quantity":2,
   "discount_type":"Percentage Discount",
   "amount":"2",
   "category_id":"8",
   "product_id":"0",
   "dynamic_pricing_type":"bulk-discount"
}
Argument Type Description
name string name of the rule.
state boolean true for enable and false for disable.
min_quantity number minimum number of purchase.
max_quantity number maximum number of purchase.
discount_type string whether the discount is percentage based or fixed amount based. The valid values are “Price Discount” and “Percentage Discount”.
amount string amount of the discount.
category_id number category id if it is on the category level.
product_id number product id if it is on a product level.
dynamic_pricing_type string whether it is a bulk discount (category level) or single product (product level) discount. The valid values are: “single-discount” and “bulk-discount”.

Update

Update an existing rule.

Definition
PUT /v1/dynamic_pricing/{id}
Example Request
{  
   "name":"Storewide Discount",
   "state":true,
   "min_quantity":3,
   "max_quantity":2,
   "discount_type":"Percentage Discount",
   "amount":"2",
   "category_id":"8",
   "product_id":"0",
   "dynamic_pricing_type":"bulk-discount"
}
Param Description
id id of rule
Argument Type Description
name string name of the rule.
state boolean true for enable and false for disable.
min_quantity number minimum number of purchase.
max_quantity number maximum number of purchase.
discount_type string whether the discount is percentage based or fixed amount based. The valid values are “Price Discount” and “Percentage Discount”.
amount string amount of the discount.
category_id number category id if it is on the category level.
product_id number product id if it is on a product level.
dynamic_pricing_type string whether it is a bulk discount (category level) or single product (product level) discount. The valid values are: “single-discount” and “bulk-discount”.

Delete

Delete a rule.

Definition
DELETE /v1/dynamic_pricing/{id}
Param Description
id id of a rule.

List all

List all rules.

Definition
GET /v1/dynamic_pricing

Find by id

Find a single rule by id.

Definition
GET /v1/dynamic_pricing/{id}
Param Description
id id of rule

Find by product id

Get a valid rule for a single product. Use this API when you need to know whether there is any rule apply on a specific product.

Definition
GET /v1/dynamic_pricing/find_by_product_id/{product_id}
Param Description
product_id id of product

Contact Us

Contact us API provide you with a simple API to receive an email from every form submission.

Physical files

File Name Path Description
contactus.controller api/modules/contactus Contact us controller include all the endpoints functionality
contactus.route api/modules/contactus Contact us route include all the endpoints definitions.

Send email

Send an email to admin email. The admin email is set up in the setting area, in cms.

Definition
POST /v1/contact
Example Request
{  
   "name":"Jack",
   "email_address":"jack@gmail.com",
   "description":"I need help!"
}
Argument Type Description
name string visitor full name.
email_address string visitor email address.
description string description of message.