This is a section of API to provide access to registration, customer login and account access.
It is highly recommended to use HTTPS to access this part of API.
Customer Login or authentication confirmation
This API request needs to be done every time customer request to login to get access to customer account or just to confirm that current authentication is still valid and not expired.
Route: a/account/login
Method: POST
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
email or loginname | email address or loginname registered in customer account | Important: If "Require Login Name” is enabled (default), email based login will not work. This param is required for initial login. |
password | customer’s password | This param is required for initial login |
token | Access token ID. This token is provided by the system after successful initial authentication | required to confirm established authentication |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example logon request:
POST: rt=a/account/login , loginname=testlogin , password=123456789
{"status":1,"success":"Logged in","token":"58fb1592f0c59b8dc1d5541aebdff8da"}
{"status":0,"error":"Login attempt failed!"}
Example authentication check request:
POST: rt=a/account/login , token=58fb1592f0c59b8dc1d5541aebdff8da
{ "status":1, "request":"authorized" }
Account Logout
Simple log out request. Token needs to be disregarded from future use.
Route: a/account/logout
Method: POST
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example request:
POST: rt=a/account/logout , token=58fb1592f0c59b8dc1d5541aebdff8da
{ "status":1, "success":"Logged out" }
Customer Account Details
Get basic customer Details.
Route: a/account/account
Method: POST
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example request:
POST: rt=a/account/account , token=58fb1592f0c59b8dc1d5541aebdff8da
{ "title":"My Account", "customer_id":"14", "firstname":"Joe", "lastname":"Doe", "email":"test@test.com", "information":"a\/account\/edit", "history":"a\/account\/history", "newsletter":"a\/account\/logout" }
Customer Account History
Get customer order history.
Route: a/account/history
Method: POST
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example request:
POST: rt=a/account/history , token=58fb1592f0c59b8dc1d5541aebdff8da
{ "orders":[ ], "total_orders":0 }
Edit Customer Account Details
There are 2 steps to edit and save customer details. First step is to get all required fields and existing data. Second step is to provide data to be updated.
Route: a/account/edit
Method: GET
Get all required and optional fields, values and error messages (if any)
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example request:
GET: rt=a/account/edit&token=2f7f30e3efeb0d73744680ac7c0c11e6
{ "fields":{ "firstname":{ "type":"input", "name":"firstname", "value":"First Name", "required":true, "error":null }, "lastname":{ "type":"input", "name":"lastname", "value":"Last Name", "required":true, "error":null }, "email":{ "type":"input", "name":"email", "value":"test@test.com", "required":true, "error":null }, "telephone":{ "type":"input", "name":"telephone", "value":"435435435", "required":true, "error":null }, "fax":{ "type":"input", "name":"fax", "value":"434543543", "required":false }, "newsletter":{ "type":"selectbox", "name":"newsletter", "value":"1", "required":false } } }
Method: POST
Update customer information
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
firstname | Customer’s first name | 32 characters limit |
lastname | Customer’s lastname | 32 characters limit |
Customer’s email address | 96 characters limit | |
telephone | Customer’s telephone number | 32 characters limit |
fax | Customer’s fax number | 32 characters limit |
newsletter | Selection to receive a newsletter | values: 1 to receive and 0 to skip |
Any other | There are other parameters possible to be loaded (from extensions) | |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |
Example request:
POST: firstname=First+Name , lastname=Last+Name , email=test@test.com , telephone=435435435 , fax=434543543 , rt=a/account/edit , token=2f7f30e3efeb0d73744680ac7c0c11e6
{ "status": 1, "text_message":"Success" }
Customer Registration
There are 2 steps to register new customer and save customer details. First step is to get all required fields and provided earlier data (in case of error). Second step is to provide data to be validated and saved.
Route: a/account/create
Method: GET
Get all required and optional fields, values and error messages (if any)
Parameter | Meaning | Notes |
---|---|---|
callback | A JavaScript function to run when the response is received | Optional parameter allows you to specify a JavaScript function to handle query results for pure client-side implementations. Embed the API query in <script> tags. Define the callback function in <script> tags. |
token | Access token ID. This token is provided by the system after successful initial authentication | required |
api_key | Unique API key that is set in the control panel | This is optional key that can be set to limit unauthorized (accidental) access to your API |