Link Search Menu Expand Document

Receipt object

You can use the Spaaza API to get individual receipt objects or all receipts for a customer. This can be used to provide a customer with access to their full purchase history as well as their individual purchases. Spaaza also makes a PDF of the receipt available for the customer.

Receipt Object

Example response


{
    "id": 547250,
    "retailer_basket_code": "0000100117000027760",
    "fx_rate": 322,
    "currency": {
        "currency_id": 0,
        "currency_code": "",
        "currency_name_en": "",
        "currency_symbol": ""
    },
    "timestamp": "2023-06-15T11:35:58Z",
    "type": "in_store",
    "quantity": 3,
    "subtotal": 16.49,
    "subtotal_converted": 0.05121118,
    "total_value": 16.49,
    "total_converted": 0.05121118,
    "shipping_charge": 0,
    "shipping_charge_converted": 0,
    "tax_lines": [],
    "chain": {
        "id": 1743,
        "name": "Acme",
        "email": "info@acme.com",
        "logo_url": "https://s3-eu-west-1.amazonaws.com/receipts-chain-logo/1743.png",
        "website_url": "https://s3.eu-west-1.amazonaws.com/chain-images-test01.spaaza.com/logo-1743.jpg",
        "currency": "United States dollar",
        "currency_symbol": "$",
        "business": {
            "id": 2797,
            "name": "Acme Amsterdam",
            "address": {
                "address_1": "Herengracht 551",
                "address_2": null,
                "address_3": null,
                "towncity": "Amsterdam",
                "postal_code": "1017 BW",
                "country_code": "NL",
                "region": "",
                "location": {
                    "lat": 52.365100,
                    "lon": 4.895130
                },
                "google_place_id": null
            },
            "phone_number": "",
            "email": "",
            "branch_code": "1001",
            "website_url": "",
            "review_url": ""
        },
        "receipts_service_active": true
    },
    "employee": {
        "code": "",
        "name": ""
    },
    "notes": "",
    "monetary_wallet": {
        "contributions": [],
        "total": 0,
        "title": ""
    },
    "points_wallet": {
        "contributions": [
            {
                "amount": 1,
                "campaign_title": "Earn a sticker for every $10"
            },
            {
                "amount": -10,
                "campaign_title": "Acme Rewards"
            }
        ],
        "total": 20.08,
        "title": "Mugs and cups saving card"
    },
    "payment_methods": [
        {
            "payment_method": "Cash USD",
            "payment_amount": 16.49,
            "payment_amount_converted": null
        }
    ],
    "basket_vouchers": [
        {
            "campaign_title": "TEST Kefalos Aloe promotion",
            "campaign_id": 2288,
            "campaign_title_localised": "TEST Kefalos Aloe promotion",
            "voucher_text": "TEST Kefalos Aloe promotion",
            "task_id": 0,
            "amount": 0.55,
            "discount_ratio": 0,
            "type": "basket",
            "description": "",
            "notes": "",
            "title": "",
            "image_url": ""
        },
        {
            "campaign_title": "TEST MAHATMA JASMINE RICE 2KG 3 for 2",
            "campaign_id": 2315,
            "campaign_title_localised": "TEST MAHATMA JASMINE RICE 2KG 3 for 2",
            "voucher_text": "TEST MAHATMA JASMINE RICE 2KG 3 for 2",
            "task_id": 0,
            "amount": 2.78,
            "discount_ratio": 0,
            "type": "basket",
            "description": "",
            "notes": "",
            "title": "",
            "image_url": ""
        }
    ],
    "honour_vouchers": [],
    "line_items": [
        {
            "product_id": 0,
            "barcode": "6009651163878",
            "retailer_product_code": "",
            "sku": "PR-YOGHURT",
            "name": "KEFALOS ALOE VERA GREEN TEA L FAT YOGH 1KG",
            "description": "KEFALOS ALOE VERA GREEN TEA L FAT YOGH 1KG acme Rewards",
            "original_price": 5.52,
            "original_price_converted": 0.017142856,
            "sale_price": 5.52,
            "sale_price_converted": 0.017142856,
            "quantity": 1,
            "quantity_unit": "item",
            "product": {
                "brand": "",
                "category": "",
                "description": "KEFALOS ALOE VERA GREEN TEA L FAT YOGH 1KG acme Rewards",
                "id": 289456,
                "image_url": "",
                "name": "KEFALOS ALOE VERA GREEN TEA L FAT YOGH 1KG",
                "owner_code": "PR-YOGHURT",
                "price": 5.52,
                "product_variant": {
                    "barcode": [
                        {
                            "barcode": "6009651163878",
                            "deleted": false,
                            "id": 3706436
                        }
                    ],
                    "colour": "",
                    "condition": "new",
                    "cost_price": 0,
                    "id": 3098091,
                    "image_url": "",
                    "price": 5.52,
                    "size": "",
                    "web_url": ""
                },
                "season": "",
                "webshop_url": ""
            },
            "purchase_progress_distribution": [
                {
                    "contributing_campaign": {
                        "campaign_id": 2298,
                        "campaign_title": "Earn a sticker for every $10",
                        "campaign_title_localised": "Earn a sticker for every $10",
                        "campaign_type": "cashback"
                    },
                    "purchase_progress_campaign_id": 1729,
                    "purchase_progress_campaign_title": "Mugs and cups saving card",
                    "purchase_progress_campaign_title_localised": "Mugs and cups saving card",
                    "purchase_progress_campaign_type": "points_wallet",
                    "purchase_progress_distribution_amount": "0.30"
                },
                {
                    "contributing_campaign": {},
                    "purchase_progress_campaign_id": 2283,
                    "purchase_progress_campaign_title": "BT Spend Target",
                    "purchase_progress_campaign_title_localised": "BT Spend Target",
                    "purchase_progress_campaign_type": "progress",
                    "purchase_progress_distribution_amount": "4.97"
                }
            ]
        },
        {
            "product_id": 0,
            "barcode": "6009617222342",
            "retailer_product_code": "",
            "sku": "PR-CHEESE",
            "name": "LANCEWOOD WHITE CHEDDAR 300G",
            "description": "LANCEWOOD WHITE CHEDDAR 300G",
            "original_price": 5.963,
            "original_price_converted": 0.018509317,
            "sale_price": 5.963,
            "sale_price_converted": 0.018509317,
            "quantity": 1,
            "quantity_unit": "item",
            "product": {
                "brand": "",
                "category": "",
                "description": "LANCEWOOD WHITE CHEDDAR 300G",
                "id": 289388,
                "image_url": "",
                "name": "LANCEWOOD WHITE CHEDDAR 300G",
                "owner_code": "PR-CHEESE",
                "price": 5.96,
                "product_variant": {
                    "barcode": [
                        {
                            "barcode": "6009617222342",
                            "deleted": false,
                            "id": 3706368
                        }
                    ],
                    "colour": "",
                    "condition": "new",
                    "cost_price": 0,
                    "id": 3098023,
                    "image_url": "",
                    "price": 5.96,
                    "size": "",
                    "web_url": ""
                },
                "season": "",
                "webshop_url": ""
            },
            "purchase_progress_distribution": [
                {
                    "contributing_campaign": {
                        "campaign_id": 2298,
                        "campaign_title": "Earn a sticker for every $10",
                        "campaign_title_localised": "Earn a sticker for every $10",
                        "campaign_type": "cashback"
                    },
                    "purchase_progress_campaign_id": 1729,
                    "purchase_progress_campaign_title": "Mugs and cups saving card",
                    "purchase_progress_campaign_title_localised": "Mugs and cups saving card",
                    "purchase_progress_campaign_type": "points_wallet",
                    "purchase_progress_distribution_amount": "0.36"
                },
                {
                    "contributing_campaign": {},
                    "purchase_progress_campaign_id": 2283,
                    "purchase_progress_campaign_title": "BT Spend Target",
                    "purchase_progress_campaign_title_localised": "BT Spend Target",
                    "purchase_progress_campaign_type": "progress",
                    "purchase_progress_distribution_amount": "5.96"
                }
            ]
        },
        {
            "product_id": 0,
            "barcode": "6007421002778",
            "retailer_product_code": "",
            "sku": "GR-PASTA",
            "name": "MAHATMA JASMINE RICE 2KG",
            "description": "MAHATMA JASMINE RICE 2KG acme Rewards",
            "original_price": 2.78,
            "original_price_converted": 0.00863354,
            "sale_price": 2.78,
            "sale_price_converted": 0.00863354,
            "quantity": 3,
            "quantity_unit": "item",
            "product": {
                "brand": "",
                "category": "",
                "description": "MAHATMA JASMINE RICE 2KG acme Rewards",
                "id": 289455,
                "image_url": "",
                "name": "MAHATMA JASMINE RICE 2KG",
                "owner_code": "GR-PASTA",
                "price": 2.78,
                "product_variant": {
                    "barcode": [
                        {
                            "barcode": "6007421002778",
                            "deleted": false,
                            "id": 3706435
                        }
                    ],
                    "colour": "",
                    "condition": "new",
                    "cost_price": 0,
                    "id": 3098090,
                    "image_url": "",
                    "price": 2.78,
                    "size": "",
                    "web_url": ""
                },
                "season": "",
                "webshop_url": ""
            },
            "purchase_progress_distribution": [
                {
                    "contributing_campaign": {
                        "campaign_id": 2298,
                        "campaign_title": "Earn a sticker for every $10",
                        "campaign_title_localised": "Earn a sticker for every $10",
                        "campaign_type": "cashback"
                    },
                    "purchase_progress_campaign_id": 1729,
                    "purchase_progress_campaign_title": "Mugs and cups saving card",
                    "purchase_progress_campaign_title_localised": "Mugs and cups saving card",
                    "purchase_progress_campaign_type": "points_wallet",
                    "purchase_progress_distribution_amount": "0.34"
                },
                {
                    "contributing_campaign": {},
                    "purchase_progress_campaign_id": 2283,
                    "purchase_progress_campaign_title": "BT Spend Target",
                    "purchase_progress_campaign_title_localised": "BT Spend Target",
                    "purchase_progress_campaign_type": "progress",
                    "purchase_progress_distribution_amount": "5.56"
                }
            ]
        }
    ],
    "user": {
        "id": 3922958,
        "user_id": 3922958,
        "first_name": "John ",
        "last_name": "Smith",
        "country_code": "NL",
        "gender": "male",
        "birthday": "1978-11-01",
        "signup_channel": "mobile:ios",
        "username": "john.smith@spaaza.com",
        "auxiliary_identifier": "230000050232456",
        "authentication_point_identifier": "1353151",
        "authentication_point": {
            "is_multi": false,
            "id": 19
        },
        "mailing_list": {
            "mailing_list_subscribed": false,
            "printed_mailing_list_subscribed": false
        },
        "opt_in_programme": {
            "programme_opted_in": true,
            "join_date": "2023-03-01T09:28:25+00:00"
        },
        "obfuscated": false,
        "is_influencer": false,
        "home_store": {
            "home_store_id": null,
            "home_store_name": "",
            "home_store_owner_code": ""
        },
        "Deleted": false,
        "address_streetname": "Kerkstraat",
        "address_housenumber": "15",
        "address_housenumber_extension": "",
        "address_line_2": "",
        "address_line_3": "",
        "address_towncity": "Amsterdam",
        "address_regionstate": "Noord Holland",
        "address_latitude": 0,
        "address_longitude": 0,
        "address_postalcode": "2000",
        "phone_number": "+31123432123",
        "member_number": {
            "type": "custom",
            "code": "2000400"
        },
        "language": "en-UK",
        "opt_in_secondary": false,
        "registered": true,
        "is_employee": false,
        "push_notification_subscription": {
            "subscribed": true,
            "subscriptions": [
                {
                    "platform": "iOS",
                    "last_modified_date": "2023-03-01T09:30:08+00:00",
                    "app_version": "22"
                }
            ]
        },
        "loyalty_status": {
            "campaign_id": 337,
            "date_reached": "2023-08-23T09:40:43+00:00",
            "description": "Initial level in the Acme Programme",
            "last_review_date": "2023-08-23T09:40:43+00:00",
            "loyalty_level_id": 7,
            "monetary_balance_current": null,
            "name": "Blue",
            "next_review_date": null,
            "points_balance_current": 135,
            "points_to_proceed_next_level": 115,
            "points_to_remain_current_level": 0
        },
        "frequency": 5,
        "recency": 5,
        "monetary": 3,
        "overall": 553,
        "stores": "ACME Amsterdam,ACME Maastricht,Acme Groningen",
        "last_loyalty_activity_date": "",
        "brands": "",
        "online_shopper": true,
        "offline_shopper": true,
        "average_basket_value": "87.31",
        "days_since_last_purchase": 20,
        "number_of_purchases": 226,
        "referral_channel": "",
        "referral_code": "36kfp8",
        "referring_user": {
            "campaign_id": null,
            "id": null,
            "authentication_point_identifier": "",
            "referral_channel": "",
            "referral_code": ""
        },
        "last_purchase_date": "",
        "total_cashback_balance": 0,
        "points_wallet_balance": 0,
        "signup_store_id": 0,
        "signup_store_name": "",
        "signup_store_owner_code": "",
        "created_date": "",
        "last_modified_date": "",
        "spaaza_join_date": "",
        "referred": false,
        "last_login_date": ""
    }
}

Fields in the Receipt object

The following fields are returned in the receipt object.

Identifying the receipt

Details of the receipt

Field Description
id id of the receipt, this should be the same ID as used by the system that completed the sale (webshop, POS etc)
timestamp time of the receipt creation
quantity the number of items in the receipt
subtotal subtotal amount of the receipt without VAT
total_value the amount of the receipt with VAT
payment_method how the customer paid for the transaction

Line items

An array of all the products purchased in the transaction.

Field Description
product_id Spaaza’s product ID
barcode the barcode of the product
sku the SKU of the product
name the name of the product
description the description of the product
type the type or category of the product
original_price the original price of the product
quantity the quantity of each item in the transaction
quantity_unit the unit used for the quantity of each item in the transaction
sale_price what the final selling price was for the item
vouchers the total value of any vouchers redeemed against the item
color (metadata) the color of the product
size (metadata) the size of the product
image (metadata) a URL for an image of the product
sale_discount the discount applied on the sale of the product

Tax lines

An array of the taxes applied to the transaction.

Field Description
tax_value the total amount of the applicable tax on the order
order_value the monetary value of the order that the tax applies to
rate the applicable rate or percentage of the tax

Chain

Details of the retailer (referred to as a chain by Spaaza).

Field Description
id Spaaza’s ID for the retailer (or chain)
name the name of the retailer
email the contact details of the retailer
logo_url a URL for the logo of the retailer
currency the currency name of the retailer
currency_symbol the currency symbol of the retailer
receipts_service_active whether the chain has activate the receipts service in Spaaza

Business

Within the “chain” the details of the physical store where the transaction occured (referred to as a business by Spaaza) are included.

Field Description
id Spaaza’s store ID
name the name of the store
address a section that includes the address details of the store
phone_number the store’s phone number
email the store’s email address
website_url the store’s website URL

User

The user (also referred to as a user or customer in other parts of this documentation) who completed the transaction.

Field Description
id Spaaza’s ID for the user. Note that this is not the same number as is shown on the customer’s loyalty card or in an app (see entity code)
user_name a user name for the user
entity_code Spaaza’s entity code which is the customer’s loyalty card number.
first_name tte customer’s first name
last_name the customer’s last name
country_code the ISO ALPHA-2 code for the customer’s country
gender the customer’s gender
birthday the customer’s birthday
total_points_balance the customer’s total points balance
email the customer’s email address
registered whether the customer is ‘registered’ - the definition of ‘registered’ is determined by the retailer
shipping_address a section which includes the shipping address details of the customer
billing_address a section which includes the shipping address details of the customer

Monetary Wallet

If the retailer (or Chain) is using Spaaza’s Wallet functionality then the details of what was earned on the user’s wallet as a result of the transaction are included in the receipt.

Field Description
total the total amount in the customer’s wallet directly after the transaction
title the title of the wallet rewards

Monetary Wallet Contributions

The contributions section in the Monetary Wallet is an array of campaigns that added value to the customer’s wallet as a result of the transaction. For example: “customers earn 5% back” and “customer get an extra 5% back this weekend”.

Field Description
amount the amount added by the contributor campaign
campaign_title the title of the contributor campaign

Points Wallet

If the retailer (or Chain) is using Spaaza’s points functionality then the details of the points earned as a result of the transaction are included in the receipt.

Field Description
total the total amount of points directly after the transaction
title the title of the points program

Points Wallet Contributions

The contributions section in the Points Wallet is an array of campaigns that added points as a result of the transaction. For example: “customers earn 100 points on every €100 spent” and “customer get an extra 100 points on every €100 spent this weekend”.

Field Description
amount the amount added by the contributor campaign
campaign_title the title of the contributor campaign

Template content

Some styling and content settings for a receipt.

Field Description
subject a custom subject for a receipt email
background_color a custom color, typically used for any receipt actions (ie a download PDF button)