list_sales
POST /list_sales
To get the TOTAL COUNT of list of sales by items for multiple search criteria.
Use this method with only_counted = 'Y' FIRST to determine how many total records there are for the given criteria.
After you call this method with only_counted = 'Y', then call again this method with only_counted = 'N', and pass the required paging parameters.
"api_credentials": {
"token": "XXXX"
},
"filter_define": {
"only_counted":"Y",
"from_date":"2016-01-01",
"to_date":"2016-10-10",
"items_selection":"",
"models_selection":"",
"stores_selection":"",
"include_returns":true,
"is_summary":true,
"profit_based_on":87,
"includes_vat": false,
}
To get a list of sales by items for multiple search criteria.
"api_credentials": {
"token": "XXXX"
},
"filter_define": {
"page_number":1,
"page_size":10,
"only_counted":"N",
"from_date":"2016-01-01",
"to_date":"2016-10-10",
"items_selection":"",
"models_selection":"",
"stores_selection":"",
"include_returns":true,
"is_summary":true,
"profit_based_on":87,
"includes_vat": false,
"request_password_365":"password provided"
}
| field |
type |
description |
|
api_credentials
|
| token |
string |
Credentials provided by Powersoft that allow access to the API |
|
filter_define
|
| only_counted |
string |
'Y' = brings only the total number of sales based on user filter criteria. 'N' = brings the list of the sales based on user filter criteria |
| page_number |
integer |
The page number in the entire list. eg Page 1. |
| page_size |
integer |
The number of rows to return. eg 10 rows |
| from_date |
string |
From date. The date must be provided in format yyyy-mm-dd |
| to_date |
string |
To date. The date must be provided in format yyyy-mm-dd |
| items_selection |
string |
A comma separated list of 365 items codes (eg 'ABC,COKE,1001,...'). If the value is empty then no search criteria by item is applied. |
| models_selection |
string |
A comma separated list of 365 models codes (eg 'ARTICLE01,DRESS,...'). If the value is empty then no search criteria by model is applied. |
| stores_selection |
string |
A comma separated list of 365 stores codes (eg '001,100,...'). If the value is empty then no search criteria by store is applied. |
| include_returns |
boolean |
If the list of sales includes the sales returns as well |
| is_summary |
boolean |
If true the list of sales is summarized only per item, otherwise it is presented as total sales per each day and item |
| profit_based_on |
integer |
| Based on this value is calculated the total cost and profit
|
|
0
|
Default price. It is the price defined at the system level
|
|
1
|
Price 1
|
|
2
|
Price 2
|
|
3
|
Price 3
|
|
4
|
Price 4
|
|
5
|
Price 5
|
|
6
|
Price 6
|
|
7
|
Price 7
|
|
8
|
Price 8
|
|
9
|
Price 9
|
|
10
|
Price 10
|
|
87
|
Weighted Average Cost
|
|
88
|
Average Cost
|
|
99
|
Latest Cost
|
|
| includes_vat |
boolean |
In case that total cost and profit is calculated based on one of the price from 1 to 10, or default price defined at the system level must be specified if the price used is the one including VAT or the one excluding VAT |
| request_password_365 |
string |
Request password as registered in 365 BASE64 encoded - optionally. The password is necessary if the user needs to use one of the cost value. Password is provided by Powersoft. |
Returns
TOTAL COUNT of list of sales by items for multiple search criteria (only_counted='Y').
{
"api_response": {
"response_code": "1",
"response_msg": "OK",
"response_id": ""
},
"total_count_list_sales": 2,
"list_sales": null
}
List of sales by items for multiple search criteria (only_counted='N').
{
"api_response": {
"response_code": "1",
"response_msg": "OK",
"response_id": ""
},
"total_count_list_sales": 2,
"list_sales": [
{
"sale_date_local": "",
"item_code_365": "ARTICLE01-AZURE-240",
"item_name": "ARTICLE 01",
"qty_sold": 13,
"total_cost": 98.28,
"total_net": 75.63,
"total_discount": 7.56,
"total_before_vat": 68.07,
"total_vat": 12.93,
"total_gross": 81,
"total_profit": -30.21
},
{
"sale_date_local": "",
"item_code_365": "ARTICLE01-BLK-290",
"item_name": "ARTICLE 01",
"qty_sold": 4,
"total_cost": 67.24,
"total_net": 50.43,
"total_discount": 0,
"total_before_vat": 50.43,
"total_vat": 9.57,
"total_gross": 60,
"total_profit": -16.81
}
]
}