Rest API Sales Plan - datawizio/pythonAPI GitHub Wiki

/sales-plan/ - return sales plan information

Request Example:

{
    "category" : 68805,
    "shops" : [1,2,3,4,5],
    "date" : "2018-03"
}

Response Example:


{
    "results": [
        {
            "shop": "1",
            "shop_name": "Магазин №31",
            "real": 2735261.1,
            "predicted": 3785583.6,
            "diff": -1050322.5,
            "diff_percent": -27.74,
            "estimate": 90.32
        },
        {
            "shop": "2",
            "shop_name": "Магазин №30",
            "real": 1638406.27,
            "predicted": 2075303.59,
            "diff": -436897.32,
            "diff_percent": -21.05,
            "estimate": 98.68
        },
        {
            "shop": "3",
            "shop_name": "Магазин №1",
            "real": 1506582.64,
            "predicted": 2120741.96,
            "diff": -614159.32,
            "diff_percent": -28.96,
            "estimate": 88.8
        },
        {
            "shop": "4",
            "shop_name": "Магазин №2",
            "real": 1202171.12,
            "predicted": 1793900.22,
            "diff": -591729.1,
            "diff_percent": -32.99,
            "estimate": 83.77
        },
        {
            "shop": "5",
            "shop_name": "Магазин №3",
            "real": 1290992.37,
            "predicted": 2001510.08,
            "diff": -710517.71,
            "diff_percent": -35.5,
            "estimate": 80.63
        },
        {
            "shop": "total",
            "shop_name": "total",
            "real": 8373413.5,
            "predicted": 11777039.45,
            "diff": -3403625.96,
            "diff_percent": -28.9,
            "estimate": 88.87
        }
    ]
}

Request for a sales plan for the category '68805' for the period 'March 2018' for shops '[1,2,3,4,5]'.

HTTP Request

POST http://api.datawiz.io/api/v1/sales-plan/

Request POST-parameters /sales-plan/

Parameter Name Parameter Type Description
date DateTime, String {"%Y-%m"} Period for which data should be returned
category int Category ID for which data should be returned
shops int, List Shop ID or list of shop IDs, for which data should be returned
by String Type of returned table
show String Output type for named columns
on String Determines how to group results (by category or shop)
group_level int(0-2) Plan level, where 0 - without separation, 1 - by groups of shops, 2 - by shops

Parameter date is required!

Response parameters /sales-plan/

Parameter Content
shop Shop ID
shop_name Shop Name
real Real result
predicted Expected result
diff Difference between expected and real results
diff_percent Percentage Difference
estimate Expected execution percentage

Parameters Content

Parameter Content Description
by "qty", "turnover", "receipts_qty" number of sales, turnover, number of receipts
show "id", "name", "both" by ID, by Name, Both
on "category", "shops" by categories, by shops

Returns Object DataFrame in format:

For on="shops"

diff diff_percent estimate predicted real shop
<data> <data> <data> <data> <data> <data>
<data> <data> <data> <data> <data> <data>
...
<data> <data> <data> <data> <data> <data>

For on="category"

category diff diff_percent estimate predicted real shop
<data> <data> <data> <data> <data> <data> <data>
<data> <data> <data> <data> <data> <data> <data>
...
<data> <data> <data> <data> <data> <data> <data>
⚠️ **GitHub.com Fallback** ⚠️