The Lynked Public API is in development. Endpoints will appear here as they go live.

Barcodes

At a till a customer identifies themselves with a barcode, and the rewards they want to use travel with it. The API gives the same barcodes, so a customer can use rewards in an app or a site built on the API exactly as with the Lynked app.

A barcode for using rewards#

POST /customers/{id}/barcodes with the rewards to use — each one a type and the id from the customer's rewards:

json
{
  "rewards": [
    { "type": "voucher", "id": 812 },
    { "type": "stamp_voucher", "id": 455 }
  ]
}

The answer is a code such as lynked_aB3dE9xYz. Show it as a Code 128 barcode at a till, or pass it as the barcode of POST /orders: the order's discounts use the rewards it carries. There is no separate "redeem" call — a reward is used by an order.

With an empty rewards the code is the customer's plain barcode: it identifies the customer and carries no reward.

A reward that is not the customer's at this business is refused (422 reward_not_found). Whether a reward is still valid — not used, not expired — is checked when the order is priced; a reward that is no longer valid simply gives no discount.

Staff barcodes#

GET /staff lists the staff of the business and GET /staff/{id} gives one of them; staff.added and staff.removed keep a copy up to date.

A staff member identifies themselves with a staff barcode and gets the staff discount. GET /staff/{id}/barcodes lists them, the main one first; a staff member may have more than one, each with its own discount. Use any of them like a customer barcode: at a till or as the barcode of POST /orders.

GET /staff/find finds a staff member by email or by any of their barcodes, a staff cash barcode included.

Staff cash#

When the business allows staff cash, a staff member can pay with their cash_balance. POST /staff/{id}/cash-barcodes with the cash to spend gives a one-off barcode; the staff discount of the chosen barcode (the main one by default) comes with it. The cash is taken off the balance when the order with that barcode is completed.