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/
curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d '[parameters]'
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[]=149Success 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>
curl -u account_email_here:api_token_here http://www.wazala.com/api/ -d method=get_categoriesSuccess 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>
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=percentSuccess 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>
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>
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>
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-24Success 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>