API Documentation
(Public APIs only)
HTTP request headers
Following are the commonly used request headers.
api_key : api_key
Used to identify if client has access to apis. api_key is obtained when creating account. It must be sent with all requests.
Accept: application/format
Represents the format of response data returned. Commonly used format is json.
access_token: access_token
Represents the authorization of app/user. It must be sent with all requests except authentication and forgot password. User can retrieve access_token on successful authentication.
Content-Type: application/format
Represents the format of request body. Commonly used format is application/x-www-form-urlencoded
HTTP response status codes
Following are the commonly used status codes.
- 200 OK - The request succeeded.
- 201 Created - A POST method successfully created a resource.
- 204 No Content - The server successfully executed the method but returns no response body.
- 400 Bad Request - Request is not well-formed, syntactically incorrect, or violates schema.
- 401 Unauthorized - Authentication failed due to invalid authentication credentials.
- 403 Forbidden - Authorization failed due to insufficient permissions.
- 404 Not Found - The specified resource does not exist.
- 405 Method Not Allowed - The server does not implement the requested HTTP method.
- 422 Unprocessable Entity - The API cannot complete the requested action, or the request action is semantically incorrect or fails business validation.
- 500 Internal Server Error - An internal server error has occurred.
HTTP response for successful requests
Returns HTTP 2xx status code with status true. If response body contains data, it will be enclosed in data attribute as json.
{
"status": true,
"data":
}
HTTP response for failed requests
Returns HTTP 4xx or 5xx status code with status false.
{
"status": false,
"error": {
"code": "",
"description": ""
}
}
HTTP response for validation errors
Returns HTTP 422 Unprocessable Entity status code with status false.
{
"status": false,
"error": {
"code": "1003",
"description": "Incorrect input format / validation error",
"fields": {
"": "",
"": "",
}
}
}
Custom Error Codes
- 1001 - Invalid API Key
- 1002 - Invalid Access Token
- 1003 - Invalid Credentials / Invalid Username or Password
- 1004 - Incorrect Input Format / Validation Error
- 1005 - Login Blocked
- 1006 - Registration Blocked
- 1007 - Invalid Sponsor Username
- 1008 - Position Not Usable / Position Already Filled
- 1009 - Invalid Placement
- 1010 - Username Not Available / Username Already Exists
- 1011 - Invalid Username / Username Not Found
- 1012 - Product Not Available
- 1013 - Incorrect Date Format
- 1014 - Insufficient E-wallet Balance
- 1015 - Incorrect Transaction Password
- 1016 - Invalid E-pin Code
- 1017 - File Type Not Supported
- 1018 - File Size Exceeded
- 1019 - KYC Not Verified
List of APIs
Get access token
Authenticate the user with the system and obtain the access_token.
Request
Method |
URL |
POST |
auth/access/ |
Type |
Params |
Data Type |
Required |
POST |
username |
string |
yes |
POST |
password |
string |
yes |
Response
Status |
Params |
Data Type |
200 |
access_token |
string |
Register new user
Add new user into the system.
Request
Type |
Params |
Data Type |
Required |
POST |
sponsor_username |
String |
Yes |
POST |
placement_username |
String |
Yes |
POST |
position |
String |
Yes |
POST |
product_id |
Integer |
Yes |
POST |
Firstname |
String |
Yes |
POST |
lastname |
String |
Yes |
POST |
date_of_birth |
String |
Yes |
POST |
email |
String |
Yes |
POST |
mobile |
String |
Yes |
POST |
username |
String |
Yes |
POST |
password |
String |
Yes |
POST |
password_confirmation |
String |
Yes |
POST |
agree_terms |
boolean |
Yes |
POST |
payment_method |
String |
Yes |
- postion is used only in binary mlm plan. Possible values are L (left), R (right).
- date_of_birth must be in yyyy-mm-dd format.
- product_id is unique id of membership package.
- username is not used in case of dynamic username type.
- payment_method : Possible values are free_join, ewallet, epin.
- agree_terms : Value must be true.
Response
Status |
Params |
Data Type |
201 |
username/ |
string |
Get profile information
Retrieve user profile details.
Request
Response
Status |
Params |
Data Type |
200 |
username |
String |
200 |
rank_name |
String |
200 |
profile_image |
String |
200 |
placement_user |
String |
200 |
sponsor_user |
String |
200 |
position |
String |
200 |
membership_package |
String |
200 |
firstname |
String |
200 |
lastname |
String |
200 |
gender |
String |
200 |
date_of_birth |
String |
200 |
address_line1 |
String |
200 |
address_line2 |
String |
200 |
country |
String |
200 |
state |
String |
200 |
city |
String |
200 |
zip_code |
String |
200 |
email |
String |
200 |
mobile |
String |
200 |
landline |
String |
200 |
bank_name |
String |
200 |
branch_name |
String |
200 |
account_holder |
String |
200 |
account_number |
String |
200 |
ifsc |
String |
200 |
pan |
String |
Upload profile image
- Upload profile picture.
- Request headers
Content-Type : multipart/form-data
Request
Method |
URL |
GET |
profile/image/ |
Type |
Params |
Data Type |
Required |
POST |
image |
file |
yes |
Response
Status |
Params |
Data Type |
204 |
|
|
Update personal information
Update profile personal details.
Request
Method |
URL |
PUT |
profile/personal/ |
Type |
Params |
Data Type |
Required |
PUT |
firstname |
string |
yes |
PUT |
lastname |
string |
no |
PUT |
gender |
string |
yes |
PUT |
date_of_birth |
string |
yes |
- gender : Possible values are M (Male), F (Female).
- date_of_birth must be in yyyy-mm-dd format.
Response
Status |
Params |
Data Type |
204 |
|
|
Update contact information
Update profile contact details.
Request
Method | URL |
PUT | profile/contact/ |
Method | URL | Method | URL |
PUT | address_line1 | string | yes |
PUT | address_line2 | string | no |
PUT | country | integer | yes |
PUT | state | integer | no |
PUT | city | string | yes |
PUT | zip_code | string | no |
PUT | email | string | yes |
PUT | mobile | string | yes |
PUT | landline | string | no |
Response
Status | Params | Data Type |
204 | | |
Update bank information
Update profile bank details.
Request
Method | URL |
PUT | profile/personal/ |
Type | Params | Data Type | Required |
PUT | bank_name | string | no |
PUT | branch_name | string | no |
PUT | account_holder | string | no |
PUT | account_number | string | no |
PUT | ifsc | string | no |
PUT | pan | string | no |
Response
Status | Params | Data Type |
204 | | |
Change password
Change login password
Request
Method | URL |
PUT | profile/personal/ |
Type | Params | Data Type | Required |
PUT | current_password | string | yes |
PUT | new_password | string | yes |
PUT | password_confirmation | string | yes |
Response
Status | Params | Data Type |
204 | | |
Forgot password
Reset option for forgotten login password. Successful response will send an email to user containing password reset link.
Request
Method | URL |
POST | profile/personal/ |
Type | Params | Data Type | Required |
POST | ccccc | string | yes |
Response
Status | Params | Data Type |
204 | | |
Change transaction password
Change ewallet transaction password.
Request
Method | URL |
PUT | ewallet/password/ |
Type | Params | Data Type | Required |
PUT | current_password | string | yes |
PUT | new_password | string | yes |
PUT | password_confirmation | string | yes |
Response
Status | Params | Data Type |
204 | | |
Forgot transaction password
Reset option for forgotten ewallet transaction password. Successful response will send an email to user containing password reset link.
Request
Method | URL |
POST | ewallet/password/forget/ |
Response
Status | Params | Data Type |
204 | | |
Get ewallet balance
Get current ewallet balance of user.
Request
Method | URL |
POST | ewallet/balance/ |
Response
Status | Params | Data Type |
200 | balance | number |
Order complete
Complete an order.
Request
Type | Params | Data Type | Required |
POST | order_id | string | yes |
POST | total_amount | number | yes |
POST | total_quantity | string | yes |
POST | total_pv | number | yes |
- total_amount : Total order price.
- total_quantity : Total products quantity in the order.
- total_pv : Total pv/bv (points allocated for commission) in the order.
Response
Status | Params | Data Type |
204 | | |
Purchase using ewallet
Purchase/payment using users ewallet balance.
Request
Method | URL |
POST | ewallet/payment/ |
Type | Params | Data Type | Required |
POST | payment_amount | number | yes |
POST | purpose | string | yes |
POST | ewallet_username | string | yes |
POST | transaction_password | string | yes |
- purpose : Possible values are purchase.
Response
Status | Params | Data Type |
204 | | |
Purchase using epin
Purchase/payment using users allocated epin code.
Request
Method | URL |
POST | epin/payment/ |
Type | Params | Data Type | Required |
POST | payment_amount | number | yes |
POST | epin_code | string | yes |
Response
Status | Params | Data Type |
204 | | |
Get membership packages
Get list of active membership packages in the system.
Request
Method | URL |
GET | package/membership/ |
Response
Status | Params | Data Type |
200 | products | array |
products array: json format
Params | Data Type |
id | integer |
name | string |
amount | number |
Get signup fee
Get signup fee in the system
Request
Method | URL |
POST | signup/fee/ |
Response
Status | Params | Data Type |
200 | fee | number |
Get cart/purchase packages
Get list of active cart(purchase) packages in the system.
Request
Method | URL |
POST | package/cart/ |
Response
Status | Params | Data Type |
200 | products | array |
products array: json format
Params | Data Type |
id | integer |
name | string |
amount | number |
pv | number |
category | string |
image | string |
Get package details
Get details of specific package.
Request
Method | URL |
GET | package/{id}/ |
- id : Unique product_id of the package.
Response
Status | Params | Data Type |
200 | id | integer |
200 | name | string |
200 | amount | number |
200 | package_id | string |
200 | pv | number |
200 | category | string |
200 | image | string |
200 | description | string |
Add product to cart
Add a product to shopping cart.
Request
Method | URL |
POST | cart/products/ |
Type | Params | Data Type | Required |
POST | product_id | integer | yes |
POST | quantity | integer | yes |
Response
Status | Params | Data Type |
204 | | |
Remove product from cart
Remove a product from shopping cart.
Request
Method | URL |
POST | cart/products/ |
Type | Params | Data Type | Required |
DELETE | product_id | integer | yes |
Response
Status | Params | Data Type |
204 | | |
Clear cart products
Remove all products from shopping cart.
Request
Method | URL |
POST | cart/products/all/ |
Response
Status | Params | Data Type |
204 | | |
Get products in cart
Get product items added in cart.
Request
Method | URL |
POST | cart/products/ |
Response
Status | Params | Data Type |
204 | cart_items | array |
cart_items array: json format
Params | Data Type |
product_id | integer |
product_name | string |
product_amount | number |
quantity | number |
Add shipping address
Add shipping address for checkout.
Request
Method | URL |
POST | cart/shipping_address/ |
Response
Type | Params | Data Type | Required |
POST | name | string | yes |
POST | address | string | yes |
POST | zip_code | string | yes |
POST | city | string | yes |
POST | phone | string | yes |
Response
Status | Params | Data Type |
204 | | |
Remove shipping address
Remove shipping address.
Request
Method | URL |
DELETE | cart/shipping_address/ |
Type | Params | Data Type | Required |
DELETE | address_id | integer | yes |
Response
Status | Params | Data Type |
204 | | |
Get list of shipping address
Get all shipping address list for checkout.
Request
Method | URL |
GET | cart/shipping_address/ |
Response
Status | Params | Data Type |
200 | address_list | array |
address_list array: json format
Params | Data Type |
address_id | integer |
name | string |
address | string |
zip_code | string |
city | string |
phone | string |
Set default shipping address
Choose default shipping address for checkout.
Request
Method | URL |
POST | cart/shipping_address/default |
Type | Params | Data Type | Required |
POST | address_id | integer | yes |
Response
Status | Params | Data Type |
204 | | |
Cart checkout
Complete cart checkout process.
Request
Method | URL |
POST | cart/checkout/ |
Type | Params | Data Type | Required |
204 | xxx | xxx | xxx |
Response
Status | Params | Data Type |
204 | | |