S25 — Gift card on spend (a big sale earns the retailer's own gift card, spendable after a hold)
A customer's sale reaches the retailer's threshold. Within the next minute the app gives them the retailer's own gift card, of the value the retailer chose, from the retailer's own gift card item. The card is spendable once the hold has passed (24 hours by default), at the till, like any other gift card. Nothing changes at the till: the cashier rings the sale as before. Staff read each card under the customer or the sale in Desk, Gift cards.
The recipe: A gift card for a big spend, spendable after a hold
In the App library: Gift card on spend
Industries: Fashion and footwear, Pharmacy
Start from it
ivn new acme_gift --from s25
What to change
What a partner usually changes:
- The rules:
service/gcs.py(what a sale earns and when a card is released or voided) andservice/cards.py(the card's life). - The settings: the fields of
PP GCS Settingsinmanifest.json(threshold,card_value,card_item,max_cards_per_sale,hold_hours,walk_in_customers,excluded_customer_groups). - How the customer learns the number: nothing sends it yet; add the message in
service/worker.py. - The app's id:
IVN_LIBRARY_APPinapp.json. - Your own address:
allowed_urlsinmanifest.jsonnameshttps://gcs.partner.example, where the site connects your service after install; write your own. When CitiXsys hosts the app, My apps writes the hosted address for you.
More: the recipe.
The customer sets: the threshold, each card's value, the gift card item (not rechargeable, not paid out as cash, not store credit), the hold in hours, and the customer groups that never earn.
The app's role needs: nothing from the retailer's administrator. The install makes the role PP GCS Integration and the app's own user, and gives the role read on POS Invoice, the record type the feed follows. The manifest's role_rights give the rest: read on Customer and Item, read and create on Gift Card, and read, create and submit on Gift Card Balance. Needs POS build 2.1.0.691 or later: on an earlier site the install warns role_rights as unknown and skips it, and gives the feed's user no read, so the events wait; the service's log says which record type was refused (ivn logs) (What goes where).
Run it
ivn check
ivn try
Try it at the till
- In Desk, open Gift card on spend settings, make the record
Default, tick Enabled (sales earn cards), and set the currency, Spend that earns a card, Value of each card and Gift card item. - Tell the customer at every register: on its POS Profile, Receipt Footer, add a line with the rule, such as Spend 5,000 or more in one sale, on your name: a 250 gift card, usable the next day. The till does not say whether a sale earned a card (the card is made from the sale after it is booked), so the receipt carries the rule.
- Ring a sale over that spend for a named customer, not the walk-in. Within about a minute the card shows under the sale's Gift cards in Desk.
- Close the till day when you are done.
Versions
1.2.5
- The install text and Try it at the till tell the shop to add a line with the rule to each register's receipt footer: on the Kenyan pharmacy walk a customer asked Do I get the gift card? and nothing at the till said. A walk-in still earns none (the shop's own Walk-in customers setting). The service is unchanged. Manifest 0.2.3.
1.2.4
- Try it at the till says what to fill in Gift card on spend settings before the first sale earns a card, and where the card shows; What to change says
allowed_urlsnames the sample's address, for your own. Words only; no service or manifest changes.
1.2.3
- Desk shows plain names (Gift card on spend settings, Earned gift card) through the manifest's
translationsblock, so a search for gift card finds the record. The stored names are unchanged: an installed site keeps its records. Manifest 0.2.2.
1.2.2
- Manifest 0.2.1: the Spendable from field says your site's time, not the shop's. Words only.
1.2.1
- A gift card sold on a sale comes off its spend at what it added to the sale: after a sale discount, with the tax on its line, and with its own share of a tender discount (the same value of the goods as S22's cash back). Before, a taxed card's tax counted towards the threshold and stayed after the goods came back.
1.2.0
- The role's rights beyond the feed's read move into the manifest (
role_rights): the install gives the feed's user its reads, so the retailer's administrator grants none. Needs POS build2.1.0.691or later.
1.1.0
- Hosted on a schedule as a function, paid per call, instead of an always-on container.
- A cut-short answer from a retailer's site is handled as an unknown outcome, like a site that cannot be reached, never a crash.
- Each setting in app.json says its purpose (the line the Settings screen shows), whether it is required, and which settings go with it.
1.0.0
- First version in the kit: a sale over the retailer's threshold earns its own gift card, spendable after a hold.
- Keeps its notes in a writable /scratch folder on CitiXsys hosting.