BBoon Break Back to vending

DIRECT EMPLOYEE-CARD PAYMENT

One card choice.
One API charge.

Vending FE sends printed card data and product details directly to Boon Backend. The backend authenticates the request, maps the employee, validates balance, and deducts the requested points.

01Vending FrontendSelect product · choose card · show result
02Employee CardPrinted card_id only · no wallet data
03Boon BackendAuthenticate · map user · deduct · ledger

SEQUENCE DIAGRAM

Charge flow running in this demo

Boon direct employee-card charge sequence Vending FE receives a printed employee card ID and sends one authenticated direct charge request to Boon Backend. Vending FE Employee Card Boon BE select product printed card_id POST /charge + API token authenticate + map card check balance + deduct payment_id + new_balance show success

No redirect, polling, webhook, or pre-charge account lookup.

  1. 01
    Select a drink

    Vending FE keeps the selected product ID, name, and Boon price for the demo request.

  2. 02
    Choose an employee card

    The simulator provides a printed card_id. It does not expose user ID, balance, or payment credentials.

  3. 03
    Send the direct charge

    POST /api/integration/charge includes X-Api-Token and a plain JSON body.

  4. 04
    Deduct points

    Boon Backend maps the card, validates balance, records the payment ledger entry, and returns the payment ID and new balance.

ACTUAL API CONTRACT

Plain JSON, protected by an API token

The browser credential is visible because this is a functional demo. A production vending machine must keep its API credential outside public frontend code.

X-Api-Token+JSON body { "card_id": "0006523856", "boon": 25, "additional_data": { "product_id": "orange-pop", "machine_id": "VM-01" } }
Demo authentication

X-Api-Token: demo-api-token must match BOON_API_TOKEN.

Independent requests

Every accepted charge request creates a payment, so clients must avoid accidental retries.

API-only refund

POST /api/integration/refund uses payment_id and the same auth header. Try it in Swagger.

Legacy services stay outside this path

Payment Backend still serves Vending FE and keeps the older QR demo available. The direct employee-card purchase calls Boon Backend through the gateway.