Skip to main content

Integration API

API Reference

More detailed information can be found in the API Reference section

  • A customer session is a finite container of customer activity at the merchant counter and encapsulates any transaction leading to a purchase.
  • A token is a string containing information captured when scanning a code or manually captured by a cashier.

Typically a customer session would be created by your POS software integration, either when a customer arrives at the checkout till, or when they indicate their intention to scan a Transit code. A customer session has a unique ID, generated for you by the Transit Desktop Agent. The customer session is used to negotiate coupon redemption, subsidies and customer profile data leading to a purchase by the customer.

A customer session can be closed, at which point

  • an authorization code is returned to your POS integration
  • the transaction is considered finalised

If a customer decides to abondon their purchase and leave, the customer session can be cancelled and any actions negotiated within the customer session will be rolled back.

The general idea

A typical API interaction

  1. Capture one or more tokens from the client's mobile device by triggering a scan (/v2/token/scan) or by manually entering data and encoding it (/v2/token/encode).
  2. Start a customer session by calling /v2/customer_session, providing a a unique ref code (your identifier for the transaction) and providing the captured tokens.
  3. Use the customer session metadata to determine which items from the customer basket to request subsidies. Update the customer session by calling /v2/customer_session, now providing items, basket and any other relevant metadata, requesting subsidies.
  4. Confirm the subsidies, closing the customer session by calling /v2/customer_session with a CLOSED state and storing the returned authorization_code.

Customer Session States :::