Customer tiers
Customer tiers let you give two groups of customers different reward rates. Spendstream calls them standard and premium. You can call them anything you like in your own product, for example free and pro.
Where tiers work today: tiers are live for white-label and Full API publishers, on gift cards. Full API orders through
giftCardRequestApi,paymentLinkandgetPayByBankLinkare priced at the customer’s tier.
At a glance
White-label | Full API | |
|---|---|---|
Send | Yes | Yes (stored) |
Change a customer’s tier later | Yes | Yes (stored) |
Customers see their own rate on the storefront | Yes, on brand pages and at checkout | Not applicable |
Orders are priced at the customer’s tier rate | Yes | Yes |
Premium rates shown in | Not applicable | Yes: |
The tier shown on each gift card row of | Not applicable | Yes: |
Applies to | Gift cards | Gift cards |
Tiers apply to gift cards. Premium rates are set on gift card promotions only. Affiliate cashback rates depend on the affiliate network and have no tier.
How tiers work
- Every customer is either
standardorpremium. - You tell us each customer’s tier when you create them, and when it changes.
- For every brand, Spendstream sets a standard rate and an optional premium rate. A premium rate must be higher than the standard one.
- If a brand has no premium rate, premium customers get the standard rate for that brand.
- During a limited-time promotion, everyone gets the promotion rate and premium does not add to it.
- The customer’s tier is recorded on the order when it is placed, so changing their tier later does not change an order that is already placed.
- Until an order is paid, it is priced at the current rate for that tier. If Spendstream changes a brand’s rates before the customer pays, the new rate applies. Once an order is paid, it never changes.
Who sets the rates
Spendstream sets the rates for you, per brand. You cannot change them through the API or a dashboard of your own. If you want different rates for particular brands, tell your Spendstream contact.
Turning tiers on
Tiers are switched on for your account by Spendstream. Until then the tier field is ignored. Ask your Spendstream contact to switch it on for your staging account first, so you can test.
Sending the tier
Create a customer
Send tier with addNewUser. The value is standard or premium. tier1 and tier2 are accepted as other names for standard and premium; the reply always uses standard or premium.
curl -X POST "https://staging-api.spendstream.io/v2/addNewUser" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "User-Agent: YourApp/1.0" \
-d "UID=YOUR_CUSTOMER_ID" \
-d "name=Alex Example" \
-d "email=alex@example.com" \
-d "tier=premium"
Once tiers are on for your account, addNewUser requires tier. A request without it is refused.
Change a customer’s tier
Send tier with updateUser. Leave tier out and the customer’s tier stays as it is.
curl -X POST "https://staging-api.spendstream.io/v2/updateUser" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "User-Agent: YourApp/1.0" \
-d "UID=YOUR_CUSTOMER_ID" \
-d "tier=standard"
The reply shows the tier that was saved:
{
"users": {
"message": "User successfully updated",
"response": 200,
"tier": "standard"
}
}
updateUser changes one customer per call. There is no bulk call, so to change many customers, send one request for each.
Customers you already have
Customers registered before tiers were switched on start as standard. If some of them should be premium, send an updateUser for each one.
Errors
As with the rest of the API, a refusal comes back with HTTP 200 and the outcome in the body. Check response, not only the HTTP status.
Message |
| Cause |
|---|---|---|
| 400 |
|
| 400 |
|
Tiers on the Full API
getBrandsandgetPromotionsListaddpremium-gross-commission(card) andpremium-bank-rate(pay by bank) to each gift card promotion, next to the standard rates. Where a brand has no premium rate they are empty or0, and premium customers get the standard rate for that brand.giftCardRequestApi,paymentLinkandgetPayByBankLinkprice each order at the customer’s tier, which is recorded on the order.getTransactionsListaddstier(standardorpremium) to each gift card row. It isnullfor orders placed before the tier was recorded.- These fields are only sent once tiers are switched on for your account.
What your customers see (white-label)
On the storefront, a premium customer sees the premium rate on each brand page and at checkout, for card and for pay by bank. A standard customer sees the standard rate. When you change a customer’s tier, the storefront shows the new rate from the customer’s next page load.
Test it
- Ask Spendstream to switch tiers on for your staging account, with a premium rate on at least one brand.
- Create one standard and one premium customer with
addNewUser. - Sign each in and compare the rate on a brand page and at checkout.
- Change a customer from standard to premium and back with
updateUser, and check the storefront updates. - Send a missing and an invalid
tierand check you get the errors above.
Which guide is for you
- White-label: see the white-label integration guide and the single sign-on guide.
- Full API: see the Full API integration guide and the API reference below.
- Not sure which you are? See Choose your integration model.
API reference
- Register a new end-user against the calling publisher:
POST /addNewUser - Update attributes on an existing user record:
POST /updateUser
On this page
- Customer tiers