Wazala Online Store API Documentation

Overview

After subscribing to a paid Wazala online store you'll be given a unique authentication token which you will find in the Account tab of your Store Manager. For every API request you make, you'll need to present this token and your account login email using basic HTTP authentication. Use your account login email as username and API token as password.

The Wazala API has a single point of entry:
http://www.wazala.com/api/


All calls are made using a REST-ful interface. Send a HTTP POST to http://www.wazala.com/api/ with the parameters specified for each call.

Here's an example of an authenticated request made with cURL:
curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d '[parameters]'

Admin API queries

Get Products

Returns your online store product list

Parameters

  • method
    This required parameter must be set to "get_products"
  • status (optional)
    Filter the product list by one or more statuses. Set as array with these possible values: active, back order, coming soon, sold out, hidden
  • category (optional)
    Filter the product list by one or more categories. Set as array with categories id's

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_products -d status[]=active -d status[]='coming soon' -d category[]=149
	
Success Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="ok">
		<products total="14">
			<product>
					<product_id>1</product_id>
					<name>Product Name</name>
					<description>Full Product Description</description>
					<price>113.90</price>
					<status>Coming Soon</status>
					<tags>toys, kids, speedcar, racer</tags>

					<shippable>yes</shippable>
					<downloadable>no</downloadable>
					<taxable>yes</taxable>
					<categories>
						<category category_id="149">Toys</category>
					</categories>
			</product>

			....
		</products>
		</response>
	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

Get Categories

Returns your online store category list

Parameters

  • method
    This required parameter must be set to "get_categories"

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_categories
	
Success Response:
	<?xml version="1.0" encoding="utf-8"?>
	<response status="ok">
		<categories total="3">
			<category>
				<category_id>149</category_id>
				<name>Toys</name>
				<description>full description</description>
				<status>Active</status>
			</category>
			......
		</categories>
	</response>
	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

Get Coupons

Returns your online store coupon list

Parameters

  • method
    This required parameter must be set to "get_coupons"
  • start_date (optional)
    Return coupons with a start date greater or equal to the given parameter value. Must be in Y-m-d format.
  • expire_date (optional)
    Return coupons with an expiry date lower or equal to the given parameter value. Must be in Y-m-d format.
  • discount_type (optional)
    Available values: flat, percent. Filter coupons list by one of these discount types.

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_coupons -d start_date=2011-01-24 -d expire_date=2012-12-31 -d discount_type=percent
	
Success Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="ok">
			<coupons total="14">
				<coupon assign_to="all" single_use="no">
					<coupon_id>1300</coupon_id>
					<code>AAAAAA</code>
					<discount_type>Flat Value</discount_type>
					<discount_value>30.00</discount_value>
					<start_date>2011-02-01</start_date>
					<expire_date>2011-06-10</expire_date>
				</coupon>
				<coupon assign_to="product" product_id="12145" single_use="no">
					<coupon_id>1301</coupon_id>
					<code>AAAAAA</code>
					<discount_type>Percent</discount_type>
					<discount_value>3</discount_value>
					<start_date>2011-02-09</start_date>
					<expire_date>2011-07-14</expire_date>
					<product>Assigned product name</product>
				</coupon>
				<coupon assign_to="category" category_id="2232" single_use="no">
					<coupon_id>1306</coupon_id>
					<code>AAAAA</code>
					<discount_type>Percent</discount_type>
					<discount_value>21</discount_value>
					<start_date>2011-06-07</start_date>
					<expire_date>2011-07-07</expire_date>
					<category>Assigned category name</category>
				</coupon>
				.......
			</coupons>
		</response>
	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

Get Customers

Returns your online store customer list

Parameters

  • method
    This required parameter must be set to "get_customers"
  • last_order_date (optional)
    Filter customers based on the last order date.
    If it is sent as array then the first array element will be used for the start date range and the second element is used for the end date range.
    If the first element is blank then only the end date range is used and if the second element is blank then only the start date range is used.
    If it is a set as a date value then filter will be set to return only the customers with last order date equal with the parameter value
    All dates must be set in Y-m-d format
  • orders (optional)
    Filter customers based on the total number of orders.
    If it is sent as array then the first array element will be used as minimum orders no. and the second element is used for the maximum orders no.
    If the first element is blank then only the maximum range is used and if the second element is blank then only the minimum range is used.
    If it is a set as a number value then filter will be set to return only the customers that have a total number of orders equal with the parameter value
  • amount (optional)
    Filter customers based on the total amount of orders.
    If it is sent as array then the first array element will be used as minimum orders amount and the second element is used for the maximum orders amount.
    If the first element is blank then only the maximum range is used and if the second element is blank then only the minimum range is used.
    If it is a set as a number value then filter will be set to return only the customers that have a total orders amount equal with the parameter value
  • search (optional)
    Filter customers based on the given search term. Search is made in name, email and address fields.

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_customers -d last_order_date=2011-05-24 -d orders[]=50 -d orders[]=100 -d amount[]=300 -d search='los angeles'
	
Success Response:

		<?xml version="1.0" encoding="utf-8"?>
		<response status="ok">
			<customers total="4">
				<customer>
					<customer_id>10000</customer_id>
					<name>customer full name</name>
					<email>customer email</email>
					<phone>phone number</phone>
					<last_order_date>2011-05-24 12:31:07</last_order_date>
					<orders_no>60</orders_no>
					<orders_amount>5023.30</orders_amount>
					<address-street></address-street>
					<address-extended></address-extended>
					<city>Los Angeles</city>
					<state>CA</state>
					<postal-code></postal-code>
					<country-code>US</country-code>
				</customer>
				....
			</customers>
		</response>

	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

Get Orders

Returns your online store orders list

Parameters

  • method
    This required parameter must be set to "get_orders"
  • start_date (optional)
    Return orders created after the given parameter value. Must be in Y-m-d format.
  • end_date (optional)
    Return orders created until the given parameter value. Must be in Y-m-d format.
  • status (optional)
    Filter order list by one or more statuses. Set as array with this possible values: new, hold, shipped, canceled, pending
  • search (optional)
    Filter orders based on the given search term. Search is made in order no., customer name, email and address fields.

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_orders -d start_date=2011-05-24 -d end_date=2011-12-24 -d status[]=new -d status[]=pending -d search='los angeles'
	
Success Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="ok">
			<orders total="17">
				<order>
					<order_id>14272</order_id>
					<name>client name</name>
					<email>client email</email>
					<phone>client phone</phone>
					<purchase-date>2011-07-26 23:41:32</purchase-date>
					<order-no>100001</order-no>
					<status>Shipped</status>
					<items-total>124.00</items-total>
					<shipping-total>10.00</shipping-total>
					<tax-total>3.00</tax-total>
					<order-total>137.00</order-total>
				</order>
				.....
			</orders>
		</response>
	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

Get Statistics

Returns your online store statistic values

Parameters

  • method
    This required parameter must be set to "get_stats"
  • start_date (optional)
    Get statistics after the given value. Must be in Y-m-d format.
  • end_date (optional)
    Get statistics before the given value. Must be in Y-m-d format.

Example:

Request:
		curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_stats -d start_date=2011-05-24 -d end_date=2011-12-24
	
Success Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="ok">
			<stats>
				<orders amount="932.44">42</orders>
				<favorites amount="29.3">13</favorites>
				<widget-views>377</widget-views>
			</stats>
		</response>
	
Error Response:
		<?xml version="1.0" encoding="utf-8"?>
		<response status="fail">
			<error>Error message</error>
		</response>
	

If you need help or have questions email with your request

Back to Wazala Online Store API