list_sales_by_store
POST /list_sales_by_store
To get the TOTAL COUNT of list of sales by stores 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,
"date_selection_type":"SessionDateTime"
}
To get a list of sales by stores 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",
"date_selection_type":"SessionDateTime"
}
| 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. |
| date_selection_type |
string |
Accepted value: ValueDate and SessionDateTime. If the value is 'ValueDate' the filter for the from-to date is done by the transaction date, otherwise by the session date time of the transaction. |
Returns
TOTAL COUNT of list of sales by stores 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 stores 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": "",
"store_code_365": "100",
"store_name": "Powersoft 365",
"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": "",
"store_code_365": "100",
"store_name": "Store 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
}
]
}