{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: Accept 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.20
            },
            {
                "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.06
            }
        ],
        "tickets": [
            {
                "name": "Music Venue Sales",
                "mapping_code": "MUS",
                "product_code": null,
                "amount": 400,
                "vat": 80
            }
        ],
        "discounts": [
            {
                "name": "10% Resident's Discount",
                "type": "Percentage",
                "value": "10.00",
                "redemption_limit": 0,
                "redemption_count": 8,
                "redemption_value": 19.20
            }
        ],
        "payments": [
            {
                "name": "Credit/Debit Card",
                "mapping_code": null,
                "amount": 17800
            },
            {
                "name": "Cash",
                "mapping_code": null,
                "amount": 3460
            },
            {
                "name": "Voucher",
                "mapping_code": null,
                "amount": 460
            }
        ]
    }
}

Error Response

If the value of the 'date' field provided is not in the correct format or is not valid by some other means, the below 422 response will be returned.

{
    "message": "Please provide a valid date.",
    "errors": {
        "date": [
            "Please provide a valid date."
        ]
    }
}