Logo
Getting started
    • Overview
    • Authentication
    • Testing
    • Error handling
    • Webhooks
    • Loyalty Tokens
    • Register API
Tutorials
API Reference
TUTORIAL

Point of Sales

Introduction

This is a guide on how to build an integration for POS software. The flows describe the typical flow, but much depends on possibilities and limitations offered by both hardware and software involved.

In this tutorial, we assume you'll build the UI yourself, leveraging our API endpoints to feed the flows with the necessary data. However, there is also the option to use Portal Sessions to power your POS integration. This involves using either the Portal Sessions API or the Portal Sessions SDK. This option is sometimes used for a quick launch strategy or prototyping, while a more polished API-based approach is built in the mean time.

In this tutorial

1

Identifying Customers

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50

On the POS, a button will need to be added to trigger the identification of the customer and subsequent loyalty flows. Where this button is placed and how it looks is up to you, it's usually accompanied by a label stating 'Loyalty' or 'Rewards' or similar.

When the button is clicked, the POS will open a modal or a separate screen where the customer can be identified. This could be done by scanning a QR code, entering a loyalty card number or entering an email address. Scanning a QR-code is often quickest and most convenient.

Try it: Click the green Rewards button on the POS screen to start the identification flow.

Scanning the Customer's Card

After clicking the rewards button, the customer needs to identify themselves. There are three common methods for this, depending on your hardware capabilities:

Camera scanner
Barcode/QR scanner
Keyboard
Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Scan identifier
  • Camera Scanner: Uses the device camera to scan QR codes - ideal for tablets and modern POS systems
  • Barcode/QR Scanner: Uses dedicated hardware scanners - fastest and most reliable for high-volume environments
  • Keyboard Entry: Manual entry of card number or email - works on any system as a fallback

Try it: Hover over the scan area and click to simulate a successful scan.

Tip: You can also use Find or Create Contact to identify customers by email address - useful when they've forgotten their loyalty card, though slower.

2

Customer Overview

Once the customer is identified, you'll display their loyalty information. This typically includes their tier status, point balance, available offers (combination of Vouchers and Collectable Rewards), and redeemable rewards. Hover over each section to see which API endpoints provide this data.

Displaying Rewards: Rewards are typically displayed as a list ordered ascending by required_credits, showing the reward title, required points, and sometimes image.

  • Show a "Redeem" button for each reward
  • Disable the button if the customer has insufficient points
  • Optionally show a progress bar indicating how many more points they need

Displaying Offers: Rewards are typically fewer, therefore displayed as a grid or horizontal list, showing title, expiration date (if present), and sometimes image.

3

Redeeming Rewards

When a customer selects a reward from their available options, you'll show a confirmation screen. This allows them to confirm they want to spend their points on this reward before it's applied to their order.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Redeem Reward
Krabby Patty
Our secret recipe
Redeem this reward for 400 Shells?

Note: Applying discount logic to the cart is often the most complex part of the integration. See the Custom Attributes section for how to configure discount logic.

There are two common approaches for handling reward redemption. Neither is inherently better — the right choice depends on your POS system's capabilities.

Option 1: Redeem → Reverse on Failure
  1. Create Reward Reception — subtracts points immediately
  2. Process payment
  3. On success: done!
  4. On failure: Reverse Reward Reception

Best when your POS can easily handle failed orders but lacks post-success hooks.

Option 2: Pre-Redeem → Collect on Success
  1. Create Reward Reception with reward.pre_redeemable: true — creates a Collectable Reward
  2. Process payment
  3. On success: Collect Reward
  4. On failure: reward remains collectable for later

Best when your POS can easily trigger an API call after a successful order. Allows customers to save rewards for later visits.

4

Redeeming Offers

Similarly, when a customer wants to use a voucher or collectable reward (like a birthday offer), they'll see a confirmation screen. These offers could have conditions like minimum spend requirements and expiration dates.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Redeem Offer
€5 Discount
Minimum spend: €15
Redeem this offer now?

Note: Applying discount logic to the cart is often the most complex part of the integration. See the Custom Attributes section for how to configure discount logic.

There are two common approaches for handling voucher redemption. Neither is inherently better — the right choice depends on your POS system's capabilities.

Option 1: Lock → Redeem on Success
  1. Check Voucher Validity , then Lock Voucher — reserves the voucher
  2. Process payment
  3. On success: Redeem Voucher
  4. On failure: Release Voucher (or let it expire)

Best when your POS can easily trigger an API call after a successful order.

Option 2: Redeem → Reverse on Failure
  1. Redeem Voucher — immediately redeems
  2. Process payment
  3. On success: done!
  4. On failure: Reverse Voucher Redemption

Best when your POS can easily handle failed orders but lacks post-success hooks.

5

Checkout with Rewards Applied

After rewards and offers are confirmed, they're applied to the order. The checkout screen shows the discounts applied (highlighted in green) and the updated total. This is where you'll process the final payment and record the transaction.

Krabby Patty
2
€ 18.00
Krabby Patty
- € 9.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
6

Order Complete

After payment, show the customer how many points they earned from this transaction. This reinforces the value of the loyalty program and encourages future visits.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Order successfully paid
Shells earned
+ 49

Clients often want to display the points earned and new balance on the receipt. The response from the Create and Process Order endpoint includes this information.

Applying discounts to the cart/order is often the most complex part of the integration. To enable your POS to handle this correctly, you'll need to create custom attributes that define the discount logic.

Important: Custom attributes must be created on the correct entity:

  • For Rewards: Create custom attributes on the Rewards entity
  • For Vouchers: Create custom attributes on the Promotions entity (the parent of Vouchers)

Naming Convention: We highly recommend adding an integration-based prefix (or suffix) to each custom attribute's internal name to ensure uniqueness. For example: mypos_discount_type instead of just discount_type. This prevents errors due to duplicate attribute names, as other integrating parties might try to create attributes with the same names.

There are two common approaches for configuring discount logic:

Option 1: Reference ID

discount_rule_id - Reference to an existing discount/price rule in your POS system, often as a single select attribute

Option 2: Direct Configuration

Build the discount logic with a set of attributes fully (or partially) in Leat

Common custom attributes for Option 2:

  • discount_type - Dropdown: percentage_discount, absolute_discount, or free_item
  • discount_value - Number field (e.g., 100 for 100% off = free item, or 5 for £5 off)
  • product_code - SKU of the specific product (used in ~80% of rewards). Can be comma-separated for multiple options
  • category - If the reward applies to any product in a category rather than a specific SKU

These attribute values are returned in the API responses when listing and claiming rewards, or redeeming vouchers, allowing your POS to apply the correct discount.

If the customer hasn't identified themselves during the order flow, you can still offer them the opportunity to collect loyalty points after payment. This is useful for customers who forgot to scan their card or decided to join the loyalty program at checkout.

After a successful payment, prompt the customer: "Would you like to collect loyalty points on this order?"

  • If they choose Yes, show the scan identifier screen and link the transaction to their account
  • If they choose No, optionally print a QR code on the receipt that allows them to claim points later

Tip: You can generate a Loyalty Token URL without an API call to print on receipts. See our documentation for more details on implementing this feature.

When an order is cancelled or (partially) returned, you'll need to correct the loyalty data. This involves two separate concerns: correcting issued points, and reversing any redeemed rewards, vouchers, or payment transactions.

1. Correcting Issued Points

To correct points that were issued for a cancelled or returned order, use the Create and Process Order Return endpoint. This will subtract the points that were originally awarded for the returned items.

For partial returns, only include the returned line items — the system will calculate the correct point deduction.

2. Reversing Redeemed Rewards & Vouchers

If rewards or vouchers were redeemed as part of the order, these need to be reversed separately. Each type has its own reversal endpoint:

3. Reversing Payment Transactions

If the order was (partially) paid with giftcard balance or prepaid credit, those transactions also need to be reversed:

💡 Tip: Store the transaction UUIDs (reward reception UUID, voucher redemption UUID, giftcard transaction UUID, prepaid transaction UUID) alongside your order data. This makes it easy to reverse the correct transactions when processing returns.

Scan Voucher Directly

Instead of identifying the customer first and then retrieving their vouchers, customers can also scan a voucher QR code directly. This is useful when customers receive vouchers via email or printed flyers.

1

Trigger Voucher Scan

Similar to the main loyalty flow, a button triggers the voucher scanning flow. This could be a separate "VOUCHER" button next to the "REWARDS" button, or integrated into the same flow.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50

This flow is typically used when a customer presents a voucher code (from an email, flyer, or printed coupon) without first identifying themselves via their loyalty card.

Try it: Click the green Voucher button on the POS screen to start the voucher scanning flow.

2

Scan Voucher QR Code

The customer presents a voucher QR code (from an email, flyer, or printed coupon). Use the Find Voucher endpoint to retrieve the voucher details using the scanned code.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Scan voucher

Try it: Hover over the scan area and click to simulate scanning a voucher QR code.

3

Link Customer (If Not Linked)

If the voucher is not yet linked to a contact, prompt the customer to scan their loyalty card to link the voucher to their account. This use case is relatively rare, as most vouchers are linked to a contact upon creation.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Scan identifier
Unlinked voucher found:
Free Krabby Patty
Scan your identifier to claim this voucher

If the voucher is already linked to a contact, this step can be skipped.

This process can also be used to link the contact to the order itself, so the customer can earn points.

Note: When redeeming an unlinked voucher, you'll need to pass the contact_uuid parameter to the Redeem Voucher API call to link the transaction to the customer.

4

Confirm & Redeem Voucher

Show the voucher details and ask the customer to confirm redemption. The Promotion linked to the Voucher should contain custom attributes (like discount_rule_id) that enable the POS to apply the discount.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Redeem offer
Free Krabby Patty
Choice of original, double, or triple patty
Redeem this offer now?

Use Lock Voucher to reserve it, then Redeem Voucher after successful payment.

Note: Applying discount logic to the cart is often the most complex part of the integration. See the Custom Attributes section for how to configure discount logic.

Buying Giftcards

This flow covers selling physical giftcards at the POS. These are pre-printed cards (already registered in the system with a €0 balance) that the cashier grabs from behind the counter when a customer wants to purchase one. Digital giftcards can also be purchased, though this use case is less common for POS systems.

1

Trigger Giftcard Sale

When a customer wants to buy a giftcard, the cashier clicks the "GIFTCARD" button to start the flow. The cashier then grabs a physical giftcard from behind the counter.

Total
€ 0.00

Try it: Click the Giftcard button on the POS screen to start the giftcard sale flow.

2

Scan Giftcard

The cashier scans the QR code on the physical giftcard. The system calls the Find Giftcard endpoint to retrieve the giftcard details and verify it has a €0 balance (i.e., it hasn't been sold yet).

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Scan giftcard
3

Choose Amount

The customer chooses how much credit to load onto the giftcard. Common options are preset amounts (€10, €25, €50, etc.) but a custom amount can also be entered.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Choose giftcard amount
Giftcard
HT123ABC
Balance
€ 0.00
Select amount to load
€ 10
€ 25
€ 50
€ 75
€ 100
Custom
4

Giftcard Added to Cart

The giftcard appears as a line item in the cart for the chosen amount. The customer pays for the giftcard like any other product.

Giftcard
1
€ 50.00
Total
€ 50.00
Pay € 50.00

After successful payment, the system calls Create Giftcard Transaction with a positive amount to load the credit onto the giftcard.

For digital giftcards (not physical cards), the flow is slightly different:

  1. Create Giftcard — creates a new giftcard in the system
  2. Create Giftcard Transaction — loads the purchased amount
  3. (Optional) Send Giftcard by Email — sends the giftcard code to the recipient

Paying with Giftcards

Customers can use their giftcard balance to pay for (part of) their order. This flow is triggered at the payment step.

1

Select Giftcard Payment

At the payment step, the customer indicates they want to pay with a giftcard. The cashier selects the "GIFTCARD" payment method.

Order #OR-00212
Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total to pay
€ 30.50
Select payment method

Try it: Click the Giftcard payment button to start the giftcard payment flow.

2

Scan Giftcard

The customer scans or enters their giftcard code (e.g., 'HT123ABC'). The system calls Find Giftcard to retrieve the current balance.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Scan giftcard

Try it: Hover over the scan area and click to simulate scanning a giftcard.

3

Confirm Payment

The system shows the giftcard balance and calculates how much will be deducted. The customer confirms they want to use their giftcard funds.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Pay with giftcard
Giftcard
HT123ABC
Balance
€ 75.00
Order total€ 30.50
Giftcard payment- € 30.50
Order amount remaining€ 0.00
New giftcard balance€ 44.50
Confirm Payment

Upon confirmation, the system calls Create Giftcard Transaction with a negative amount to deduct from the balance.

Note: If the giftcard balance doesn't cover the full order, the remaining amount can be paid with another payment method (card, cash, etc.).

If the order is cancelled or fails after the giftcard transaction has been created, use the Reverse Giftcard Transaction endpoint to restore the giftcard's balance.

Buying Prepaid Credit

Prepaid credit is tied to a customer's account, not a physical card. Customers can top up their prepaid balance at the POS and use it for future purchases.

1

Trigger Prepaid Top-up

When a customer wants to add credit to their prepaid balance, the cashier clicks the "PREPAID" button to start the flow.

Total
€ 0.00

Try it: Click the Prepaid button on the POS screen to start the prepaid top-up flow.

2

Identify Customer

Since prepaid credit is tied to a customer account (not a physical card), the customer must first be identified by scanning their loyalty card or entering their details.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Identify customer for top-up

The system calls Find Contact Identifier to retrieve the customer and their current prepaid balance.

3

Choose Amount

The customer chooses how much credit to add to their prepaid balance. The screen shows their current balance and preset amount options.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Top up prepaid credit
SpongeBob
Golden Spatula
Balance
€ 12.50
Select amount to add
€ 10
€ 25
€ 50
€ 75
€ 100
Custom
4

Top-up Added to Cart

The prepaid top-up appears as a line item in the cart. The customer pays for it like any other product.

Prepaid
1
€ 50.00
Total
€ 50.00
Pay € 50.00

After successful payment, the system calls Create Prepaid Transaction with a positive amount to add credit to the customer's prepaid balance.

Paying with Prepaid Credit

Customers who have prepaid credit on their account can use it to pay for (part of) their order. Since prepaid is tied to their account, the customer must already be identified.

1

Select Prepaid Payment

At the payment step, if the customer has been identified and has prepaid credit, the "PREPAID" payment option becomes available. The cashier selects it to use the customer's balance.

Order #OR-00212
Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total to pay
€ 30.50
Select payment method

Try it: Click the Prepaid payment button to start the prepaid payment flow.

2

Scan Identifier

If the customer hasn't identified themselves yet at this point, they must do so before proceeding with the prepaid payment.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
3

Confirm Payment

The system shows the customer's prepaid balance and calculates how much will be deducted. The customer confirms they want to use their prepaid credit.

Krabby Patty
2
€ 18.00
Kelp Fries
1
€ 7.50
Seafoam Soda
2
€ 5.00
Total
€ 30.50
Pay with prepaid credit
SpongeBob
Golden Spatula
Balance
€ 75.00
Order total€ 30.50
Prepaid payment- € 30.50
Order amount remaining€ 0.00
New prepaid balance€ 44.50
Confirm Payment

Upon confirmation, the system calls Create Prepaid Transaction with a negative amount to deduct from the balance.

Note: If the prepaid balance doesn't cover the full order, the remaining amount can be paid with another payment method (card, cash, etc.).

If the order is cancelled or fails after the prepaid transaction has been created, use the Reverse Prepaid Transaction endpoint to restore the customer's balance.