iVendNextDevelopers My apps

S31 — Parent item groups in coupons and promotions (pp_pgx)

Start an app from this sample

A retailer sets up a coupon for Supplements and expects it to cover every supplement, but the till's coupon and promotion engines match an item's own item group exactly. This sample's service, outside the retailer's iVendNext, writes the parent out as its child groups and keeps it that way: when the coupon or promotion is saved, and when a new group is added under the parent. The rows appear a few seconds after the save, not in the same save. A promotion's buy and get rows are reported, never written out.

The recipe: A coupon or promotion for a parent item group

What is in it: a service that writes a parent item group in a coupon or a promotion out as its child groups.

Industries: Beauty and cosmetics

Start from it

ivn new acme_groups --from s31

What to change

What a partner usually changes:

More: the recipe.

The app's role needs: nothing from the retailer's administrator. The install makes the role PP PGX Integration and the app's own user, and gives the role read on Item Group, Coupon and Promotion Bonus Buys Master, the three record types the feed follows. The manifest's role_rights add write on Coupon and on Promotion Bonus Buys Master. 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

Then run it from your own computer or scheduler (Try does not run it), from service/pgx/ in the app you made, with the key of a user of your own that holds your app's role ending Integration (your prefix, then Integration) (Generate Keys on that user): PGX_KEY=… PGX_SECRET=… python3 expander.py run --base https://shop.example --state state/pgx.sqlite --watch 15. Once, for what exists: PGX_KEY=… PGX_SECRET=… python3 expander.py reconcile --base https://shop.example --state state/pgx.sqlite.

Try it at the till

Versions

0.2.2

0.2.1

0.2.0

0.1.0

Needs this serves

This page in the kit