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:i:s) and getting the sales data since that datetime.

Request

Headers

POST 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": "2021-01-01 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
            }
        ]
    }
}

Response Schema

Data Object

Field Type Description
start_date string Start date of the sales period (Y-m-d H: i: s)
end_date string End date of the sales period (Y-m-d H: i: s)
monetary object Monetary summary of sales
experience array List of experience categories
tickets array List of ticket sales
discounts array List of discounts applied
payments array List of payment methods

Monetary

Field Type Description
amount integer Total monetary amount in currency

Experience

Field Type Description
name string Name of the experience category
mapping_code string Mapping code for the category (may be null)
product_code string Product code for the category (may be null)
amount integer Amount for this category
vat decimal VAT amount for this category

Ticket

Field Type Description
name string Name of the ticket sales category
mapping_code string Mapping code for tickets (may be null)
product_code string Product code for tickets (may be null)
amount integer Amount for ticket sales
vat decimal VAT amount for tickets

Discount

Field Type Description
name string Name of the discount
type string Discount type (e.g., Percentage)
value string Discount value as string
redemption_limit integer Maximum times discount can be used
redemption_count integer Number of times discount was used
redemption_value decimal Total discounted amount

Payment

Field Type Description
name string Payment method name
mapping_code string Mapping code for payment method (may be null)
amount integer Amount for this payment method

Error Response Example

All values in the response are in the currency of the organisation and the amount field of the monetary, experience and payment objects holds their value. For the discounts, it is the redemption_count and redemption_value values that detail how many times a discount was used and how much was discounted in total. The redemption_limit field is how many times the discount can be used in total.

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."
        ]
    }
}

Error Response Object

Field Type Description
message string Error message
errors object Object containing field-specific errors