Introduction
Welcome to Asalta Developer Console, the Asalta API central. Here you can use our API to access Asalta API endpoints, which can get information on asalta products.
Asalta uses API keys to allow access to the API. You can register a new Asalta API key at our developer portal.
We have language bindings in Shell! You can view code examples in the dark area to the right.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl 'https://api.asalta.com/<apiEndpoint>' \
-H 'Authorization: Bearer XXXXXX' \
Make sure to replace
XXXXXX
with your access token.
Asalta API uses OAuth2 Protocol for API access. It expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer XXXXXX;
Content-Type: application/x-www-form-urlencoded;
Accept: application/json;
Link your application
OAuth2 exposes three specific endpoints, and one for metadata.
authorize_uri - https://api.asalta.com/auth
access_token_uri - https://api.asalta.com/auth/token
base_url - https://api.asalta.com/
OAuth2 Flow
- To start your application's connection to Asalta API, start by sending the user to the
authorize_uri
. - The user will input their username and password to approve your application.
- After the user authorizes your application, our server will redirect your user back to the
redirect_uri
, along with a code you can exchange for an access_token. The code is valid for 30 seconds. - Your application should then make an out-of-band request to the
access_token_uri
using the code our server provided. - Our server returns an access_token, which completes the official OAuth2 flow.
Request body parameters
Parameter | Type | Description |
---|---|---|
client_id | String | The client's unique id/username for authorization. |
client_secret | String | The client password for authorization. |
redirect_uri | Url | Once application is authenticated User will redirected to this URI with code parameter to fetch access token |
Response body parameters
Parameter | Type | Description |
---|---|---|
access_token | String | The access token issued by the auth server |
Our Product
Asalta api provide 4 type product. One API key access to one product.
Asalta HRM
Asalta HRM APIs.
Payroll
Payroll API provide monthly report
curl 'https://api.asalta.com/report/payroll' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
The above command returns JSON structured like this:
{
"payslip_date": "2015-07-01",
"basic_salary": "49520.00",
"gross_salary": "50270.00",
"net_pay": "48508.50",
"employer_cpf": "4293.00",
"employee_cpf": "4260.00"
}
This endpoint retrieves all payroll.
HTTP Request
POST https://api.asalta.com/report/payroll
Post Parameters
Parameter | Type | Description |
---|---|---|
month | Number | If set to month, Ex: 12. |
year | Number | If set to year, Ex: 2016. |
Claims
Claims API provide monthly claim details.
curl 'https://api.asalta.com/report/claims' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
The above command returns JSON structured like this:
{
"Phone": {
"total_expense": "200.00"
},
"Travelling": {
"total_expense": "2000.50"
}
}
This endpoint retrieves a claims.
HTTP Request
POST https://api.asalta.com/report/claims
URL Parameters
Parameter | Type | Description |
---|---|---|
month | Number | If set to month, Ex: 3. |
year | Number | If set to year, Ex: 2016. |
Roster Schedule
Roster Schedule API provide between two dates.
curl 'https://api.asalta.com/report/rosterschedule' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
The above command returns JSON structured like this:
{
{
"branch": "Branch 3",
"employees": [
{
"name": "George Smith",
"shift": "Shift 6",
"facility": "Parking",
"working_date": "2016-06-05",
"start_time": "10:00",
"end_time": "14:30",
"totaltime": "04.30",
"status": "Working",
"created_at": "2016-06-06 12:25:20"
},
]
},
{
"branch": "Branch 2",
"employees": [
{
"name": "Charlie",
"shift": "Shift 4",
"facility": "Lodge",
"working_date": "2016-06-05",
"start_time": "06:30",
"end_time": "09:30",
"totaltime": "03.00",
"status": "Working",
"created_at": "2016-06-06 13:34:20"
},
{
"name": "Charlie",
"shift": "Shift 5",
"facility": "Parking",
"working_date": "2016-06-05",
"start_time": "12:00",
"end_time": "15:00",
"totaltime": "03.00",
"status": "Working",
"created_at": "2016-06-06 13:37:04"
}
]
}
}
This endpoint retrieves a roster schedule.
HTTP Request
POST https://api.asalta.com/report/rosterschedule
URL Parameters
Parameter | Type | Description |
---|---|---|
startdate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-01. |
enddate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-27. |
Asalta CRM
Asalta CRM api provide report for invoices
curl 'https://api.asalta.com/report/invoices' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
The above command returns JSON structured like this:
[
{
"invoice_no": "ASALTA2016001TECHNOLOGY",
"organization": "Asalta",
"name": "Jackson",
"invoice_date": "2016-04-11",
"due_date": "2016-04-11",
"email": "[email protected]",
"gst_amount": "0.00",
"total_amount": "23232.00",
"outstanding_amount": "0.00",
"terms": "24",
"payment_details": [
{
"payment_type": "Cheque",
"paid_amount": "10.00",
"paymentdue": "Partial Amount Paid",
"paid_date": "2016-04-05"
},
{
"payment_type": "Cheque",
"paid_amount": "19536.00",
"paymentdue": "Full Amount Paid",
"paid_date": "2016-05-18"
}
]
},
{
"invoice_no": "ASALTA2016002TECHNOLOGY",
"organization": "Asalta",
"name": "Sam",
"invoice_date": "2016-04-15",
"due_date": "2016-04-15",
"email": "[email protected]",
"gst_amount": "0.00",
"total_amount": "845452.00",
"outstanding_amount": "845352.00",
"terms": "7",
"payment_details": [
{
"payment_type": "Cheque",
"paid_amount": "100.00",
"paymentdue": "Partial Amount Paid",
"paid_date": "2016-05-18"
}
]
}
]
This endpoint retrieves all invoices.
HTTP Request
POST https://api.asalta.com/report/invoices
Post Parameters
Parameter | Type | Description |
---|---|---|
startdate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-01. |
enddate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-27. |
Asalta Inventory & POS
Asalta Inventory & POS APIs.
- Categories
- Subcategories
- Warehouses
- Customer Groups
- Billers
- Customers
- Items
- Promotions
- Tax Rates
- Invoices
- Payment Methods
- Payments
- Return Invoices
- Orders
- Return Orders
- Void Order
- Gift Cards
- Report Sales
- Possible Errors
Categories
Categories API provide all / one categories list
Get All
curl 'https://api.asalta.com/pos/categories' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/categories", "GET", []);
?>
The above command returns JSON structured like this:
{
"data":[
{
"id":"1",
"category_code":"C-1",
"category_name":"Category1",
"image":null
},
{
"id":"2",
"category_code":"C-2",
"category_name":"Category2",
"image":"myapp.com/myimage.jpg"
}
],
"_links":{
"self" : {
"href":"https://api.asalta.com/pos/categories
?access_token=XXXXXX&page=n"
}
},
"_meta": {
"totalCount":11,
"pageCount":1,
"currentPage":1,
"perPage":20
}
}
This endpoint retrieves all categories.
HTTP Request
GET https://api.asalta.com/pos/categories
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/categories?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/categories?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"15",
"category_code":"C-1",
"category_name":"Category1",
"image":"https://myapp.com/a93fedc3395b9682e5440e0de11ca5ca.jpg"
}
This endpoint retrieves one categoroy detail.
HTTP Request
GET https://api.asalta.com/pos/categories?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid category id |
Subcategories
Subcategories API provide all / one Subcategories list
Get All
curl 'https://api.asalta.com/pos/subcategories' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/subcategories", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id":"106",
"sub_category_code":"SC1",
"sub_category_name":"Sub category 1",
"parent_category_id":"105",
"image":null
},
{
"id":"109",
"sub_category_code":"SC2",
"sub_category_name":"Sub category 2",
"parent_category_id":"105",
"image":"https://myapp.com/78c412e10d0d60848e9aae89f06f09a8.jpg"
}
],
"_links": {
"self": {
"href":"https://api.asalta.com/pos/
subcategories?access_token=xxx&parent_category_id=n
&page=n"
}
},
"_meta": {
"totalCount":2,
"pageCount":1,
"currentPage":1,
"perPage":20
}
]
This endpoint retrieves all subcategories.
HTTP Request
GET https://api.asalta.com/pos/subcategories
Query Parameters
Parameter | Type | Description |
---|---|---|
category_id | Number | Valid category id |
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/subcategories?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/subcategories?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"106",
"sub_category_code":"SC1",
"sub_category_name":"Sub category 1",
"parent_category_id":"105",
"image":null
}
This endpoint retrieves one subcategories detail based on subcategory id.
HTTP Request
GET https://api.asalta.com/pos/subcategories?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid subcategory id |
Get all Subcategories by Parent Category
curl 'https://api.asalta.com/pos/subcategories
?parent_category_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/subcategories?parent_category_id=n", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"106",
"sub_category_code":"SC1",
"sub_category_name":"Sub category 1",
"parent_category_id":"105",
"image":null
},
{
"id":"109",
"sub_category_code":"SC2",
"sub_category_name":"Sub category 2",
"parent_category_id":"105",
"image":"https://myapp.com/78c412e10d0d60848e9aae89f06f09a8.jpg"
}
],
"_links": {
"self":{
"href":"https://api.asalta.com/pos/
subcategories?access_token=XXXXXX&parent_category_id=n
&page=n"
}
},
"_meta": {
"totalCount":2,
"pageCount":1,
"currentPage":1,
"perPage":20
}
]
This endpoint retrieves multiple subcategories detail based on parent category id.
HTTP Request
GET https://api.asalta.com/pos/subcategories?parent_category_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
parent_category_id | Number | Valid parent category id |
Warehouses
Warehouses API provide all / one warehouses list
Get All
curl 'https://api.asalta.com/pos/warehouses' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/warehouses", "GET", []);
?>
The above command returns JSON structured like this:
{
"data": [
{
"id":"2",
"code":"1",
"name":"Warehouse 1",
"image":null,
"warehouse_type":"Warehouse",
"address":"Warehouse 1 Address",
"phone":null,
"email":null,
"discount":"yes",
"store_margin":null
},
{
"id":"3",
"code":"4",
"name":"Warehouse 2",
"image":null,
"warehouse_type":null,
"address":"Warehouse 2 address",
"phone":null,
"email":null,
"discount":null,
"store_margin":null
}
],
"_links":{
"self": {
"href":"https://api.asalta.com/pos/warehouses
?access_token=XXXXXX&page=n"
}
},
"_meta": {
"totalCount":10,
"pageCount":1,
"currentPage":1,
"perPage":20
}
}
This endpoint retrieves all warehouses.
HTTP Request
GET https://api.asalta.com/pos/warehouses
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/warehouses?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/warehouses?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"4",
"code":"5",
"name":"WAREHOUSE 3",
"image":null,
"warehouse_type":null,
"address":"Warehouse 3 address",
"phone":null,
"email":null,
"discount":null,
"store_margin":null
}
This endpoint retrieves one warehouse detail.
HTTP Request
GET https://api.asalta.com/pos/warehouses?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid warehouse id |
Customer Groups
Customer Groups API provide all / one customer group list
Get All
curl 'https://api.asalta.com/pos/customer_groups' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/customer_groups", "GET", []);
?>
The above command returns JSON structured like this:
{
"data": [
{"id":"1","name":"General"},
{"id":"2","name":"Reseller"}
],
"_links": {
"self": {
"href":"https://api.asalta.com/pos/
customer_groups?access_token=XXXXXX&page=n"
},
"next": {
"href":"https://api.asalta.com/pos/
customer_groups?access_token=XXXXXX&page=n"
},
"last": {
"href":"https://api.asalta.com/pos/
customer_groups?access_token=XXXXXX&page=n"
}
},
"_meta": {
"totalCount":5,
"pageCount":3,
"currentPage":1,
"perPage":2
}
}
This endpoint retrieves all customer group.
HTTP Request
GET https://api.asalta.com/pos/customer_groups
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/customer_groups?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/customer_groups?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"3",
"name":"Distributor"
}
This endpoint retrieves one customer group detail.
HTTP Request
GET https://api.asalta.com/pos/customer_groups?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid customer group id |
Billers
Billers API provide all / one billers list
Get All
curl 'https://api.asalta.com/pos/billers' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/billers", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"4961",
"name":"biller 1",
"group_name":"biller",
"company_details": {
"name":"Asalta Technologies",
"vat_no":"65656532"
},
"profile": {
"city":null,
"state":null,
"postal_code":"600018",
"address":"WIS@Changi, 116 Changi Road ",
"phone_code":null,
"phone":"6543213",
"email":"[email protected]",
"image":"https://myapp.com/bc3b4fa80a215000.png"
},
"allowed_warehouse": ["2","4"]
},
{
"id":"4963",
"name":"biller 2",
"group_name":"biller",
"company_details": {
"name":"Asalta Technologies",
"vat_no":"65656532"
},
"profile": {
"city":null,
"state":null,
"postal_code":"600018",
"address":"WIS@Changi, 116 Changi Road ",
"phone_code":null,
"phone":"6543213",
"email":"[email protected]",
"image":"https://myapp.com/bc3b4fa80a215000.png"
},
"allowed_warehouse":["2","4"]
},
],
"_metadata": {
"currentPage":4,
"nextPage":5,
"totalPage":104,
"totalRecord":208
}
]
This endpoint retrieves all billers.
HTTP Request
GET https://api.asalta.com/pos/billers
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/billers?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/billers?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"7189",
"name":"biller1",
"group_name":"biller",
"company_details": {
"name":" ",
"vat_no":null
},
"profile": {
"city":"City",
"state":"State",
"postal_code":"132342",
"address":"Address",
"phone_code":"65",
"phone":"1234567",
"email":"[email protected]",
"image":"https://myapp.com/"
},
"allowed_warehouse":["2","4"]
}
This endpoint retrieves one biller detail.
HTTP Request
GET https://api.asalta.com/pos/billers?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid billers id |
Customers
Customers API provide all / one customers list
Get All
curl 'https://api.asalta.com/pos/customers' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/customers", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"5173",
"name":"customer",
"customer_group_id":"1",
"customer_group_name":"General",
"profile": {
"city":null,
"state":null,
"postal_code":null,
"address":null,
"phone_code":"65",
"phone":null,
"email":null,
"image":"https://myapp.com/logo.png"
},
"loyalty": {
"point": 0,
"amount": 0
}
}
],
"_metadata": {
"currentPage":1,
"nextPage":null,
"pageSize":2,
"totalRecord":1
}
]
This endpoint retrieves all customers.
HTTP Request
GET https://api.asalta.com/pos/customers
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/customers?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/customers?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"5173",
"name":"customer",
"customer_group_id":"1",
"customer_group_name":"General",
"profile": {
"city":null,
"state":null,
"postal_code":null,
"address":null,
"phone_code":"65",
"phone":null,
"email":null,
"image":"https://myapp.com/logo.png"
},
"loyalty": {
"point": 0,
"amount": 0
}
}
This endpoint retrieves one customer detail.
HTTP Request
GET https://api.asalta.com/pos/customers?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid customers id |
New Customer
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"name": "John",
"phone_code": 65,
"phone": 12345678,
"email": "[email protected]",
"option_type": "Item",
"customer_group_id": 3,
"company": null,
"vat_no": null,
"date_of_birth": null,
"address": null,
"city": null,
"state": null,
"postal_code": null,
"country": "Singapore"
}' \
'https://api.asalta.com/pos/customers'
<?php
$data = [
'name' => 'rainstar',
'phone_code' => 91,
'phone'=> null,
'email'=> "[email protected]",
'option_type'=> 'Item',
'customer_group_id'=> 3,
'company'=> NULL,
'vat_no'=> NULL,
'date_of_birth'=> NULL,
'address'=> NULL,
'city'=> NULL,
'state'=> NULL,
'postal_code'=> NULL,
'country'=> 'India',
'status'=> 'Active',
];
$oAuth2Client->api("pos/customers", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"id":7199,
"name":"New Customer"
},
"error":false
}
This endpoint will create a new customer.
HTTP Request
POST https://api.asalta.com/pos/customers
Post Parameters
Parameter | Type | Description |
---|---|---|
name | String | Required |
customer_group_id | Number | Optional |
option_type | String | Its to be use 'Item' OR 'Service' |
phone_code | Number | Optional |
phone | Number | Optional |
String | Optional | |
company | String | Optional |
vat_no | String | Optional |
date_of_birth | Date | Optional |
address | String | Optional |
city | String | Optional |
state | String | Optional |
postal_code | Number | Optional |
country | String | Optional |
Update Customer
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"id": 7199,
"name": "John",
"phone_code": 65,
"phone": 12345678,
"email": "[email protected]",
"option_type": "Item",
"customer_group_id": 3,
"company": null,
"vat_no": null,
"date_of_birth": null,
"address": null,
"city": null,
"state": null,
"postal_code": null,
"country": "Singapore"
}' \
'https://api.asalta.com/pos/customers'
<?php
$data = [
'id': 7199,
'name' => 'rainstar',
'phone_code' => 91,
'phone'=> null,
'email'=> "[email protected]",
'option_type'=> 'Item',
'customer_group_id'=> 3,
'company'=> NULL,
'vat_no'=> NULL,
'date_of_birth'=> NULL,
'address'=> NULL,
'city'=> NULL,
'state'=> NULL,
'postal_code'=> NULL,
'country'=> 'India',
'status'=> 'Active',
];
$oAuth2Client->api("pos/customers", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"id":7199,
"name":"New Customer"
},
"error":false
}
This endpoint will update a customer detail.
HTTP Request
POST https://api.asalta.com/pos/customers
Post Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid customers id |
name | String | Required |
customer_group_id | Number | Optional |
option_type | String | Its to be use 'Item' OR 'Service' |
phone_code | Number | Optional |
phone | Number | Optional |
String | Optional | |
company | String | Optional |
vat_no | String | Optional |
date_of_birth | Date | Optional |
address | String | Optional |
city | String | Optional |
state | String | Optional |
postal_code | Number | Optional |
country | String | Optional |
Loyalty
curl 'https://api.asalta.com/pos/loyalty?customer_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/loyalty?customer_id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"data": [
{
"reference_no": "SALE/POS/2018/05/6943",
"customer_id": "5",
"status": "earned",
"point": "100",
"amount": "100.00",
"expired_date": "2019-05-25"
},
{
"reference_no": "SALE/POS/2018/05/6942",
"customer_id": "5",
"status": "redeemed",
"point": "-100",
"amount": "-100.00"
},
{
"reference_no": "RETURNSL/2018/05/6948",
"customer_id": "5",
"status": "returned",
"point": "100",
"amount": "100.00",
"expired_date": null
},
{
"reference_no": "SALE/2018/05/6948",
"customer_id": "5",
"status": "expired",
"point": "100",
"amount": "100.00",
"expired_date": "2018-05-25"
}
],
"_metadata": {
"currentPage": 1,
"nextPage": null,
"pageSize": 20,
"totalRecord": 4
}
}
This endpoint will list of loyalty.
HTTP Request
GET https://api.asalta.com/pos/loyalty?customer_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
customer_id | Number | Required |
Items
Items API provide list of all items and get per item detail
There are 4 Types of Items Available, namely standard, service, bundle, digital
- Item type standard is physical product with and without variants(Eg. Large, Small).
- Item type service is service based product.
- Item type bundle is Group of standard Items, Will be sold based on Mandatory/Optional Items.
-
Item type digital is virtual Item.
- Get All
- Get one
Get All
curl 'https://api.asalta.com/pos/items' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/items", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"60",
"name":"PREMIUM BUDLE 3",
"code":"919738",
"type":"bundle",
"image":null,
"barcode_symbology":"code128",
"unit":null,
"cost":"1792.0000",
"price":"1108.0000",
"quantity":"0",
"promo_price":"0.0000",
"promo_eligible":"Disable",
"product_details":"product_details",
"details":null,
"file":null,
"custom_fields": {
"cf1":null,
"cf2":null,
"cf3":null,
"cf4":null,
"cf5":null,
"cf6":null
},
"category": {
"id":"12",
"code":"Bu",
"name":"Bundle",
"image":"https://myapp.com/c0dbd984f6a40b16.jpg",
"sub_category": {
"id":"12",
"code":"PM",
"name":"PREMIUM",
"image":null,
"parent_id":null
}
},
"tax": {
"tax_method":"0",
"id":"3",
"code":"GST",
"name":"GST @ 7%",
"rate":"7.0000",
"type":"Percentage"
},
"variants":[],
"suppliers":[],
"inventory":[],
"has_expiry":"No",
"allowed_warehouse": [
{
"id": "2",
"name": "Warehouse 1"
},
{
"id": "3",
"name": "Warehouse 2"
},
{
"id": "8",
"name": "Warehouse 3"
},
],
"bundle": [
{
"id":"37",
"item_type":"Mandatory Product",
"item_option":"Whole Qty",
"item_qty":"5",
"bundle_items": [
{
"id":"140",
"sub_item_overide_item_qty":"no",
"sub_item_qty":"1",
"product_id":"45"
},
{
"id":"141",
"sub_item_overide_item_qty":"no",
"sub_item_qty":"1",
"product_id":"44"
}
]
}
]
},
]
"_metadata": {
"currentPage":10,
"nextPage":11,
"pageSize":2,
"totalRecord":107
}
]
This endpoint retrieves all items.
HTTP Request
GET https://api.asalta.com/pos/items
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/items?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/items?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"952",
"name":"Test10",
"code":"Test10",
"type":"standard",
"image":null,
"barcode_symbology":"code128",
"unit":null,
"cost":"100.0000",
"price":"100.0000",
"quantity":"880",
"promo_price":"100.0000",
"promo_eligible":"Disable",
"product_details":"product_details",
"details":"",
"file":null,
"custom_fields": {
"cf1":null,
"cf2":null,
"cf3":null,
"cf4":null,
"cf5":null,
"cf6":null
},
"category": {
"id":"8",
"code":"1",
"name":"Human THERAPEUTIC",
"image":"https://myapp.com/39c542a6c7d3d955ae703b38608d2278.png"
},
"tax": {
"tax_method":"0",
"id":"3",
"code":"GST",
"name":"GST @ 7%",
"rate":"7.0000",
"type":"Percentage"
},
"variants":[],
"suppliers":[],
"inventory":[
{
"id":"8900",
"warehouse_id":"2",
"quantity":"170",
"reorder_qty":"0.0000",
"rack":null,
"area":null
},
{
"id":"8901",
"warehouse_id":"3",
"quantity":"110",
"reorder_qty":"0.0000",
"rack":null,
"area":null
}
]
}
This endpoint retrieves one item detail.
HTTP Request
GET https://api.asalta.com/pos/items?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid items id |
Promotions
Promotions API provide all / one promotions list.Our promotions type below,
- Items
- Category
- Basket
- Spent Total
- Cheapest
- Outlet Based
- Customer Birthday Promotion
-
Coupon
Get All
curl 'https://api.asalta.com/pos/promotions
?warehouse_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/promotions?warehouse_id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"data":[
{
"id":"10",
"title":"Offer 2 for $3.00",
"start_date":"2016-08-01 00:00:00",
"end_date":"2019-03-21 00:00:00",
"description":"",
"type":"By Product",
"quantity_by":"Individual product Qty",
"discount_by":"By Price",
"warehouse_ids":"All Warehouse",
"minimum_spent":"0.0000",
"category_discount_percent":"0.0000",
"warehouse_discount_percent":"0.0000",
"exclude_bundle":"0",
"status":"enable",
"promotions_items":[
372,
373,
374,
375,
376,
383,
377,
384
],
"free_items":[],
"promotion_conditions":[
{
"quantity":"2.0000",
"discount_amount":"3.0000",
"discount_percent":null,
"provide_free_item":"0",
"free_item_qty":"0.0000",
"cheapest_item_qty":null,
"basket_value":null
}
],
"promotion_categories":[],
"promotions_items_with_discount":[]
},
{
"id":"23",
"title":"Offer 2",
"start_date":"2018-01-05 00:00:00",
"end_date":"2020-12-25 00:00:00",
"description":"",
"type":"By Product",
"quantity_by":"Individual product Qty",
"discount_by":"By Price",
"warehouse_ids":"All Warehouse",
"minimum_spent":"0.0000",
"category_discount_percent":null,
"warehouse_discount_percent":null,
"exclude_bundle":"0",
"status":"enable",
"promotions_items":[],
"free_items":[],
"promotion_conditions":[],
"promotion_categories":[],
"promotions_items_with_discount":[]
}
],
"_metadata":{
"currentPage":1,
"nextPage":null,
"pageSize":20,
"totalRecord":3
}
}
This endpoint retrieves all promotions.
HTTP Request
GET https://api.asalta.com/pos/promotions?warehouse_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
warehouse_id | Number | Required |
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/promotions?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/promotions?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"10",
"title":"Offer 2 for $3.00",
"start_date":"2016-08-01 00:00:00",
"end_date":"2019-03-21 00:00:00",
"description":"",
"type":"By Product",
"quantity_by":"Individual product Qty",
"discount_by":"By Price",
"warehouse_ids":"All Warehouse",
"minimum_spent":"0.0000",
"category_discount_percent":"0.0000",
"warehouse_discount_percent":"0.0000",
"exclude_bundle":"0",
"status":"enable",
"promotions_items":[
372,
373,
374,
375,
376,
383,
377,
384
],
"free_items":[],
"promotion_conditions":[
{
"quantity":"2.0000",
"discount_amount":"3.0000",
"discount_percent":null,
"provide_free_item":"0",
"free_item_qty":"0.0000",
"cheapest_item_qty":null,
"basket_value":null
}
],
"promotion_categories":[],
"promotions_items_with_discount":[]
}
This endpoint retrieves one item detail.
HTTP Request
GET https://api.asalta.com/pos/promotions?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid promotions id |
Tax Rates
Tax Rates API provide all / one Tax Rates list
Get All
curl 'https://api.asalta.com/pos/taxrates' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/taxrates", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id":"1",
"tax_code":"NT",
"tax_name":"No Tax",
"rate":"0.0000",
"country_code":"SG",
"line_item":"no"
},
{
"id":"2",
"tax_code":"gst18",
"tax_name":"GST 18%",
"rate":"18.0000",
"country_code":"SG",
"line_item":"yes"
}
],
"_meta" : {
"totalCount":9,
"pageCount":1,
"currentPage":1,
"perPage":20
}
]
This endpoint retrieves all Tax Rates.
HTTP Request
GET https://api.asalta.com/pos/taxrates
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get One
curl 'https://api.asalta.com/pos/taxrates?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/taxrates?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"2",
"tax_code":"gst18",
"tax_name":"GST 18%",
"rate":"18.0000",
"country_code":"SG",
"line_item":"yes"
}
This endpoint retrieves one taxrates detail.
HTTP Request
GET https://api.asalta.com/pos/taxrates?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid tax rate id. |
Get All Line Items
curl 'https://api.asalta.com/pos/taxlineitems?tax_rate_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/taxlineitems?tax_rate_id=n", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"1",
"name":"SGST",
"rate":"10.0000"
},
{
"id":"2",
"name":"CGST",
"rate":"8.0000"
}
],
"_meta": {
"totalCount":2,
"pageCount":1,
"currentPage":1,
"perPage":20
}
]
This endpoint retrieves all tax rate line items.
HTTP Request
GET https://api.asalta.com/pos/taxlineitems?tax_rate_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
tax_rate_id | Number | Valid tax rate id. |
Get One Line Item
curl 'https://api.asalta.com/pos/taxlineitems?tax_rate_id=n&id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/taxlineitems?tax_rate_id=n&id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"1",
"name":"SGST",
"rate":"10.0000"
}
This endpoint retrieves one tax rate line item detail.
HTTP Request
GET https://api.asalta.com/pos/taxlineitems?tax_rate_id=n&id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
tax_rate_id | Number | Valid tax rate id. |
id | Number | Valid tax rate line item id |
Invoices
Invoices API provide all / one invoices list
Get All
curl 'https://api.asalta.com/pos/invoices' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/invoices", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id" : "880",
"date" : "2017-05-16 14:55:59",
"reference_no" : "SALE/POS/2017/05/6752",
"customer_id" : "1",
"customer" : "Walk-in Customer",
"biller_id" : "35",
"biller" : "Arun Karthik",
"warehouse" : {
"id" : "2",
"code" : "1",
"name" : "Adelphi",
"warehouse_type" : "Warehouse",
"address" : " 1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map" : null,
"phone" : "",
"email" : "",
"allow_discount" : "yes",
"replenishment_email" : null,
"store_margin" : null,
"status" : "active",
},
"email_ids" : null,
"billing_address" : null,
"note" : "",
"staff_note" : "",
"total" : "100.0000",
"product_discount" : "0.0000",
"order_discount_id" : null,
"total_discount" : "0.0000",
"order_discount" : "0.0000",
"product_tax" : "6.5400",
"order_tax_id" : "5",
"order_tax" : "0.0000",
"total_tax" : "6.5400",
"shipping" : "0.0000",
"exchange" : "0.0000",
"grand_total" : "100.0000",
"sale_status" : "completed",
"payment_status" : "paid",
"payment_term" : "0",
"due_date" : null,
"total_items" : "1",
"pos" : "1",
"paid" : "100.0000",
"return_id" : null,
"surcharge" : "0.0000",
"attachment" : null,
"gst" : "6.5400",
"consignment_sale" : "0",
"items" : [
{
"product_id" : "943",
"product_code" : "vitadine",
"product_name" : "Vitadine",
"product_type" : "standard",
"option_id" : null,
"net_unit_price" : "93.4600",
"nup_before_order_discount" : "93.457943925234000",
"unit_price" : "100.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "6.5400",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "0.0000",
"subtotal" : "100.0000",
"serial_no" : "",
"real_unit_price" : "100.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : "",
"item_tax_details": [
{
"tax_name":"SGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.27"
},
{
"tax_name":"CGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.27"
}
]
}
],
"payments" : [
{
"id" : "943",
"date" : "2017-05-16 14:55:59",
"purchase_id" : null,
"reference_no" : "IPAY/2017/05/0783",
"transaction_id" : null,
"paid_by" : "cash",
"cheque_no" : "",
"cc_no" : "",
"cc_holder" : "",
"cc_month" : "",
"cc_year" : "",
"cc_type" : "",
"amount" : "100.0000",
"extra_charges" : "0.0000",
"currency" : null,
"attachment" : null,
"type" : "received",
"note" : "",
}
]
},
{
"id" : "881",
"date" : "2017-05-16 14:59:15",
"reference_no" : "SALE/POS/2017/05/6753",
"customer_id" : "1",
"customer" : "Walk-in Customer",
"biller_id" : "35",
"biller" : "Arun Karthik",
"warehouse" : {
"id" : "2",
"code" : "1",
"name" : "Adelphi",
"warehouse_type" : "Warehouse",
"address" : " 1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map" : null,
"phone" : "",
"email" : "",
"allow_discount" : "yes",
"replenishment_email" : null,
"store_margin" : null,
"status" : "active",
}
"email_ids" : null,
"billing_address" : null,
"note" : "",
"staff_note" : "",
"total" : "100.0000",
"product_discount" : "0.0000",
"order_discount_id" : null,
"total_discount" : "0.0000",
"order_discount" : "0.0000",
"product_tax" : "6.5400",
"order_tax_id" : "5",
"order_tax" : "0.0000",
"total_tax" : "6.5400",
"shipping" : "0.0000",
"exchange" : "0.0000",
"grand_total" : "100.0000",
"sale_status" : "completed",
"payment_status" : "paid",
"payment_term" : "0",
"due_date" : null,
"total_items" : "1",
"pos" : "1",
"paid" : "100.0000",
"return_id" : null,
"surcharge" : "0.0000",
"attachment" : null,
"gst" : "6.5400",
"consignment_sale" : "0",
"items" : [
{
"product_id" : "943",
"product_code" : "vitadine",
"product_name" : "Vitadine",
"product_type" : "standard",
"option_id" : null,
"net_unit_price" : "93.4600",
"nup_before_order_discount" : "93.457943925234000",
"unit_price" : "100.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "6.5400",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "0.0000",
"subtotal" : "100.0000",
"serial_no" : "",
"real_unit_price" : "100.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : "",
}
],
"payments" : [
{
"id" : "944",
"date" : "2017-05-16 14:59:15",
"purchase_id" : null,
"reference_no" : "IPAY/2017/05/0785",
"transaction_id" : null,
"paid_by" : "cash",
"cheque_no" : "",
"cc_no" : "",
"cc_holder" : "",
"cc_month" : "",
"cc_year" : "",
"cc_type" : "",
"amount" : "100.0000",
"extra_charges" : "0.0000",
"currency" : null,
"attachment" : null,
"type" : "received",
"note" : "",
}
]
}
],
"_metadata" : {
"currentPage" : 1,
"nextPage" : 2,
"pageSize" : 2,
"totalRecord" : 155
}
]
This endpoint retrieves all invoices.
HTTP Request
GET https://api.asalta.com/pos/invoices
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/invoices?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/invoices?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id" : "900",
"date" : "2017-06-05 18:46:59",
"reference_no" : "SALE/POS/2017/06/6778",
"customer_id" : "1",
"customer" : "Walk-in Customer",
"biller_id" : "35",
"biller" : "Arun Karthik",
"warehouse" : {
"id" : "2",
"code" : "1",
"name" : "Adelphi",
"warehouse_type" : "Warehouse",
"address": " 1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map" : null,
"phone" : "",
"email" : "",
"allow_discount" : "yes",
"replenishment_email" : null,
"store_margin" : null,
"status" : "active"
},
"email_ids" : null,
"billing_address" : null,
"note" : "",
"staff_note" : "",
"total" : "408.0000",
"product_discount" : "0.0000",
"order_discount_id" : null,
"total_discount" : "0.0000",
"order_discount" : "0.0000",
"product_tax" : "26.6900",
"order_tax_id" : "5",
"order_tax" : "0.0000",
"total_tax" : "26.6900",
"shipping" : "0.0000",
"exchange" : "0.0000",
"grand_total" : "408.0000",
"sale_status" : "completed",
"payment_status" : "paid",
"payment_term" : "0",
"due_date" : null,
"total_items" : "2",
"pos" : "1",
"paid" : "408.0000",
"return_id" : null,
"surcharge" : "0.0000",
"attachment" : null,
"gst" : "26.6900",
"consignment_sale" : "0",
"items" : [
{
"product_id" : "937",
"product_code" : "849510",
"product_name" : "108",
"product_type" : "bundle",
"option_id" : "0",
"net_unit_price" : "100.9300",
"nup_before_order_discount" : "100.934579439250000",
"unit_price" : "108.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "7.0700",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "2.0000",
"subtotal" : "108.0000",
"serial_no" : "",
"real_unit_price" : "108.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : "",
"bundle_items" : [
{
"bundle_item_id" : "67",
"product_id" : "936",
"sub_item_id" : "238",
"sub_item_qty" : "1.0000",
"option_id" : "0",
"real_unit_price" : "10.00000"
},
{
"bundle_item_id" : "67",
"product_id" : "947",
"sub_item_id" : "240",
"sub_item_qty" : "1.0000",
"option_id" : "103",
"real_unit_price" : "100.00000",
}
],
"item_tax_details": [
{
"tax_name":"SGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.535"
},
{
"tax_name":"CGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.535"
}
]
"promo_details" : {
"id" : "35",
"promo_id" : "21",
"discount" : "99.0000"
}
},
{
"product_id" : "66",
"product_code" : "779764",
"product_name" : "Bundle A1",
"product_type" : "bundle",
"option_id" : "0",
"net_unit_price" : "280.3700",
"nup_before_order_discount" : "280.373831775700000",
"unit_price" : "300.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "19.6300",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "107.0000",
"subtotal" : "300.0000",
"serial_no" : "",
"real_unit_price" : "300.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : "",
"bundle_items" : []
}
],
"payments" : [
{
"id" : "966",
"date" : "2017-06-05 18:46:59",
"purchase_id" : null,
"reference_no" : "IPAY/2017/06/0817",
"transaction_id" : null,
"paid_by" : "cash",
"cheque_no" : "",
"cc_no" : "",
"cc_holder" : "",
"cc_month" : "",
"cc_year" : "",
"cc_type" : "",
"amount" : "408.0000",
"extra_charges" : "0.0000",
"currency" : null,
"attachment" : null,
"type" : "received",
"note" : ""
}
]
}
This endpoint retrieves one invoice detail.
HTTP Request
GET https://api.asalta.com/pos/invoices?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid invoices id |
New Invoice
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"date" : "2018-01-17 03:05:26",
"customer_id": 7320,
"customer_name": "[email protected]",
"biller_id": 7317,
"biller_name": 1,
"warehouse_id": 16,
"note": "",
"staff_note": "",
"order_discount_percentage": false,
"order_discount": 0,
"shipping" : {
"delivery_date" : "2017-11-20 12:18",
"delivery_reference" : null,
"delivery_charge" : 0.01,
"delivery_note" : null,
"shipping_address" : "",
"billing_address" : "",
},
"payment_term" : "0",
"items" : {
{
"product_id" : 91,
"quantity" : 1,
"option_id" : false,
"discount_percentage" : true,
"item_discount" : 0,
"tax_rate_id" : 23,
"bundle_items" : {
"mandatoryProducts" :{
{
"id" : "47",
"quantity" : "1",
"sub_item_id" : "205",
"bundle_item_id" : "56",
"item_variants" : false
},
},
"optionalProducts" :{
{
"id" : "43",
"quantity" : "2",
"sub_item_id" : "206",
"bundle_item_id" : "57",
"item_variants" : "7,10"
}
},
},
},
{
"product_id" : 963,
"quantity" : 1,
"option_id" : 114,
"discount_percentage" : true,
"item_discount" : 0,
"tax_rate_id" : 23,
},
{
"product_id" : 92,
"quantity" : 1,
"option_id" : false,
"discount_percentage" : false,
"item_discount" : 0,
"tax_rate_id" : 23,
},
{
"product_id" : "GIFT_CARD",
"quantity" : 1,
"value" : 1100,
"amount" : 110,
},
},
};
}' \
'https://api.asalta.com/pos/invoices'
<?php
$data = [
'date' => "2018-01-17 03:05:26",
'customer_id'=> 7320,
'customer_name'=> "[email protected]",
'biller_id'=> 7317,
'biller_name'=> 1,
'warehouse_id'=> 16,
'note'=> '',
'staff_note'=> '',
'order_discount_percentage'=> false,
'order_discount'=> 0,
'shipping' => [
'delivery_date' => '2017-11-20 12:18',
'delivery_reference' => null,
'delivery_charge' => 0.01,
'delivery_note' => null,
"shipping_address" : "",
"billing_address" : "",
],
'payment_term' => "0",
'items' => [
[
'product_id' => 91,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
'bundle_items' => [
'mandatoryProducts' =>[
[
'id' => '47',
'quantity' => '1',
'sub_item_id' => '205',
'bundle_item_id' => '56',
'item_variants' => false
],
],
'optionalProducts' =>[
[
'id' => '43',
'quantity' => '2',
'sub_item_id' => '206',
'bundle_item_id' => '57',
'item_variants' => '7,10'
]
],
],
],
[
'product_id' => 963,
'quantity' => 1,
'option_id' => 114,
'discount_percentage' => true,
'item_discount' => 0,
],
[
'product_id' => 92,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => false,
'item_discount' => 0,
],
[
'product_id' => 'GIFT_CARD',
'quantity' => 1,
'value' => 1100,
'amount' => 110,
],
],
];
$oAuth2Client->api("pos/invoices", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"id" : "1103",
"date" : "2017-11-28 08:42:00",
"reference_no" : "SALE/POS/2017/11/6923",
"customer_id" : "7192",
"customer" : "Mass Maari",
"biller_id" : "5902",
"biller" : "RaiN ",
"warehouse" : {
"id" : "2",
"code" : "1",
"name" : "Adelphi",
"warehouse_type" : "Warehouse",
"address" : " 1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map" : null,
"phone" : "",
"email" : "",
"allow_discount" : "yes",
"replenishment_email" : null,
"store_margin" : null,
"status" : "active"
},
"email_ids" : null,
"billing_address" : null,
"note" : "",
"staff_note" : "",
"total" : "1375.0000",
"product_discount" : "12.0000",
"order_discount_id" : "0",
"total_discount" : "12.0000",
"order_discount" : "0.0000",
"product_tax" : "89.9500",
"order_tax_id" : "5",
"order_tax" : "0.0000",
"total_tax" : "89.9500",
"shipping" : "0.0100",
"exchange" : "0.0000",
"grand_total" : "1375.0100",
"sale_status" : "completed",
"payment_status" : "due",
"payment_term" : "0",
"due_date" : null,
"total_items" : "3",
"pos" : "1",
"paid" : "0.0000",
"return_id" : null,
"surcharge" : "0.0000",
"attachment" : null,
"gst" : "89.9500",
"consignment_sale" : "0",
"items" : [
{
"product_id" : "50",
"product_code" : "eu010",
"product_name" : "GLOVES",
"product_type" : "standard",
"option_id" : "0",
"net_unit_price" : "92.5200",
"nup_before_order_discount" : "92.523364485981000",
"unit_price" : "99.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "6.4800",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "0.0000",
"subtotal" : "99.0000",
"serial_no" : "",
"real_unit_price" : "99.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : "",
"item_tax_details": [
{
"tax_name":"SGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.24"
},
{
"tax_name":"CGST",
"tax_rate_id":"3",
"tax_rate":"3.5",
"item_tax":"3.24"
}
]
},
{
"product_id" : "46",
"product_code" : "0TJMYTA04",
"product_name" : "HAT",
"product_type" : "standard",
"option_id" : "11",
"net_unit_price" : "257.9400",
"nup_before_order_discount" : "257.943925233640000",
"unit_price" : "276.0000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "18.0600",
"tax_rate_id" : "4",
"tax" : "7.0000%",
"discount" : "12",
"item_discount" : "12.0000",
"bundle_discount" : "0.0000",
"subtotal" : "276.0000",
"serial_no" : "",
"real_unit_price" : "288.0000",
"free_items_qty" : "0",
"promo_id" : "0",
"promo_title" : ""
}
],
"payments" : []
},
"error":false
}
This endpoint will create a new invoice.
HTTP Request
POST https://api.asalta.com/pos/invoices
Post Parameters
Parameter | Type | Description |
---|---|---|
date | Date | Required, Format is YYYY-MM-DD |
customer_id | Number | Required |
customer_name | String | Optional |
biller_id | Number | Required |
biller_name | String | Optional |
warehouse_id | Number | Required |
note | String | Optional |
staff_note | String | Optional |
order_discount_percentage | Boolean | True or False |
order_discount | Number | Optional |
payment_term | Number | Optional |
shipping | Array | Optional |
items | Multidimensional array | Required |
Shipping Query Parameters
Parameter | Type | Description |
---|---|---|
delivery_date | Date | Required, Format is YYYY-MM-DD |
delivery_reference | String | Optional |
delivery_charge | Number | Required |
shipping_address | String | Required |
billing_address | String | Optional |
delivery_note | String | Optional |
Items Query Parameters
Parameter | Type | Description |
---|---|---|
product_id | Number / 'GIFT_CARD' | Required |
quantity | Number | Required |
option_id | Number | Optional |
discount_percentage | Boolean | True or False |
item_discount | Number | Optional |
bundle_items | Multidimensional array | Optional/Required |
value | Number | Optional/Required When product_id is Gift Card, Value of the Gift Card in Amount |
amount | Number | Optional/Required When product_id is Gift Card, Price of the Gift Card |
Bundle Items Query Parameters
Parameter | Type | Description |
---|---|---|
mandatoryProducts | Multidimensional array | Required |
optionalProducts | Multidimensional array | Required |
Mandatory Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Optional Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Coupon Query Parameters
Parameter | Type | Description |
---|---|---|
coupon_code | String | Required |
channel_type | String | Required |
Payment Methods
Payment Methods API provide all / one payment methods list
Get All
curl 'https://api.asalta.com/pos/payment_methods' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/payment_methods", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id" : "1",
"name" : "Cash",
"identifier" : "cash",
"variable_charges" : "0.00000%",
"fixed_charges" : "0.00000",
"status" : "Enable",
"system_default" : "System Defined",
"support" : "all",
},
{
"id" : "2",
"name" : "Cheque",
"identifier" : "Cheque",
"variable_charges" : "0.00000%",
"fixed_charges" : "0.00000",
"status" : "Enable",
"system_default" : "System Defined",
"support" : "all",
}
],
"_links" : {
"self" : {
"href" : "https://api.asalta.com/pos/
payment_methods?access_token=XXXXXX&page=n"
}
},
"_metadata" : {
"currentPage" : 1,
"perPage" : 2,
"pageCount" : 2,
"totalCount" : 155
}
]
This endpoint retrieves all payment methods.
HTTP Request
GET https://api.asalta.com/pos/payment_methods
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/payment_methods?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/payment_methods?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"1",
"name":"Cash",
"identifier":"cash",
"variable_charges":"0.00000%",
"fixed_charges":"0.00000",
"status":"Enable",
"system_default":"System Defined",
"support":"all"
}
This endpoint retrieves one payment methods detail.
HTTP Request
GET https://api.asalta.com/pos/payment_methods?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid payment methods id |
Payments
Payments API provide all / one payments list
Get All
curl 'https://api.asalta.com/pos/payments?sale_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/payments?sale_id=n", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id" : "1028",
"date" : "2017-11-22 12:46:00",
"sale_id" : "1050",
"return_id" : null,
"reference_no" : "IPAY/2017/11/0915",
"paid_by" : "cash",
"amount" : "1.0000",
"extra_charges" : "0.0000",
"attachment" : null,
"type" : "received",
"note" : "",
},
{
"id" : "1029",
"date" : "2017-11-22 12:47:00",
"sale_id" : "1050",
"return_id" : null,
"reference_no" : "IPAY/2017/11/0915",
"paid_by" : "cash",
"amount" : "1.0000",
"extra_charges" : "0.0000",
"attachment" : null,
"type" : "received",
"note" : "",
}
],
"_metadata" : {
"currentPage" : 1,
"nextPage" : 20,
"pageSize" : 2,
"totalRecord" : 15
}
]
This endpoint retrieves all payments.
HTTP Request
GET https://api.asalta.com/pos/payments?sale_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
sale_id | Number | Required. |
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/payments?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/payments?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"262",
"date":"2016-08-30 19:54:13",
"sale_id":"270",
"return_id":null,
"reference_no":"IPAY/2016/08/0001",
"paid_by":"cash",
"amount":"299.0000",
"extra_charges":"0.0000",
"attachment":null,
"type":"received",
"note":""
}
This endpoint retrieves one payment detail.
HTTP Request
GET https://api.asalta.com/pos/payments?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid payments id |
New Payment
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"sale_id" => 1182,
"amount" => 9.200,
"date" => "2018-01-17 03:05:26",
"paid_by" => "gift_card",
"type" => "sale",
"note" => "short note for this payment",
"extra_charges" => 0,
"no" =>"3147021291870209",
}' \
'https://api.asalta.com/pos/payments'
<?php
$data = [
'sale_id' => 1182,
'amount' => 9.200,
'date' => "2018-01-17 03:05:26",
'paid_by' => 'gift_card',
'type' => 'sale',
'note' => 'short note for this payment',
'extra_charges' => 0,
'no' =>'3147021291870209',
];
$oAuth2Client->api("pos/payments", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"payment_id" : 1043,
"reference_no" : "IPAY/2017/11/0921",
"paid_amount" : "903.1",
"paid_by" : "cash",
},
"error":false
}
This endpoint will create a new payment.
HTTP Request
POST https://api.asalta.com/pos/payments
Post Parameters
Parameter | Type | Description |
---|---|---|
date | Date | Required, Format is YYYY-MM-DD |
sale_id | Number | Required |
paid_by | String | Required, Values will be identifiers in Payment Methods and default values are cash, CC, gift_card, other, loyalty, Kindly refer Payment Methods API |
amount | Number | Required |
type | String | "sale" must set |
extra_charges | Number | Optional |
reference_no | String | Optional |
note | String | Optional |
attachment | String | Optional |
no | String | Optional |
cc_holder | String | Optional |
cc_month | Number | Optional |
cc_year | Number | Optional |
cc_type | String | Optional |
Delete Payment
curl 'https://api.asalta.com/pos/payments?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/payments?id=n", "DELETE", []);
?>
The above command returns JSON structured like this:
{
"Message":"Successfully removed your payment",
"error":false
}
This endpoint will create a new payment.
HTTP Request
DELETE https://api.asalta.com/pos/payments?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
Return Invoices
Return invoices API provide all / one return invoices list
Get All
curl 'https://api.asalta.com/pos/return_invoices
?sale_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/return_invoices?sale_id=n", "GET", []);
?>
The above command returns JSON structured like this:
[
"data" : [
{
"id":"234",
"date":"2017-06-22 21:53:00",
"reference_no":"RETURNSL/2017/06/6802",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"35",
"biller":"Arun Karthik",
"warehouse":{
"id":"2",
"code":"1",
"name":"Adelphi",
"warehouse_type":"Warehouse",
"address":"1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map":null,
"phone":"",
"email":"",
"allow_discount":"yes",
"replenishment_email":null,
"store_margin":null,
"status":"active"
},
"note":"",
"total":"108.0000",
"product_discount":"0.0000",
"order_discount_id":"null",
"total_discount":"0.0000",
"order_discount":null,
"product_tax":"7.0700",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"7.0700",
"exchange":"0.0000",
"grand_total":"108.0000",
"surcharge":"0.0000",
"attachment":null,
"items":[
{
"product_id":"937",
"product_code":"849510",
"product_name":"108",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"100.9300",
"nup_before_order_discount":"100.934579439250000",
"quantity":"1.0000",
"warehouse_id":"2",
"item_tax":"7.0700",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"2.0000",
"subtotal":"108.0000",
"serial_no":"",
"real_unit_price":"108.0000",
"bundle_items":[
{
"bundle_item_id":"67",
"product_id":"936",
"sub_item_id":"238",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"10.00000"
},
{
"bundle_item_id":"67",
"product_id":"947",
"sub_item_id":"240",
"sub_item_qty":"1.0000",
"option_id":"104",
"real_unit_price":"100.00000"
}
]
}
],
"payments": {
"id":"977",
"date":"2017-06-22 21:53:00",
"purchase_id":null,
"reference_no":"IPAY/2017/06/0834",
"transaction_id":null,
"paid_by":"cash",
"cheque_no":"",
"cc_no":"",
"cc_holder":"",
"cc_month":"",
"cc_year":"",
"cc_type":"Visa",
"amount":"108.0000",
"extra_charges":"0.0000",
"currency":null,
"attachment":null,
"type":"returned",
"note":null
}
}
],
"_metadata": {
"currentPage" :1,
"nextPage":null,
"pageSize":20,
"totalRecord":1
}
]
This endpoint retrieves all return invoices.
HTTP Request
GET https://api.asalta.com/pos/return_invoices?sale_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
sale_id | Number | Required. |
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/return_invoices?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/return_invoices?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"229",
"date":"2017-06-15 18:21:00",
"reference_no":"RETURNSL/2017/06/6796",
"customer_id":"12",
"customer":"Homefix",
"biller_id":"0",
"biller":"N.A.",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne 1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"total":"1981.1700",
"product_discount":"0.0000",
"order_discount_id":null,
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"129.6100",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"129.6100",
"exchange":"0.0000",
"grand_total":"1981.1700",
"surcharge":"0.0000",
"attachment":null,
"items": [
{
"product_id":"4294967295",
"product_code":"CCORDER/2017/06/0001",
"product_name":"Homefix - Jun 2017",
"product_type":"manual",
"option_id":"0",
"net_unit_price":"1758.1000",
"nup_before_order_discount":"1758.1028037383",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"123.0700",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"1881.1700",
"serial_no":"",
"real_unit_price":"1881.1700"
},
{
"product_id":"4294967295",
"product_code":"sdfsd",
"product_name":"aasasc",
"product_type":"manual",
"option_id":"0",
"net_unit_price":"93.4600",
"nup_before_order_discount":"93.457943925234000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"6.5400",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"100.0000",
"serial_no":"",
"real_unit_price":"100.0000"
}
],
"payments":[]
}
This endpoint retrieves one return invoice detail.
HTTP Request
GET https://api.asalta.com/pos/return_invoices?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid return invoices id |
New Return Invoice
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"sale_id": 1104,
"date": "2018-01-19 05:54:11",
"customer_id": 7192,
"customer_name": "[email protected]",
"biller_id": 5902,
"biller_name": 1,
"warehouse_id": 2,
"note": "",
"return_surcharge": 5,
"order_discount_percentage": false,
"order_discount": 4,
"payment_term": "0",
"items": [
{
"product_id": 50,
"quantity": 1,
"option_id": false,
"discount_percentage": true,
"item_discount": 0,
"tax_rate_id": 23
}
]
}' \
'https://api.asalta.com/pos/return_invoices'
<?php
$data = [
'sale_id' => 1104,
'date' => "2018-01-17 03:05:26",
'customer_id'=> 7192,
'customer_name'=> "[email protected]",
'biller_id'=> 5902,
'biller_name'=> "RaiN StaR",
'warehouse_id'=> 2,
'note'=> '',
'return_surcharge'=> 5,
'order_discount_percentage'=> false,
'order_discount'=> 4,
'payment_term' => "0",
'items' => [
[
'product_id' => 91,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
'bundle_items' => [
'mandatoryProducts' =>[
[
'id' => '47',
'quantity' => '1',
'sub_item_id' => '205',
'bundle_item_id' => '56',
'item_variants' => false
],
],
'optionalProducts' =>[
[
'id' => '43',
'quantity' => '2',
'sub_item_id' => '206',
'bundle_item_id' => '57',
'item_variants' => '7,10'
]
],
],
],
[
'product_id' => 50,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
],
[
'product_id' => 46,
'quantity' => 1,
'option_id' => 11,
'discount_percentage' => false,
'item_discount' => 12,
],
[
'product_id' => 92,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => false,
'item_discount' => 0,
],
],
];
$oAuth2Client->api("pos/return_invoices", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"id" : "252",
"date" : "2017-11-28 11:35:00",
"reference_no" : "RETURNSL/2017/11/6925",
"customer_id" : "7192",
"customer" : "Mass Maari",
"biller_id" : "5902",
"biller" : "RaiN ",
"warehouse" : {
"id" : "2",
"code" : "1",
"name" : "Adelphi",
"warehouse_type" : "Warehouse",
"address" : " 1 Coleman St.
#04-59
The Adelphi (Near City Hall MRT)
Singapore - 179803",
"map" : null,
"phone" : "",
"email" : "",
"allow_discount" : "yes",
"replenishment_email" : null,
"store_margin" : null,
"status" : "active"
},
"note" : "",
"total" : "97.6700",
"product_discount" : "0.0000",
"order_discount_id" : "4",
"total_discount" : "1.3300",
"order_discount" : "1.3300",
"product_tax" : "6.3900",
"order_tax_id" : "5",
"order_tax" : "0.0000",
"total_tax" : "6.3900",
"exchange" : "0.0000",
"grand_total" : "92.6700",
"surcharge" : "0.0000",
"attachment" : null,
"items" : [
{
"product_id" : "50",
"product_code" : "eu010",
"product_name" : "GLOVES",
"product_type" : "standard",
"option_id" : "0",
"net_unit_price" : "92.6100",
"nup_before_order_discount" : "92.523364485981000",
"quantity" : "1.0000",
"warehouse_id" : "2",
"item_tax" : "6.3900",
"tax_rate_id" : "3",
"tax" : "7.0000%",
"discount" : "0",
"item_discount" : "0.0000",
"bundle_discount" : "0.0000",
"subtotal" : "99.0000",
"serial_no" : "",
"real_unit_price" : "99.0000"
}
],
"payments" : [
{
"id" : "1056",
"date" : "2017-11-28 11:35:00",
"purchase_id" : null,
"reference_no" : "IPAY/2017/11/0931",
"transaction_id" : null,
"paid_by" : "Cash",
"cheque_no" : null,
"cc_no" : null,
"cc_holder" : null,
"cc_month" : null,
"cc_year" : null,
"cc_type" : null,
"amount" : "97.6700",
"extra_charges" : "0.0000",
"currency" : null,
"attachment" : null,
"type" : "returned",
"note" : null
}
]
},
"error":false
}
This endpoint will create a new return invoices.
HTTP Request
POST https://api.asalta.com/pos/return_invoices
Post Parameters
Parameter | Type | Description |
---|---|---|
date | Date | Required, Format is YYYY-MM-DD |
sale_id | Number | Required |
customer_id | Number | Required |
customer_name | String | Optional |
biller_id | Number | Required |
biller_name | String | Optional |
warehouse_id | Number | Required |
note | String | Optional |
return_surcharge | Number | Optional |
order_discount_percentage | Boolean | True or False |
order_discount | Number | Optional |
payment_term | Number | Optional |
items | Multidimensional array | Required |
Items Query Parameters
Parameter | Type | Description |
---|---|---|
product_id | Number | Required |
quantity | Number | Required |
option_id | Number | Optional |
discount_percentage | Boolean | True or False |
item_discount | Number | Optional |
bundle_items | Multidimensional array | Optional/Required |
Bundle Items Query Parameters
Parameter | Type | Description |
---|---|---|
mandatoryProducts | Multidimensional array | Required |
optionalProducts | Multidimensional array | Required |
Mandatory Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Optional Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Orders
Orders API provide all / one orders list
Get All
curl 'https://api.asalta.com/pos/orders' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/orders", "GET", []);
?>
The above command returns JSON structured like this:
[
"data": [
{
"id":"53",
"date":"2017-05-16 21:46:30",
"reference_no":"ORDER/POS/2017/05/0038",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"35",
"biller":"Arun Karthik",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"staff_note":"",
"total":"358.0000",
"product_discount":"0.0000",
"order_discount_id":"30",
"total_discount":"30.0000",
"order_discount":"30.0000",
"product_tax":"23.4200",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"23.4200",
"shipping":"0.0000",
"exchange":"0.0000",
"grand_total":"358.0000",
"sale_status":"new",
"payment_status":"due",
"payment_term":"0",
"due_date":null,
"total_items":"2",
"pos":"1",
"paid":"0.0000",
"return_id":null,
"surcharge":"0.0000",
"attachment":null,
"gst":"23.4200",
"items": [
{
"product_id":"46",
"product_code":"0TJMYTA04",
"product_name":"HAT",
"product_type":"standard",
"option_id":"53",
"net_unit_price":"270.6200",
"nup_before_order_discount":"269.158878504670000",
"unit_price":"288.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"17.3800",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"288.0000",
"serial_no":"",
"real_unit_price":"288.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":""
},
{
"product_id":"910",
"product_code":"656523232",
"product_name":"Hip Band",
"product_type":"standard",
"option_id":"0",
"net_unit_price":"93.9600",
"nup_before_order_discount":"93.457943925234000",
"unit_price":"100.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"6.0400",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"100.0000",
"serial_no":"",
"real_unit_price":"100.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":""
}
]
},
{
"id":"54",
"date":"2017-05-16 22:10:00",
"reference_no":"ORDER/POS/2017/05/0039",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"35",
"biller":"Arun Karthik",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"staff_note":"",
"total":"300.0000",
"product_discount":"0.0000",
"order_discount_id":null,
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"19.6300",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"19.6300",
"shipping":"0.0000",
"exchange":"0.0000",
"grand_total":"300.0000",
"sale_status":"new",
"payment_status":"due",
"payment_term":"0",
"due_date":null,
"total_items":"1",
"pos":"1",
"paid":"0.0000",
"return_id":null,
"surcharge":"0.0000",
"attachment":null,
"gst":"19.6300",
"items": [
{
"product_id":"66",
"product_code":"779764",
"product_name":"Bundle A1",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"280.3700",
"nup_before_order_discount":"280.373831775700000",
"unit_price":"300.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"19.6300",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"-1.0000",
"subtotal":"300.0000",
"serial_no":"",
"real_unit_price":"300.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":"",
"bundle_items": [
{
"bundle_item_id":"44",
"product_id":"42",
"sub_item_id":"178",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"299.00000"
}
]
}
]
}
],
"_metadata" : {
"currentPage":1,
"nextPage":2,
"pageSize":20,
"totalRecord":69
}
]
This endpoint retrieves all orders.
HTTP Request
GET https://api.asalta.com/pos/orders
Query Parameters
Parameter | Type | Description |
---|---|---|
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/orders?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/orders?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"54",
"date":"2017-05-16 22:10:00",
"reference_no":"ORDER/POS/2017/05/0039",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"35",
"biller":"Arun Karthik",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"staff_note":"",
"total":"300.0000",
"product_discount":"0.0000",
"order_discount_id":null,
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"19.6300",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"19.6300",
"shipping":"0.0000",
"exchange":"0.0000",
"grand_total":"300.0000",
"sale_status":"new",
"payment_status":"due",
"payment_term":"0",
"due_date":null,
"total_items":"1",
"pos":"1",
"paid":"0.0000",
"return_id":null,
"surcharge":"0.0000",
"attachment":null,
"gst":"19.6300",
"items": [
{
"product_id":"66",
"product_code":"779764",
"product_name":"Bundle A1",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"280.3700",
"nup_before_order_discount":"280.373831775700000",
"unit_price":"300.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"19.6300",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"-1.0000",
"subtotal":"300.0000",
"serial_no":"",
"real_unit_price":"300.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":"",
"bundle_items": [
{
"bundle_item_id":"44",
"product_id":"42",
"sub_item_id":"178",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"299.00000"
}
]
}
]
}
This endpoint retrieves one order detail.
HTTP Request
GET https://api.asalta.com/pos/orders?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid order id |
New Order
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"date": "2018-01-19 06:07:28",
"customer_id": 7192,
"customer_name": "[email protected]",
"biller_id": 5902,
"biller_name": 1,
"warehouse_id": 8,
"note": "",
"staff_note": "",
"order_discount_percentage": false,
"order_discount": 0,
"payment_term": "0",
"items": [
{
"product_id": 91,
"quantity": 10,
"option_id": false,
"discount_percentage": true,
"item_discount": 0,
"tax_rate_id": 23,
"bundle_items": {
"mandatoryProducts": [
{
"bundle_item_id": "64",
"items": [
{
"product_id": "46",
"quantity": "1",
"sub_item_id": "228",
"item_variants": "11"
}
]
},
{
"bundle_item_id": "65",
"items": [
{
"product_id": "47",
"quantity": "1",
"sub_item_id": "237",
"item_variants": "0"
}
]
}
],
"optionalProducts": [
{
"id": "43",
"quantity": "2",
"sub_item_id": "206",
"bundle_item_id": "57",
"item_variants": "7,10"
},
{
"id": "47",
"quantity": "1",
"sub_item_id": "235",
"bundle_item_id": "65",
"item_variants": "0"
}
]
}
},
{
"product_id": 50,
"quantity": 1,
"option_id": false,
"discount_percentage": true,
"item_discount": 0,
"tax_rate_id": 23
},
{
"product_id": 46,
"quantity": 1,
"option_id": 53,
"discount_percentage": false,
"item_discount": 12,
"tax_rate_id": 23
},
{
"product_id": 92,
"quantity": 1,
"option_id": false,
"discount_percentage": false,
"item_discount": 0,
"tax_rate_id": 23
}
]
}' \
'https://api.asalta.com/pos/orders'
<?php
$data = [
'date' => "2018-01-17 03:05:26",
'customer_id'=> 7192,
'customer_name'=> "[email protected]",
'biller_id'=> 5902,
'biller_name'=> 1,
'warehouse_id'=> 8,
'note'=> '',
'staff_note'=> '',
'order_discount_percentage'=> false,
'order_discount'=> 0,
'payment_term' => "0",
'items' => [
[
'product_id' => 73,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
'bundle_items' => [
'mandatoryProducts' =>[
[
'bundle_item_id' => '56',
'items' => [
[
'product_id' => '47',
'quantity' => 1,
'sub_item_id' => '205',
'item_variants' => false
]
],
],
],
'optionalProducts' =>[
[
'bundle_item_id' => '57',
'items' => [
[
'product_id' => '43',
'quantity' => 2,
'sub_item_id' => '206',
'item_variants' => '39,23'
]
],
]
],
],
],
[
'product_id' => 50,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
],
[
'product_id' => 46,
'quantity' => 1,
'option_id' => 53,
'discount_percentage' => false,
'item_discount' => 12,
],
[
'product_id' => 92,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => false,
'item_discount' => 0,
],
],
];
$oAuth2Client->api("pos/orders", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data": {
"id":"170",
"date":"2017-12-01 06:32:00",
"reference_no":"ORDER/POS/2017/12/0172",
"customer_id":"7192",
"customer":"Mass Maari",
"biller_id":"5902",
"biller":"RaiN ",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"staff_note":"",
"total":"599.0000",
"product_discount":"0.0000",
"order_discount_id":"0",
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"39.1900",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"39.1900",
"shipping":"0.0000",
"exchange":"0.0000",
"grand_total":"599.0000",
"sale_status":"new",
"payment_status":"due",
"payment_term":"0",
"due_date":null,
"total_items":"2",
"pos":"1",
"paid":"0.0000",
"return_id":null,
"surcharge":"0.0000",
"attachment":null,
"gst":"39.1900",
"items": [
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.2900",
"nup_before_order_discount":"467.289719626170000",
"unit_price":"500.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.7100",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"-82.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":"",
"bundle_items": [
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"39",
"real_unit_price":"120.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
}
]
},
{
"product_id":"50",
"product_code":"eu010",
"product_name":"GLOVES",
"product_type":"standard",
"option_id":"0",
"net_unit_price":"92.5200",
"nup_before_order_discount":"92.523364485981000",
"unit_price":"99.0000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"6.4800",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"99.0000",
"serial_no":"",
"real_unit_price":"99.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":""
}
]
},
"error":false
}
This endpoint will create a new order.
HTTP Request
POST https://api.asalta.com/pos/orders
Post Parameters
Parameter | Type | Description |
---|---|---|
date | Date | Required, Format is YYYY-MM-DD |
customer_id | Number | Required |
customer_name | String | Optional |
biller_id | Number | Required |
biller_name | String | Optional |
warehouse_id | Number | Required |
note | String | Optional |
staff_note | String | Optional |
order_discount_percentage | Boolean | True or False |
order_discount | Number | Optional |
payment_term | Number | Optional |
items | Multidimensional array | Required |
Items Query Parameters
Parameter | Type | Description |
---|---|---|
product_id | Number | Required |
quantity | Number | Required |
option_id | Number | Optional |
discount_percentage | Boolean | True or False |
item_discount | Number | Optional |
bundle_items | Multidimensional array | Optional/Required |
Bundle Items Query Parameters
Parameter | Type | Description |
---|---|---|
mandatoryProducts | Multidimensional array | Required |
optionalProducts | Multidimensional array | Required |
Mandatory Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Optional Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Coupon Query Parameters
Parameter | Type | Description |
---|---|---|
coupon_code | String | Required |
channel_type | String | Required |
Return orders
Return orders API provide all / one return orders list
Get All
curl 'https://api.asalta.com/pos/return_orders
?sale_id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/return_orders?sale_id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"data":[
{
"id":"13",
"date":"2017-05-25 11:57:00",
"reference_no":"RETURNORDER/2017/05/0062",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"10",
"biller":"REV22",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"<p>dam</p>",
"total":"1000.0000",
"product_discount":"0.0000",
"order_discount_id":null,
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"65.4200",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"65.4200",
"exchange":"0.0000",
"grand_total":"1000.0000",
"surcharge":"0.0000",
"attachment":null,
"items": [
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.2900",
"nup_before_order_discount":"467.289719626170000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.7100",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"38.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"bundle_items":[
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"10",
"real_unit_price":"240.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
}
]
},
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.2900",
"nup_before_order_discount":"467.289719626170000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.7100",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"38.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"bundle_items": [
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"10",
"real_unit_price":"240.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
}
]
}
]
},
{
"id":"18",
"date":"2017-05-25 17:14:00",
"reference_no":"RETURNORDER/2017/05/0060",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"33",
"biller":"caca ",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"total":"296.0000",
"product_discount":"0.0000",
"order_discount_id":"null",
"total_discount":"0.0000",
"order_discount":null,
"product_tax":"19.3600",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"19.3600",
"exchange":"0.0000",
"grand_total":"296.0000",
"surcharge":"0.0000",
"attachment":null,
"items":[
{
"product_id":"47",
"product_code":"eu007",
"product_name":".'EYE MA'SK",
"product_type":"standard",
"option_id":"0"
,"net_unit_price":"138.3200",
"nup_before_order_discount":"138.317757009350000",
"quantity":"2.0000",
"warehouse_id":"8",
"item_tax":"19.3600",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"296.0000",
"serial_no":"",
"real_unit_price":"148.0000"
}
]
}
],
"_metadata":{
"currentPage":1,
"nextPage":2,
"pageSize":20,
"totalRecord":33
}
}
This endpoint retrieves all return orders.
HTTP Request
GET https://api.asalta.com/pos/return_orders?sale_id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
sale_id | Number | Required. |
page | Number | Optional. |
Get one
curl 'https://api.asalta.com/pos/return_orders?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/return_orders?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"id":"13",
"date":"2017-05-25 11:57:00",
"reference_no":"RETURNORDER/2017/05/0062",
"customer_id":"1",
"customer":"Walk-in Customer",
"biller_id":"10",
"biller":"REV22",
"warehouse": {
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne1</p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"<p>dam</p>",
"total":"1000.0000",
"product_discount":"0.0000",
"order_discount_id":null,
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"65.4200",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"65.4200",
"exchange":"0.0000",
"grand_total":"1000.0000",
"surcharge":"0.0000",
"attachment":null,
"items": [
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.2900",
"nup_before_order_discount":"467.289719626170000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.7100",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"38.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"bundle_items":[
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"10",
"real_unit_price":"240.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
}
]
},
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.2900",
"nup_before_order_discount":"467.289719626170000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.7100",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"38.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"bundle_items": [
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"10",
"real_unit_price":"240.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
}
]
}
]
}
This endpoint retrieves one return order detail.
HTTP Request
GET https://api.asalta.com/pos/return_orders?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid return order id |
New Return Order
curl -POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
-d '{
"sale_id":173,
"date":"2018-01-19 06:19:54",
"customer_id":7192,
"customer_name":"[email protected]",
"biller_id":5902,
"biller_name":1,
"warehouse_id":8,
"note":"",
"return_surcharge":5,
"order_discount_percentage":false,
"order_discount":4,
"payment_term":"0",
"items":[
{
"product_id":73,
"quantity":1,
"option_id":false,
"discount_percentage":true,
"item_discount":0,
"tax_rate_id":23,
"bundle_items":{
"mandatoryProducts":[
{
"bundle_item_id":"56",
"items":[
{
"product_id":"47",
"quantity":1,
"sub_item_id":"205",
"item_variants":false
}
]
}
],
"optionalProducts":[
{
"bundle_item_id":"57",
"items":[
{
"product_id":"43",
"quantity":2,
"sub_item_id":"206",
"item_variants":"39,23"
}
]
}
]
}
},
{
"product_id":50,
"quantity":1,
"option_id":false,
"discount_percentage":true,
"item_discount":0,
"tax_rate_id":23
},
{
"product_id":46,
"quantity":1,
"option_id":11,
"discount_percentage":false,
"item_discount":12,
"tax_rate_id":23
},
{
"product_id":92,
"quantity":1,
"option_id":false,
"discount_percentage":false,
"item_discount":0,
"tax_rate_id":23
}
]
}' \
'https://api.asalta.com/pos/return_orders'
<?php
$data = [
'sale_id' => 173,
'date' => "2018-01-17 03:05:26",
'customer_id'=> 7192,
'customer_name'=> "[email protected]",
'biller_id'=> 5902,
'biller_name'=> 1,
'warehouse_id'=> 8,
'note'=> '',
'return_surcharge'=> 5,
'order_discount_percentage'=> false,
'order_discount'=> 4,
'payment_term' => "0",
'items' => [
[
'product_id' => 73,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
'bundle_items' => [
'mandatoryProducts' =>[
[
'bundle_item_id' => '56',
'items' => [
[
'product_id' => '47',
'quantity' => 1,
'sub_item_id' => '205',
'item_variants' => false
]
],
],
],
'optionalProducts' =>[
[
'bundle_item_id' => '57',
'items' => [
[
'product_id' => '43',
'quantity' => 2,
'sub_item_id' => '206',
'item_variants' => '39,23'
]
],
]
],
],
],
[
'product_id' => 50,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => true,
'item_discount' => 0,
],
[
'product_id' => 46,
'quantity' => 1,
'option_id' => 11,
'discount_percentage' => false,
'item_discount' => 12,
],
[
'product_id' => 92,
'quantity' => 1,
'option_id' => false,
'discount_percentage' => false,
'item_discount' => 0,
],
],
];
$oAuth2Client->api("pos/return_orders", "POST", $data);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data":{
"id":"38",
"date":"2017-12-04 08:37:00",
"reference_no":"RETURNORDER\/2017\/12\/0182",
"customer_id":"7192",
"customer":"Mass Maari",
"biller_id":"5902",
"biller":"RaiN ",
"warehouse":{
"id":"8",
"code":"6",
"name":"Homefix",
"warehouse_type":"Consignment",
"address":"LIne 1<\/p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"12",
"store_margin":"33.0000",
"status":"active"
},
"note":"",
"total":"595.0000",
"product_discount":"0.0000",
"order_discount_id":"4",
"total_discount":"4.0000",
"order_discount":"4.0000",
"product_tax":"38.9300",
"order_tax_id":"5",
"order_tax":"0.0000",
"total_tax":"38.9300",
"exchange":"0.0000",
"grand_total":"590.0000",
"surcharge":"5.0000",
"attachment":null,
"items":[
{
"product_id":"73",
"product_code":"682047",
"product_name":".'BUNDLE B'4",
"product_type":"bundle",
"option_id":"0",
"net_unit_price":"467.5100",
"nup_before_order_discount":"467.289719626170000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"32.4900",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"-82.0000",
"subtotal":"500.0000",
"serial_no":"",
"real_unit_price":"500.0000",
"bundle_items":[
{
"bundle_item_id":"56",
"product_id":"47",
"sub_item_id":"205",
"sub_item_qty":"1.0000",
"option_id":"0",
"real_unit_price":"148.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"23",
"real_unit_price":"150.00000"
},
{
"bundle_item_id":"57",
"product_id":"43",
"sub_item_id":"206",
"sub_item_qty":"1.0000",
"option_id":"39",
"real_unit_price":"120.00000"
}
]
},
{
"product_id":"50",
"product_code":"eu010",
"product_name":"GLOVES",
"product_type":"standard",
"option_id":"0",
"net_unit_price":"92.5700",
"nup_before_order_discount":"92.523364485981000",
"quantity":"1.0000",
"warehouse_id":"8",
"item_tax":"6.4300",
"tax_rate_id":"3",
"tax":"7.0000%",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"99.0000",
"serial_no":"",
"real_unit_price":"99.0000"
}
]
},
"error":false
}
This endpoint will create a new return orders.
HTTP Request
POST https://api.asalta.com/pos/return_orders
Post Parameters
Parameter | Type | Description |
---|---|---|
date | Date | Required, Format is YYYY-MM-DD |
sale_id | Number | Required |
customer_id | Number | Required |
customer_name | String | Optional |
biller_id | Number | Required |
biller_name | String | Optional |
warehouse_id | Number | Required |
note | String | Optional |
return_surcharge | Number | Optional |
order_discount_percentage | Boolean | True or False |
order_discount | Number | Optional |
payment_term | Number | Optional |
items | Multidimensional array | Required |
Items Query Parameters
Parameter | Type | Description |
---|---|---|
product_id | Number | Required |
quantity | Number | Required |
option_id | Number | Optional |
discount_percentage | Boolean | True or False |
item_discount | Number | Optional |
bundle_items | Multidimensional array | Optional/Required |
Bundle Items Query Parameters
Parameter | Type | Description |
---|---|---|
mandatoryProducts | Multidimensional array | Required |
optionalProducts | Multidimensional array | Required |
Mandatory Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Optional Product Items Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Required |
quantity | Number | Required |
sub_item_id | Number | Required |
item_variants | String | Optional |
bundle_item_id | Number | Required |
Void Order
Void Order API provide void a order details
curl 'https://api.asalta.com/pos/void_order?id=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/void_order?id=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"message":"Successfully void your order",
"error":false
}
This endpoint retrieves one order detail.
HTTP Request
GET https://api.asalta.com/pos/void_order?id=n
Query Parameters
Parameter | Type | Description |
---|---|---|
id | Number | Valid order id |
Gift Cards
Gift Card API provide buyers details
curl 'https://api.asalta.com/pos/giftcards?card_no=n' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
<?php
$oAuth2Client->api("pos/giftcards?card_no=n", "GET", []);
?>
The above command returns JSON structured like this:
{
"message":"Success",
"data":{
"id":"1233",
"date":"2018-01-11 14:11:00",
"reference_no":"SALE\/POS\/2018\/01\/0129",
"customer_id":"7320",
"customer":"RaiN StaR",
"biller_id":"7317",
"biller":"Meha Software Admin",
"warehouse":{
"id":"16",
"code":"TSI",
"name":"Tenkasi",
"warehouse_type":"Warehouse",
"address":"TSI<\/p>",
"map":null,
"phone":"",
"email":"",
"allow_discount":"no",
"replenishment_email":"314",
"store_margin":"0.0000",
"status":"active"
},
"note":"",
"staff_note":"",
"total":"12500.0000",
"product_discount":"0.0000",
"order_discount_id":"0",
"total_discount":"0.0000",
"order_discount":"0.0000",
"product_tax":"0.0000",
"order_tax_id":"21",
"order_tax":"0.0000",
"total_tax":"0.0000",
"shipping":"0.0100",
"exchange":"0.0000",
"grand_total":"12500.0100",
"sale_status":"completed",
"payment_status":"due",
"payment_term":"0",
"due_date":null,
"total_items":"2",
"pos":"1",
"paid":"0.0000",
"return_id":null,
"surcharge":"0.0000",
"attachment":null,
"gst":"0.0000",
"items":[
{
"product_id":"1515676266",
"product_code":"4170047658701689",
"product_name":"Gift Card",
"product_type":"manual",
"option_id":"0",
"net_unit_price":"1100.0000",
"nup_before_order_discount":"1100.000000000000000",
"unit_price":"1100.0000",
"quantity":"1.0000",
"warehouse_id":"16",
"item_tax":"0.0000",
"tax_rate_id":"0",
"tax":"",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"1100.0000",
"serial_no":"",
"real_unit_price":"1100.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":"",
"gift_card":{
"id":"112",
"card_no":"4170047658701689",
"date":"2018-01-11 18:41:06",
"value":"1100.0000",
"balance":"1100.0000",
"expiry":null
}
},
{
"product_id":"1515676266",
"product_code":"2288466373520623",
"product_name":"Gift Card",
"product_type":"manual",
"option_id":"0",
"net_unit_price":"11400.0000",
"nup_before_order_discount":"11400.000000000000000",
"unit_price":"11400.0000",
"quantity":"1.0000",
"warehouse_id":"16",
"item_tax":"0.0000",
"tax_rate_id":"0",
"tax":"",
"discount":"0",
"item_discount":"0.0000",
"bundle_discount":"0.0000",
"subtotal":"11400.0000",
"serial_no":"",
"real_unit_price":"11400.0000",
"free_items_qty":"0",
"promo_id":"0",
"promo_title":"",
"gift_card":{
"id":"113",
"card_no":"2288466373520623",
"date":"2018-01-11 18:41:06",
"value":"11400.0000",
"balance":"11400.0000",
"expiry":null
}
}
]
},
"error":false
}
This endpoint retrieves one customer detail.
HTTP Request
GET https://api.asalta.com/pos/giftcards?card_no=n
Query Parameters
Parameter | Type | Description |
---|---|---|
card_no | Number | gift card number |
Report Sales
Asalta Inventory & POS api provide report for sales.
curl 'https://api.asalta.com/report/sales' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer XXXXXX' \
The above command returns JSON structured like this:
[
{
"sale_date": "2016-03-24 09:30:00",
"customer_type": "Mail Customer",
"customer_name": "Sam",
"reference_no": "5555",
"biller_id": "3",
"discount": "0.00",
"tax": "446.93",
"shipping_charge": "0.00",
"biller": "First Biller",
"total": "3084.07",
"grand_total": "3531.00",
"status": "pending",
"payment_status": "due",
"terms": "0",
"due_date": null,
"total_items": "11",
"paid": "0.00",
"return_id": null,
"surcharge": "0.00"
},
{
"sale_date": "2016-04-02 18:36:34",
"customer_type": "Walk-in Customer",
"customer_name": "John",
"reference_no": "SALE/POS/2016/04/0076",
"biller_id": "3",
"discount": "0.00",
"tax": "85.06",
"shipping_charge": "0.00",
"biller": "First Biller",
"total": "1314.94",
"grand_total": "1400.00",
"status": "completed",
"payment_status": "paid",
"terms": "0",
"due_date": null,
"total_items": "5",
"paid": "1400.00",
"return_id": null,
"surcharge": "0.00",
"payment_details": [
{
"payment_type": "cash",
"payment_ref_no": "IPAY/2016/04/0160",
"paid_amonut": "1400.00",
"paid_date": "2016-04-02 18:36:34"
}
]
}
]
This endpoint retrieves a sales.
HTTP Request
POST https://api.asalta.com/report/sales
URL Parameters
Parameter | Type | Description |
---|---|---|
startdate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-01. |
enddate | date | If set to date(yyyy-mm-dd), Ex: 2016-07-27. |
Possible Errors
The Asalta Inventory & POS uses the following error codes 400 & 500:
400 - Bad Request
S.no | Meaning |
---|---|
1 | Please provide valid date format. |
2 | Field {{Field}} is Mandatory. |
3 | Please provide valid page. |
4 | Your paid amount must be less than or equal to sales amount. |
500 - Internal Server Error
S.no | Meaning |
---|---|
1 | Please provide valid product, This is not bundle product. |
2 | Please provide valid bundle product , bundle does not have option id. Option id must false. |
3 | You are selected product is bundle, please add bundle items. |
4 | Field {{Field}} is Mandatory. |
5 | Please provide valid bundle item. |
6 | Bundle item quantity too large. |
7 | Your bundle item does not match,please provide valid data. |
8 | Error : "The quantity is out of stock for HAT" |
Errors
The Asalta API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request could not be processed |
401 | Unauthorized -- Your API key is wrong |
403 | Forbidden -- The resource requested is hidden for administrators only |
404 | Not Found -- The specified resource could not be found |
405 | Method Not Allowed -- You tried to access a resource with an invalid method |
406 | Not Acceptable -- You requested a format that isn't json |
410 | Gone -- The resource requested has been removed from our servers |
429 | Too Many Requests -- You're requesting too many resources! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. |