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": 123456,
"timestamp": "2017-07-03T11:56:04Z",
"type": "in_store",
"download_url": "https://s3-eu-west-1.amazonaws.com/test01-receipts-bucket/receipts/123456.pdf",
"quantity": 1,
"subtotal": 1000,
"total_value": 1000,
"payment_method": "unknown",
"line_items": [
{
"product_id": 0,
"barcode": "2000046371025",
"sku": "2000046371025",
"name": "ACME shorts",
"description": "the best pair you can buy",
"type": "shorts",
"original_price": 1000,
"quantity": 1.05,
"sale_price": 1000,
"vouchers": 0,
"metadata": {
"color": "blue",
"size": "L",
"image": ""
},
"sale_discount": ""
}
],
"tax_lines": [
{
"tax_value": 30.25,
"order_value": 100.99,
"rate": 0.21
},
{
"tax_value": 20.55,
"order_value": 99.99,
"rate": 0.06
},
{
"tax_value": 19.99,
"order_value": 200,
"rate": 1.5
}
],
"chain": {
"id": 1740,
"name": "ACME",
"email": "support@acme.co.za",
"logo_url": "https://s3-eu-west-1.amazonaws.com/receipts-chain-logo/1000.png",
"website_url": "",
"currency": "South African Rand",
"currency_symbol": "R",
"business": {
"id": 0,
"name": "ACME Cape Town",
"address": {
"address_1": "1 Table Mountain Drive",
"address_2": "",
"address_3": "",
"towncity": "Cape Town",
"postal_code": "",
"country_code": "ZA",
"location": {
"lat": -33.962822,
"lon": 18.4098410
}
},
"phone_number": "+272189777777",
"email": "table-mountain@acme.co.za",
"website_url": ""
},
"receipts_service_active": true
},
"shopper": {
"id": 897654,
"user_name": "",
"entity_code": "",
"first_name": "John",
"last_name": "Smith",
"country_code": "",
"gender": "M",
"birthday": "1982-05-30",
"total_points_balance": 0,
"email": "john.smith@email.com",
"registered": true,
"shipping_address": {
"address_1": "",
"address_2": "",
"address_3": "",
"towncity": "",
"postal_code": "",
"country_code": "",
"location": {
"lat": 0,
"lon": 0
}
},
"billing_address": {
"address_1": "",
"address_2": "",
"address_3": "",
"towncity": "",
"postal_code": "",
"country_code": "",
"location": {
"lat": 0,
"lon": 0
}
}
},
"monetary_wallet": {
"contributions": [
{
"amount": 100,
"campaign_title": "Earn big on every purchase"
}
],
"total": 1640,
"title": "ACME Bucks"
},
"points_wallet": {
"contributions": [],
"total": 0,
"title": ""
},
"basket_vouchers": [
{
"campaign_title": "Boardriders Bucks",
"voucher_text": "",
"amount": 500,
"type": "wallet"
}
],
"loyalty_status": {
"campaign_id": 2095,
"name": "Level 1",
"description": "Level 1 in the Programme",
"loyalty_level_id": 2,
"points_to_proceed_next_level": 500,
"points_to_remain_current_level": 220,
"maintenance_points_level": 200,
"last_review_date": "2019-04-04T00:05:22+00:00",
"next_review_date": "2020-04-04T00:05:22+00:00",
"date_reached": "2019-06-06T08:06:14+00:00"
}
}
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 |
download_url | a URL to access a PDF for the receipt |
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 |
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 |
the store’s email address | |
website_url | the store’s website URL |
Shopper
The shopper (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 shopper. 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 shopper |
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 |
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 shopper’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, typucally used for any receipt actions (ie a download PDF button) |