Buy Now

Shopist | Laravel eCommerce, Multivendor, CMS and Designer

API documentation
Version: 1.0


Introduction

Shopist (v3.0.0) is now fully integrated with the Laravel REST API. This allows shopist data to be created, read, updated, and deleted using requests in JSON format and using laravel REST API Authentication methods.

Requirements

To use the latest version of the REST API you must be using:

  1. Shopist 3.0.0+
  2. Laravel 6.0
  3. You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible

Errors

Suddenly you might encounter errors when accessing the REST API. There are some possible types:

Error Code Error Type
400 Bad Request Invalid request, e.g. using an unsupported HTTP method, token missing, bad parameter
401 Unauthorized Authentication error, e.g. incorrect API Token
403 Forbidden Permission error, e.g. No read or wirte or both permission
404 Not Found Requests to resources that don't exist or are missing
500 Internal Server Error Server error

Authentication

Shopist includes one way to authenticate with the Laravel REST API. Shopist using only token based authentication to create the REST API request.

REST API Token

To create or manage api token for a specific Shopist user, go to REST API menu from admin. You can check the below screenshot.

curl example

                                        
                                            $url = 'https://example.com/api/v1/pages'; 
                                            $token = 'rp5gAK0mMg3HFca0yuvwVLakV1RgVH360ZVhYoxIqSVD83Qr8Hd8u1xct0kp';

                                            curl_setopt($curl, CURLOPT_URL, $url);
                                            curl_setopt($curl, CURLOPT_HTTPHEADER, array(
                                                'apitoken:' . $token,
                                                'Content-Type: application/json',
                                                ));
                                                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                                                curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                                            
                                            
                                                $result = curl_exec($curl);
                                                if(!$result){die("Connection Failure");}
                                                curl_close($curl);
                                                return $result;
                                        
                                    

Pages

GET
                     
                                                https://example.com/api/v1/pages
                                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : pages?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0

POST
                     
                                                    https://example.com/api/v1/pages
                                                

You need to pass json encode data to create the page

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
page_title string Required
description string Optional
status integer Required (Only allow 1 and 0)

PUT
                     
                                                    https://example.com/api/v1/pages/id
                                                

You need to pass json encode data to update the page

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                    https://example.com/api/v1/pages/id
                                                
Parameters
Name Type Description
id integer Required

Blogs

GET
                     
                                                https://example.com/api/v1/blogs
                                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : blogs?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0

POST
                     
                                                    https://example.com/api/v1/blogs
                                                

You need to pass json encode data to create the blog

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
post_title string Required
description string Optional
image_url string Optional
status integer Required (Only allow 1 and 0)
seo_title string Optional
seo_meta_tag_description string Optional
seo_meta_tag_keywords string Optional
maximum_number_characters number Optional
allow_comments boolean Optional

PUT
                     
                                                    https://example.com/api/v1/blogs/id
                                                

You need to pass json encode data to update the blog

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                    https://example.com/api/v1/blogs/id
                                                
Parameters
Name Type Description
id integer Required

Categories

GET
                     
                                                https://example.com/api/v1/categories
                                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : categories?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0
type string Required (blog_cat or product_cat)

POST
                     
                                                    https://example.com/api/v1/categories
                                                

You need to pass json encode data to create the categories

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
title string Required
description string Optional
status integer Required (Only allow 1 and 0)
image string Optional
type string Required ('blog_cat' or 'product_cat')

PUT
                     
                                                    https://example.com/api/v1/categories/id
                                                

You need to pass json encode data to update the blog

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                    https://example.com/api/v1/categories/id
                                                
Parameters
Name Type Description
id integer Required

Testimonials

GET
                     
                                                https://example.com/api/v1/testimonials
                                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : testimonials?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0

POST
                     
                                                    https://example.com/api/v1/testimonials
                                                

You need to pass json encode data to create the testimonials

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
title string Required
description string Optional
status integer Required (Only allow 1 and 0)
image string Optional
client_name string Optional
job_title string Optional
company_name string Optional
client_url string Optional

PUT
                     
                                                    https://example.com/api/v1/testimonials/id
                                                

You need to pass json encode data to update the testimonials

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                    https://example.com/api/v1/testimonials/id
                                                
Parameters
Name Type Description
id integer Required

Terms

GET
                     
                                                https://example.com/api/v1/terms
                                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : terms?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0
type string Required (product_brands)

POST
                     
                                                    https://example.com/api/v1/terms
                                                

You need to pass json encode data to create the terms

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
title string Required
description string Optional
status integer Required (Only allow 1 and 0)
type string Required (product_brands)
country_name string Optional
image_url string Optional

PUT
                     
                                                    https://example.com/api/v1/terms/id
                                                

You need to pass json encode data to update the terms

Example
                     
                                                    
                                                        $data_array =  array(
                                                        'page_title' => 'Example title',
                                                        'description' => 'Example desc',
                                                        'status' =>1
                                                         );

                                                        $data = json_encode($data_array);
                                                    
                                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                    https://example.com/api/v1/terms/id
                                                
Parameters
Name Type Description
id integer Required

Products

GET
                     
                                            https://example.com/api/v1/products
                                        

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : products?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0
exclude array Ensure result set excludes specific IDs
include array Limit result set to specific ids
type string Required and Options: simple_product, configurable_product, customizable_product, downloadable_product
sku string Limit result set to products with a specific SKU
min_price string Limit result set to products based on a minimum price
max_price string Limit result set to products based on a maximum price
stock_status string Options : in_stock, out_of_stock

POST
                     
                                                https://example.com/api/v1/products
                                            

You need to pass json encode data to create the products

Example
                     
                                                
                                                    $data_array =  array(
                                                    'page_title' => 'Example title',
                                                    'description' => 'Example desc',
                                                    'status' =>1
                                                     );

                                                    $data = json_encode($data_array);
                                                
                                            
Parameters
Name Type Description
title string Required
type string Required (simple_product, configurable_product, customizable_product, downloadable_product)
SKU string Optional
status integer Required (Only allow 1 and 0)
regular_price string Optional
description string Optional
image_url string Optional

PUT
                     
                                                https://example.com/api/v1/products/id
                                            

You need to pass json encode data to update the products

Example
                     
                                                
                                                    $data_array =  array(
                                                    'page_title' => 'Example title',
                                                    'description' => 'Example desc',
                                                    'status' =>1
                                                     );

                                                    $data = json_encode($data_array);
                                                
                                            
Parameters
Name Type Description
id integer Required

DELETE
                     
                                                https://example.com/api/v1/products/id
                                            
Parameters
Name Type Description
id integer Required

Coupons

GET
                     
                                        https://example.com/api/v1/coupons
                                    

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : coupons?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
handle string Limit result set to products with a specific handle
status integer Limit result set to products assigned a specific status. Options 1 or 0
code string Get resuult by specific coupon code

POST
                     
                                            https://example.com/api/v1/coupons
                                        

You need to pass json encode data to create the coupons

Example
                     
                                            
                                                $data_array =  array(
                                                'page_title' => 'Example title',
                                                'description' => 'Example desc',
                                                'status' =>1
                                                 );

                                                $data = json_encode($data_array);
                                            
                                        
Parameters
Name Type Description
code string Required
discount_type string Required (discount_from_product, percentage_discount_from_product, discount_from_total_cart, percentage_discount_from_total_cart)
amount string Required
status integer Required (Only allow 1 and 0)
end_date Required Date format 'yyyy-mm-dd'
description string Optional

PUT
                     
                                            https://example.com/api/v1/coupons/id
                                        

You need to pass json encode data to update the coupons

Example
                     
                                            
                                                $data_array =  array(
                                                'page_title' => 'Example title',
                                                'description' => 'Example desc',
                                                'status' =>1
                                                 );

                                                $data = json_encode($data_array);
                                            
                                        
Parameters
Name Type Description
id integer Required

DELETE
                     
                                            https://example.com/api/v1/coupons/id
                                        
Parameters
Name Type Description
id integer Required

Customers

GET
                     
                                        https://example.com/api/v1/customers
                                    

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : customers?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
search string Limit results to those matching a string
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
status integer Limit result set to products assigned a specific status. Options 1 or 0
email string Any email for the customer which you want to get
role string You can get customer data by role name

POST
                     
                                            https://example.com/api/v1/customers
                                        

You need to pass json encode data to create the customers

Example
                     
                                            
                                                $data_array =  [
                                                'display_name' => '',
                                                    'user_name' => '',
                                                    'email' => '',
                                                    'status' => 1,
                                                    'secret_key' => '',
                                                    'billing' => [
                                                    'title' => '',
                                                    'company_name' => '',
                                                    'first_name' => '',
                                                    'last_name' => '',
                                                    'email' => '',
                                                    'phone_number' => '',
                                                    'country' => '',
                                                    'address_line_1' => '',
                                                    'address_line_2' => '',
                                                    'town_or_city' => '',
                                                    'zip_or_postal_code' => '',
                                                    'fax_number' => ''
                                                    ],

                                                    'shipping' => [
                                                    'title' => '',
                                                    'company_name' => '',
                                                    'first_name' => '',
                                                    'last_name' => '',
                                                    'email' => '',
                                                    'phone_number' => '',
                                                    'country' => '',
                                                    'address_line_1' => '',
                                                    'address_line_2' => '',
                                                    'town_or_city' => '',
                                                    'zip_or_postal_code' => '',
                                                    'fax_number' => ''
                                                    ]
                                                    
                                                ];
                                            
                                        
Parameters
Name Type Description
display_name string Required
user_name string Required
status integer Required (Only allow 1 and 0)
email string Required
secret_key string Required

PUT
                     
                                            https://example.com/api/v1/customers/id
                                        

You need to pass json encode data to update the customers

Example
                     
                                            
                                                $data_array =  [
                                                'display_name' => '',
                                                    'user_name' => '',
                                                    'email' => '',
                                                    'status' => 1,
                                                    'secret_key' => '',
                                                    'billing' => [
                                                    'title' => '',
                                                    'company_name' => '',
                                                    'first_name' => '',
                                                    'last_name' => '',
                                                    'email' => '',
                                                    'phone_number' => '',
                                                    'country' => '',
                                                    'address_line_1' => '',
                                                    'address_line_2' => '',
                                                    'town_or_city' => '',
                                                    'zip_or_postal_code' => '',
                                                    'fax_number' => ''
                                                    ],

                                                    'shipping' => [
                                                    'title' => '',
                                                    'company_name' => '',
                                                    'first_name' => '',
                                                    'last_name' => '',
                                                    'email' => '',
                                                    'phone_number' => '',
                                                    'country' => '',
                                                    'address_line_1' => '',
                                                    'address_line_2' => '',
                                                    'town_or_city' => '',
                                                    'zip_or_postal_code' => '',
                                                    'fax_number' => ''
                                                    ]
                                                    
                                                ];
                                            
                                        
Parameters
Name Type Description
id integer Required

DELETE
                     
                                            https://example.com/api/v1/customers/id
                                        
Parameters
Name Type Description
id integer Required

Product Reviews

GET
                     
                                    https://example.com/api/v1/product-reviews
                                

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : product-reviews?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
status integer Limit result set to products assigned a specific status. Options 1 or 0
reviewer_id integer Get resuult by specific reviewer id
product_id integer Get resuult by specific product id
target string Get resuult by specific target (options: product)

POST
                     
                                        https://example.com/api/v1/product-reviews
                                    

You need to pass json encode data to create the product reviews

Example
                     
                                        
                                            $data_array =  array(
                                            'page_title' => 'Example title',
                                            'description' => 'Example desc',
                                            'status' =>1
                                             );

                                            $data = json_encode($data_array);
                                        
                                    
Parameters
Name Type Description
object_id integer Required
reviewer_id integer Required
review string Required
rating integer Required
target string Required(Option : product)

PUT
                     
                                        https://example.com/api/v1/product-reviews/id
                                    

You need to pass json encode data to update the product reviews

Example
                     
                                        
                                            $data_array =  array(
                                            'page_title' => 'Example title',
                                            'description' => 'Example desc',
                                            'status' =>1
                                             );

                                            $data = json_encode($data_array);
                                        
                                    
Parameters
Name Type Description
id integer Required

DELETE
                     
                                        https://example.com/api/v1/product-reviews/id
                                    
Parameters
Name Type Description
id integer Required

Reports

GET
                     
                                https://example.com/api/v1/reports
                            

You can pass extra parameters to get the more specific data. For this case you need to add parametres as like the query string. example : product-reviews?per_page=10&search=test

Parameters
Name Type Description
page integer Current page of the collection. Default is 1
per_page integer Maximum number of items to be returned in result set. Default is 15
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
after string Limit response to resources published after a given ('yyyy-mm-dd') compliant date.
before string Limit response to resources published before a given ('yyyy-mm-dd') compliant date.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is id
status integer Limit result set to products assigned a specific status. Options 1 or 0
reviewer_id integer Get resuult by specific reviewer id
product_id integer Get resuult by specific product id
target string Get resuult by specific target (options: product)

POST
                     
                                    https://example.com/api/v1/product-reviews
                                

You need to pass json encode data to create the product reviews

Example
                     
                                    
                                        $data_array =  array(
                                        'page_title' => 'Example title',
                                        'description' => 'Example desc',
                                        'status' =>1
                                         );

                                        $data = json_encode($data_array);
                                    
                                
Parameters
Name Type Description
object_id integer Required
reviewer_id integer Required
review string Required
rating integer Required
target string Required(Option : product)

PUT
                     
                                    https://example.com/api/v1/product-reviews/id
                                

You need to pass json encode data to update the product reviews

Example
                     
                                    
                                        $data_array =  array(
                                        'page_title' => 'Example title',
                                        'description' => 'Example desc',
                                        'status' =>1
                                         );

                                        $data = json_encode($data_array);
                                    
                                
Parameters
Name Type Description
id integer Required

DELETE
                     
                                    https://example.com/api/v1/product-reviews/id
                                
Parameters
Name Type Description
id integer Required