getCustomerPointsPurchases
Retrieve all of the points purchases for a logged-in customer
RivoJS.getCustomerPointsPurchases().then(function(resp){
console.log(resp)
});
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
opts | Object | { used: false } | An object containing additional options for the request. This object can include a used property to filter results based on whether the points purchases have been used. used: true will return only points purchases that have been used, while used: false will return unused points purchases. |
page | Number | N/A | The page of results you wish to retrieve. If there are a large number of points purchases, the results may be divided into pages. This parameter lets you navigate through different pages of results. |
Note: The "used" property in the opts
object refers to whether the points purchases have been used at checkout.
Example:
var opts = { used: true }; // Show only used points purchases
var page = 1; // Desired page of results
RivoJS.getCustomerPointsPurchases(opts, page).then(function(resp){
console.log(resp)
});
Sample response
{
"success": true,
"points_purchases": [
{
"id": 123456,
"name": "$5 off coupon",
"points_amount": 500,
"code": "BAL-782f400f990b",
"applied_at": "2023-06-08T14:51:30.623Z",
"expires_at": "2023-08-08T14:51:30.623Z",
"used_at": null,
"terms_of_service": {
"applies_to": "entire",
"reward_type": "fixed_amount",
"expires_at": "August 08, 2023 14:51",
"show_tos": true
},
"reward": {
"id": 54321,
"name": "$5 off coupon",
"enabled": true,
"points_amount": 500,
"points_type": "fixed",
"reward_type": "fixed_amount",
"source": "points",
"pretty_display_rewards": "$5 off coupon (500 points required)",
"icon_url": null,
"terms_of_service": {
"reward_type": "fixed_amount",
"applies_to": "entire",
"expiry_months": 2,
"show_tos": true
}
}
},
{
"id": 789012,
"name": "$5 off coupon - VIP reward",
"points_amount": 0,
"code": "BAL-8299d254c7c1",
"applied_at": "2023-06-08T14:51:14.641Z",
"expires_at": null,
"used_at": null,
"terms_of_service": {
"applies_to": "entire",
"reward_type": "fixed_amount",
"show_tos": false
},
"reward": {
"id": 111222,
"name": "$5 off coupon",
"enabled": true,
"points_amount": 0,
"points_type": "fixed",
"reward_type": "fixed_amount",
"source": "vip_tier",
"pretty_display_rewards": "$5 off coupon (0 points required)",
"icon_url": null,
"terms_of_service": {
"reward_type": "fixed_amount",
"applies_to": "entire",
"show_tos": false
}
}
}
],
"metadata": {
"next_page": null,
"prev_page": null
}
}
Note: The points_purchases
array contains detailed information about each points purchase, including ID, name, points amount, code, applied date, expiry date, usage status, terms of service, and associated reward information. The metadata object provides information about pagination.
Updated over 1 year ago