{warning} This API is likely to change before the Beta period is over, please check back regularly to see the latest changes.

Get Sales Data

You can use this endpoint to get sales data in 2 ways. Either by passing a date (Y-m-d) and getting the data for that specific date or passing a datetime (Y-m-d H:m:s) and getting the sales data since that datetime.

Request

Headers

GET REQUEST (/sales-data)

Header: Content-Type - application/json
Header: Accepts - application/json
Header: Smart-Auth sk_XXXXXXXXXXXXXXXXXX

Body

{
    "date":"2021-01-01"
}

or

{
    "date":"2021-01-01 00:00:00"
}

Response

{
    "data": {
        "start_date": "2020-12-20 00:00:00",
        "end_date": "2021-01-30 08:31:31",
        "monetary": {
            "amount": 3610
        },
        "experience": [
            {
                "name": "Food",
                "mapping_code": "1001",
                "product_code": "Food",
                "amount": 7250,
                "vat": 345
            },
            {
                "name": "Accommodation",
                "mapping_code": "Accommodation",
                "product_code": "1234",
                "amount": 5792,
                "vat": 275.84
            },
            {
                "name": "Tours",
                "mapping_code": null,
                "product_code": null,
                "amount": 2015,
                "vat": 96.19999999999999
            },
            {
                "name": "Alcohol",
                "mapping_code": null,
                "product_code": null,
                "amount": 1040,
                "vat": 173.55
            },
            {
                "name": "Tasting",
                "mapping_code": null,
                "product_code": null,
                "amount": 1235,
                "vat": 58.5
            },
            {
                "name": "Breakfast",
                "mapping_code": null,
                "product_code": null,
                "amount": 378,
                "vat": 18.060000000000002
            }
        ]
    }
}

Error Response

{
    "message": "The given data was invalid.",
    "errors": {
        "date": [
            "Please provide a valid date."
        ]
    }
}