Balances & Rewards
Retrieve balances and view rewards progress for users.
Retrieve gift card balance
This request is used to check the user's quick pay balance on their account.
Query parameters
- Name
session_key- Type
- string
- Description
Session token for an end-customer.
Response attributes
- Name
amount- Type
- float
- Description
The quantity of quickpay balance the user has on their account.
- Name
currency- Type
- object
- Description
An object that contains information about the type of currency being used.
Request
curl -G https://api.spoonity.com/user/quick-pay/balance?session_key={session_key}
Response
{
"amount": 15.00,
"currency": {
"code": "CAD",
"id": 191,
"name": "Canadian Dollar",
"object": "currency"
},
"object": "Virtual\\Balance"
}
Retrieve all balances
This request is used to check all balances on a user's account, both quickpay and loyalty balances are returned.
Query parameters
- Name
session_key- Type
- string
- Description
Session token for an end-customer.
Response attributes
- Name
currency_id- Type
- integer
- Description
An internal reference number that indicates what currency is in use.
- Name
name- Type
- string
- Description
Indicates the currency in a way that is more user friendly.
- Name
currencyType- Type
- object
- Description
An object that holds information about the type of currency being used.
- Name
status- Type
- object
- Description
An object that contains information about the current status of this currency.
- Name
balance- Type
- float
- Description
Indicates the amount of this currency that is on this account.
- Name
expirying- Type
- array
- Description
An array of objects that give information about the date of expiry of this loyalty balance (as a Unix timestamp in seconds from 1970-01-01 00:00:00), and the quantity of the balance that expires on this date.
Request
curl -G https://api.spoonity.com/user/currency/balance?session_key={session_key}
Response
[
{
"currency": {
"currency_id": 191,
"name": "Canadian Dollar",
"currencyType": {
"currencyType_id": 1,
"name": "Quick Pay"
},
"status": {
"status_id": 1,
"name": "Active"
}
},
"balance": 0,
"expiring": []
},
{
"currency": {
"currency_id": 961,
"name": "Points",
"currencyType": {
"currencyType_id": 2,
"name": "Loyalty"
},
"status": {
"status_id": 1,
"name": "Active"
}
},
"balance": 0,
"expiring": []
}
]
Get rewards progress
This request returns a list of rewards this user is eligible for with this vendor, as well as information about the user's tier.
Query parameters
- Name
session_key- Type
- string
- Description
Session token for an end-customer.
Response attributes
- Name
balances- Type
- array
- Description
An array of objects that hold information about the balances of each currency on this user's account.
- Name
count- Type
- integer
- Description
Indicates the number of rewards this user has available.
- Name
catalog- Type
- object
- Description
An object that contains information about how this reward is invoked.
- Name
summary- Type
- string
- Description
A brief overview of what the reward is and what points will be removed.
- Name
template- Type
- object
- Description
The style type for how the perk should be displayed.
- Name
type- Type
- object
- Description
An object that holds information about the type of reward being offered.
- Name
id- Type
- integer
- Description
An internal reference number unique to each reward.
- Name
currency- Type
- object
- Description
An object that contains information about the type of currency being used.
- Name
name- Type
- string
- Description
Indicates the reward in a way that is more user friendly.
- Name
description- Type
- string
- Description
A description of what the reward entails.
- Name
cost- Type
- integer
- Description
The amount of points this reward requires to be redeemed.
- Name
available- Type
- integer
- Description
How many of these rewards the user is able to redeem with their current loyalty balance.
- Name
progress- Type
- integer
- Description
The number of points the user has towards qualifying for a reward of this type.
- Name
expiring- Type
- object
- Description
An object that holds information about when this reward will expire.
- Name
tier- Type
- object
- Description
An object that holds information about the prestige level of the user.
Request
curl -G https://api.spoonity.com/user/reward/list?session_key={session_key}
Response
{
"balances": [...],
"count": 3,
"data": [
{
"catalog": {
"id": "discount_free_coffee",
"name": "Free Coffee"
},
"group": null,
"summary": "Spend 50 points to get a free sandwich",
"template": {...},
"type": {...},
"id": 642,
"currency": {...},
"name": "Free Item",
"description": "Includes Small, Regular, and Large sandwiches.",
"cost": 50,
"available": 0,
"progress": 0,
"expiring": {
"data": []
}
},
],
"next_page_url": "https://master-v2-api.staging.spoonity.com/user/reward/list?session_key=b63d345b0323a1efbe324b9373366ca2&page=1",
"object": "collection",
"page": null,
"page_size": null,
"previous_page_url": null,
"total_pages": 0,
"tier": {
"object": "tier",
"count": 1,
"current": {
"description": "",
"id": 12,
"summary": "",
"object": "current_tier",
"name": "Default",
"since": 1559131926
},
"next": {
"id": "",
"object": "next_tier",
"name": "",
"progress": 0,
"amount": 0,
"summary": "",
"description": ""
},
"all": {
"vendor_tier_changed": 1559131926,
"tier_immunity_days": 0,
"days_remaining": -5,
"data": [
{
"id": 12,
"name": "Default",
"progress": null,
"amount": null,
"summary": "",
"description": ""
}
]
}
}
}