iVendNextDevelopers My apps

Set iVendNext up with no code — the recipe (reasons, IMEI, line detail, member pricing)

This recipe makes the till ask for and keep a coded reason, track a phone by its IMEI, capture one more detail per line, and price members differently. It uses only what iVendNext already has, switched on by configuration. It is for an iVendNext Partner, the CitiXsys Consulting Team or a retailer's own administrator.

Next: the sample, S5 · The configuration packAll recipes

What the cashier meets once the configuration is applied

Once the configuration is applied, the till gives a member their price, asks for reasons, checks a line detail, asks for a phone's IMEI and asks why a sale is voided.

Reference implementation: samples/s5_config_pack/: config.json is the whole set-up, apply_config.py applies it over the record API, and --remove undoes it.

When to use it. Rung 1 of the build ladder: configure first, always. Nothing here runs partner code in the retailer's iVendNext. The script is a one-time set-up run by the retailer's administrator; after that it is not needed again.

What each part is

You want The retailer's own setting What the sample sets
A coded reason for a void, a return, a discount Reason Code Master rows (a type each: Void Sale, Item Return, Sale Return, Sale Discount, Item Discount, Price Override …) and the Retail Setting switch for that type (reason_void_sale, reason_item_return, reason_sale_return, reason_sale_discount, reason_item_discount; a void reason also needs save_voided_transaction) five reason codes, six switches on
The IMEI of every phone sold, once the item's serial numbers (Item → Has Serial No); the IMEI is the serial number, received with the stock one tracked item, three IMEIs in stock
One more detail on a line, for goods with no serial number Transaction Item Attribute (a name, a pattern, an order) "Warranty card", pattern ^WC-[0-9]{8}$
A member price a Customer Group per tier, and one promotion per tier that applies to the sale and excludes every other customer group group Member Gold, a 10% promotion, a member in the group
A branch's till sees its own store's stock and the head office's, no other branch's (POS build 2.0.0.654 on) the till's POS Profile → Stores this till may see: list the stores. The Other stores panel and a cross-store order's store list then show the listed stores only, and the item card the listed stores and the till's own (a head office that is not a retail store shows in the card only); an order to a store not listed is refused. Empty: every store marked a retail store, as before. It narrows stock and orders, not sales: a return's sale from another store and a held sale are found anywhere (the card branch-sees-own-stock) not set by the sample

Steps

  1. Read config.json, and change the names, codes and numbers to the retailer's. Names start with PP CFG in the sample only so its test can find and remove them; use the retailer's own.

  2. Give the script a key: a user who may edit those records. These roles together are enough: System Manager, Retail Manager, Item Manager, Stock Manager, Sales Master Manager. The key is the retailer's administrator's, used once.

  3. Run it:

    PP_BASE=https://your-shop PP_KEY=<api key> PP_SECRET=<api secret> python3 samples/s5_config_pack/apply_config.py
    
    • Run it twice and nothing doubles. The second run says kept for everything, and receives no stock.
    • Each run recomputes the member promotion's exclusion list, so a customer group added since is excluded the next time you run it.
    • --remove puts the switches back to what they were and deletes what the script made. A record a booked sale points at cannot be deleted, so it is retired (a reason code made inactive, the member disabled, the line detail switched off); a later run switches it back on. An integration user that has taken a workflow step (check by workflow) cannot be deleted: iVendNext keeps a record of each step, visible to the site's Administrator alone. To switch such a user off, disable it, generate new keys that no one keeps, and disable its role (recipes/integration_user.md step 6).
    • ⚠ It does not undo the stock. The item, its price, the unsold serial numbers and the submitted Material Receipt (which posts the units' value to the books) stay. On a real site, use your own IMEIs and quantities, or cancel the receipt if it was a trial.
  4. Make sure iVendNext has a default Company. Any retailer that finished its set-up has one. A sale of a serial-tracked item builds a Serial and Batch Bundle, which takes its company from that default. Without it, the first IMEI sale fails with "Error: Value missing for Serial and Batch Bundle: Company".

  5. The cashier's side: nothing to do. The till offers the reasons it finds, asks for the IMEI of a tracked item, offers the line detail, and applies the member promotion when the member is attached to the sale.

    the member's price

    The gold member's 10%, in the totals.

    a markdown asks for a reason and a comment

    A 10% markdown on the phone asks for a reason; "price match" also asks for a comment.

    the line detail's pattern refuses a wrong value

    The line detail "Warranty card" refuses a value that does not match its pattern.

    the IMEI

    The phone's IMEI, captured before it can be charged.

    a void asks why

    A void asks why, and keeps the voided sale on record.

Two more things a retailer configures

The document's print attached to an approval e-mail

A notification on the document, set up in Desk (or over the record API) by the retailer's administrator: Notification with Channel Email, Send Alert On a value change of workflow_state (or the event the retailer wants), its recipients by role, and Attach Print ticked with the print format chosen. In Print Settings, Allow Print for Draft must be on. With it off, the notification raises an error inside the document's own save, so the approval step can stop; send the first one to a test document. Checked on a sandbox (2026-10-16): a notification on Purchase Order with Attach Print saved as sent, switched off, then deleted. No mail was sent: the sandbox's outgoing e-mail is off.

{"doctype": "Notification", "name": "PO approval mail", "document_type": "Purchase Order", "channel": "Email",
 "event": "Value Change", "value_changed": "workflow_state", "attach_print": 1, "print_format": "<the shop's PO format>",
 "subject": "Purchase order {{ doc.name }} waits for your approval", "recipients": [{"receiver_by_role": "Purchase Manager"}]}

Limits:

A member rate after the promotions: the certified pricing module

A rate the promotions cannot express (a member's percent on top of the day's promotion) is the pricing extension point, answered by a module we have certified (tools/wasm_kit/README.md, the contract contracts/pages/price.md).

  1. The module. A partner builds it from the kit's template (tools/wasm_kit/template/). Built through the kit's meters, the template is byte-identical to the product's own reference module, price member (register 4XSR0YJSBW8X). CitiXsys certifies a module's SHA-256 for the extension point price, version 1, by hand; the certificate comes back with it.

  2. The module record. The retailer's System Manager opens Retail Extension Module in Desk, then fills it in:

    • Extension point price, Partner, Version 1;
    • Module file: attach the .wasm;
    • Counts its own steps (metered) as the certificate says;
    • Certificate: paste it.

    iVendNext works out the fingerprint and size itself, and refuses a file the certificate does not admit, in its words "This module cannot be used: ⟨reason⟩". A saved module cannot be changed: a new build is a new version.

  3. The subscription. Retail Extension Subscription:

    • Extension point price, Answered by wasm (the form offers nothing else);
    • Partner module: the record above, a Label;
    • Settings: the module's rules, for example {"rules": [{"id": "Gold 10%", "item_group": "*", "customer_group": "Gold", "percent_bp": 1000, "cap_minor": null, "min_qty_milli": 0}]};
    • Most a module may take off a line (%): it starts at 0, and at 0 the module is not even run. Raise it to the most iVendNext allows;
    • Only for these POS Profiles if the rate is not for every store; Enabled.

    At most one enabled pricing subscription answers a POS Profile.

  4. Test on one till. A gold member's line shows the promotion and then "Gold 10% −…" beside it, on the phone, the counter and the tablet, online and offline. A refused or missing answer charges the platform's own price.

Limits:

What is refused, and why

Limits to know before you build

Technical notes

Proven on our test bench.

Notes moved from the steps

What the sample was proven to do (our test bench, 22 + 2 checks)

Limits, stated

Tests

Needs this serves

This page in the kit