Get order statistics

POST /company/statistics/orders

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

Body

Pass the following properties via application/json or form encoding in the body of the request.

A dictionary with fields

Field Type Description
start Timestamp Start timestamp
end Timestamp End timestamp
shop_ids [Int] Shop IDs
stats [Dictionary] Array of Dictionary
acquire_methods [String] Optional. Array of String

Example request 1

POST /company/statistics/orders HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.6.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 557
{
    "start": 1657085991,
    "end": 1657085991,
    "shop_ids": [
        11,
        18,
        15
    ],
    "stats": [
        {
            "name": "...",
            "type": "order_count",
            "group_by": "day"
        },
        {
            "name": "...",
            "type": "order_count",
            "group_by": "day"
        },
        {
            "name": "...",
            "type": "order_count",
            "group_by": "day"
        }
    ],
    "acquire_methods": [
        "takeout",
        "delivery",
        "latch"
    ]
}

Response

A dictionary with fields

Field Type Description
stats [Dictionary] Array of Dictionary

Example response 1

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 3078

{
    "stats": [
        {
            "name": "...",
            "groups": [
                {
                    "name": "...",
                    "value": 14,
                    "count": 16,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": true
                    }
                },
                {
                    "name": "...",
                    "value": 16,
                    "count": 16,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": true
                    }
                },
                {
                    "name": "...",
                    "value": 14,
                    "count": 18,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": false
                    }
                }
            ],
            "average": 15,
            "total": 18,
            "count": 14
        },
        {
            "name": "...",
            "groups": [
                {
                    "name": "...",
                    "value": 12,
                    "count": 16,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": false
                    }
                },
                {
                    "name": "...",
                    "value": 10,
                    "count": 15,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": true
                    }
                },
                {
                    "name": "...",
                    "value": 17,
                    "count": 14,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": true
                    }
                }
            ],
            "average": 14,
            "total": 13,
            "count": 15
        },
        {
            "name": "...",
            "groups": [
                {
                    "name": "...",
                    "value": 10,
                    "count": 12,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": false
                    }
                },
                {
                    "name": "...",
                    "value": 19,
                    "count": 11,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": false
                    }
                },
                {
                    "name": "...",
                    "value": 18,
                    "count": 14,
                    "extra": {
                        "email": "...",
                        "email_when_newsletter": true
                    }
                }
            ],
            "average": 13,
            "total": 14,
            "count": 10
        }
    ]
}
Version update available Please adjust your integration to the latest stable version (1.9.0)
1.6.0 stable