Developers · Stock · Sales in

Connect a POS

Keep ringing orders in the till your staff know. Send GustoQR what it sold, and Stock takes the ingredients off the shelf by the venue’s recipes. One request a day is enough.

Step 1

The till closes the day

Staff ring every order in the till, as they always have. Nothing changes for them.

Step 2

You send what it sold

One request: each item and how many. From the till, its back office or a small script beside it.

Step 3

Items meet the menu

Each till item is matched to a menu item once: by its name where they are the same, by you for the rest.

Step 4

Stock goes down

GustoQR takes each item’s recipe off what is on hand. The owner sees it in the morning.

This page is for whoever connects the till: a POS dealer, an integrator, or the venue’s own IT person. It takes about an hour. The full list of endpoints is in the API reference.

DirectionOne way: the till tells GustoQR what it sold. GustoQR never writes to the till.
The requestPUT https://api.gustoqr.com/v1/menus/{menu}/sales/{day}
How oftenOnce a day, after the till closes the day. More often if you like: every send replaces the day so far.
Safe to repeatYes. The same day sent twice counts once.
Sign each requestAuthorization: Bearer sk-…, the venue owner’s API key
The venue needsGustoQR Max (or its trial), and recipes in Stock
What we never needGuests, staff names, cards, receipts. Send items and quantities only.

On this page

  1. Before you start
  2. Send a day
  3. The rules of a day
  4. What goes in a line
  5. Match the till’s items to the menu
  6. Check that it worked
  7. Ready-made code
  8. When a request fails
  9. Before you go live
  10. Questions

1. Before you start

You need two things from the venue’s owner.

  • An API key. The owner makes it on the API page while signed in, and gives it to you. It starts with sk-. Keep it on the machine that sends, never in a web page. The owner can delete it at any time, and the connection stops.
  • Recipes in Stock. The owner opens Stock in the GustoQR panel once; the recipes are written from the menu and the owner corrects them. Without a recipe an item is counted as sold, and nothing leaves the shelf.

Then find the menu’s number. An account with several venues has one menu each; use the number of the venue whose till you connect.

Find the menu
curl "https://api.gustoqr.com/v1/menus" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY"

2. Send a day

One line per item the till sold that day, with how many. That is the whole integration.

Request
curl -X PUT "https://api.gustoqr.com/v1/menus/355/sales/2026-11-18" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "total": 1840.50,
    "lines": [
      { "code": "1042", "name": "GIN TONIC",     "quantity": 24, "amount": 288 },
      { "code": "1043", "name": "GIN TONIC DBL", "quantity": 5,  "amount": 95 },
      { "code": "2210", "name": "NEGRONI SBAGL", "quantity": 8,  "amount": 104 }
    ]
  }'

The answer says what GustoQR understood, line by line:

Response
{
  "sales": {
    "day": "2026-11-18",
    "source": "pos",
    "received_at": "2026-11-19T02:14:09Z",
    "updated_at": "2026-11-19T02:14:09Z",
    "total": 1840.5,
    "line_count": 3,
    "quantity": 37,
    "matched": 1,
    "unmatched": 2,
    "ignored": 0,
    "without_recipe": 0,
    "lines": [
      {
        "code": "1042",
        "name": "GIN TONIC",
        "status": "matched",
        "item_id": "gin-tonic",
        "item_name": "Gin & Tonic",
        "portions": 1,
        "has_recipe": true,
        "matched_by": "name",
        "quantity": 24,
        "amount": 288
      },
      {
        "code": "1043",
        "name": "GIN TONIC DBL",
        "status": "unmatched",
        "item_id": null,
        "item_name": null,
        "portions": 1,
        "has_recipe": false,
        "matched_by": null,
        "quantity": 5,
        "amount": 95
      },
      {
        "code": "2210",
        "name": "NEGRONI SBAGL",
        "status": "unmatched",
        "item_id": null,
        "item_name": null,
        "portions": 1,
        "has_recipe": false,
        "matched_by": null,
        "quantity": 8,
        "amount": 104
      }
    ]
  }
}
In the answerWhat it tells you
matchedLines Stock counts. Their ingredients are already off the shelf.
unmatchedLines that wait: GustoQR does not know yet which menu item they are. Match them and they count, for this day too.
ignoredLines marked as not stock, such as a service charge.
without_recipeMatched lines whose menu item has no recipe yet. The owner adds it in Stock.
matched_bysender: you named the menu item. name: the names were the same. owner: matched by hand, as in step 5.

In this example GIN TONIC was matched by itself, because the menu has a “Gin & Tonic”. The other two wait.

3. The rules of a day

  • The day is the till’s business day. A drink rung at 01:30 on Saturday night belongs to Friday, if the till closes Friday at 04:00. Use the date the till itself puts on its end-of-day report.
  • Send the whole day, each item once. Totals per item, not one line per receipt. If the same code appears twice, the lines are added up.
  • Sending again replaces. A day sent again takes the place of what was sent before, so nothing counts twice. Retry after a failure, correct a day by sending it again, or send the running totals every 15 minutes during service: it is always this one request.
  • Quantity is what left the bar. Sold and on the house, less voids and refunds. A drink that was rung and voided did not leave the shelf.
  • A closed day is a day. Send "lines": [] when nothing was sold, so a missing day always means a problem.
  • Missed days. If the machine was off for three days, send the three days when it is back, each under its own date, in any order.
  • Two tills. A venue with a bar till and a restaurant till that report separately gives each a source, such as bar and restaurant. Each replaces only its own day.
  • Which days are taken. Any day from 2020 up to the venue’s tomorrow, in its own time zone.
  • GustoQR Orders. From the first day a till sends, the till is where everything sold is counted. Orders sent through GustoQR from that day on no longer take stock, because they are rung in the till too.

4. What goes in a line

FieldTypeWhat it is
codestringThe till’s own number for the item: PLU, item id. Send it whenever the till has one. A match made on a code survives the button being renamed.
namestringThe item as the till names it. Needed when there is no code; welcome always, because it is what the owner reads when matching.
quantity requirednumberHow many, net. Decimals are fine (0.5). A dot or a comma both work when sent as text.
amountnumberWhat the line brought in, net. Kept for the owner’s reports; Stock does not need it.
item_idstringThe GustoQR menu item this is, if you keep that on your side. It is matched at once.

Beside the lines, the request takes source (which till, default pos) and total (the day’s net sales, as the till’s report has them).

Doubles, extras and sets

On the tillSendThen
A double with its own buttonIts own line, with its own codeMatch it to the same menu item with portions: 2
An extra that uses stock (add a shot)Its own line, if the till reports extras as itemsMatch it to the menu item for that extra
A note that uses no stock (no ice)Leave it outIf it comes anyway, mark it ignore: true
A set or a comboIts parts, if the till reports them; else the set as one lineA set sent as one line is matched to a menu item whose recipe holds all of it
An open button (“Cocktail”, “Misc”)Its lineIt cannot be one recipe, so Stock cannot count it. Give each drink its own button.
A service charge, a cover, a depositLeave it outIf it comes anyway, mark it ignore: true

5. Match the till’s items to the menu

GustoQR has to know that the till’s NEGRONI SBAGL is the menu’s “Negroni Sbagliato”. Each till item is matched once and stays matched. There are three ways, and they work together.

  1. You name it. If your system knows the GustoQR menu item, send its item_id on the line. Read the ids once:
The menu’s items
curl "https://api.gustoqr.com/v1/menus/355/items" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY"
  1. The names are the same. When exactly one menu item has the same name, the line is matched by itself. Capitals, accents, spaces and signs do not count: GIN TONIC is “Gin & Tonic”.
  2. By hand. For the rest, ask which items wait and say what each one is. Sit down with the owner for this once: they know that NEGRONI SBAGL is their Negroni Sbagliato.
Which items wait
curl "https://api.gustoqr.com/v1/menus/355/pos-items?status=unmatched" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY"
Say what they are
curl -X PUT "https://api.gustoqr.com/v1/menus/355/pos-items" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "code": "2210", "item_id": "negroni-sbagliato" },
      { "code": "1043", "item_id": "gin-tonic", "portions": 2 },
      { "name": "SERVICE CHARGE", "ignore": true }
    ]
  }'
  • A match reaches back. Stock is worked out again at once, with the days already sent. Matching today repairs yesterday.
  • A match by hand stays. It is never changed by an item_id or a name that comes in later.
  • Ahead of time. You can match a till item before the till ever sends it, and go live with nothing waiting.
  • A menu item that is deleted sets its till items back to waiting.

6. Check that it worked

Read the day back. Every line should read matched or ignored.

The day
curl "https://api.gustoqr.com/v1/menus/355/sales/2026-11-18" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY"

Then read the stock. Twenty-four Gin & Tonics at 50 ml each took 1,200 ml of gin, which is 1.7 bottles of 70 cl:

The stock
curl "https://api.gustoqr.com/v1/menus/355/stock" \
  -H "Authorization: Bearer $GUSTOQR_API_KEY"
Response, shortened
{
  "stock": {
    "sales_from": "pos",
    "pos": {
      "since": "2026-11-18",
      "last_day": "2026-11-18",
      "last_received_at": "2026-11-19T02:14:09Z",
      "unmatched": 0
    },
    "ingredients": [
      {
        "key": "gin",
        "name": "Gin",
        "unit": "bottle",
        "base": "ml",
        "size": 700,
        "on_hand": 9.6,
        "used_7_days": 2.4,
        "days_left": 28,
        "low": false,
        "min": 2,
        "price": 14.5,
        "supplier": "ege-icecek"
      }
    ]
  }
}

on_hand is in the ingredient’s own unit, here bottles. It is null for an ingredient the venue has never added to Stock: the owner adds what is on the shelf once, and it counts down from there.

7. Ready-made code

Each sample sends one day and prints what came back. The first two read the till’s export from a CSV file with the columns code,name,quantity,amount.

Windows PowerShell

For a till’s back-office PC. It runs on the PowerShell that comes with Windows; add it to Task Scheduler for a time after the till has closed the day.

send-sales.ps1
# Sends yesterday's item sales to GustoQR.
# Run it from Task Scheduler once the till has closed the day.
# The till's export, sales-2026-11-18.csv, has the columns:
#   code,name,quantity,amount
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$key  = $env:GUSTOQR_API_KEY
$menu = 355
$day  = (Get-Date).AddDays(-1).ToString('yyyy-MM-dd')
$inv  = [Globalization.CultureInfo]::InvariantCulture

$rows  = Import-Csv "C:\pos\export\sales-$day.csv"
$lines = @($rows | ForEach-Object {
  @{
    code     = $_.code
    name     = $_.name
    quantity = [double]::Parse($_.quantity, $inv)
    amount   = [double]::Parse($_.amount, $inv)
  }
})
$json = @{ lines = $lines } | ConvertTo-Json -Depth 4 -Compress

$request = @{
  Method      = 'Put'
  Uri         = "https://api.gustoqr.com/v1/menus/$menu/sales/$day"
  Headers     = @{ Authorization = "Bearer $key" }
  ContentType = 'application/json; charset=utf-8'
  Body        = [Text.Encoding]::UTF8.GetBytes($json)
}
$sales = (Invoke-RestMethod @request).sales
'{0}: {1} lines, {2} unmatched' -f $sales.day, $sales.line_count, $sales.unmatched

Python

send_sales.py
import csv, datetime, os, requests

KEY, MENU = os.environ["GUSTOQR_API_KEY"], 355
day = (datetime.date.today() - datetime.timedelta(days=1)).isoformat()

with open(f"sales-{day}.csv", newline="", encoding="utf-8") as f:
    lines = [
        {
            "code": r["code"],
            "name": r["name"],
            "quantity": float(r["quantity"]),
            "amount": float(r["amount"]),
        }
        for r in csv.DictReader(f)
    ]

r = requests.put(
    f"https://api.gustoqr.com/v1/menus/{MENU}/sales/{day}",
    json={"lines": lines},
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=30,
)
r.raise_for_status()
sales = r.json()["sales"]
print(sales["day"], sales["line_count"], "lines,", sales["unmatched"], "unmatched")

Node

send-sales.mjs
// Node 18 or newer
const day = '2026-11-18' // the till's business date

const res = await fetch('https://api.gustoqr.com/v1/menus/355/sales/' + day, {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer ' + process.env.GUSTOQR_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    lines: [
      { code: '1042', name: 'GIN TONIC', quantity: 24, amount: 288 },
      { code: '2210', name: 'NEGRONI SBAGL', quantity: 8, amount: 104 },
    ],
  }),
})
const answer = await res.json()
if (!res.ok) throw new Error(answer.error.code + ': ' + answer.error.message)

const { day: sent, line_count, unmatched } = answer.sales
console.log(sent, line_count, 'lines,', unmatched, 'unmatched')

C#

Program.cs
using System.Net.Http.Headers;
using System.Net.Http.Json;

var key = Environment.GetEnvironmentVariable("GUSTOQR_API_KEY");
var http = new HttpClient { BaseAddress = new Uri("https://api.gustoqr.com/v1/") };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", key);

var day = "2026-11-18"; // the till's business date
var body = new
{
    lines = new[]
    {
        new { code = "1042", name = "GIN TONIC", quantity = 24m, amount = 288m },
        new { code = "2210", name = "NEGRONI SBAGL", quantity = 8m, amount = 104m },
    },
};

var res = await http.PutAsJsonAsync($"menus/355/sales/{day}", body);
res.EnsureSuccessStatusCode();
Console.WriteLine(await res.Content.ReadAsStringAsync());

8. When a request fails

A failed request answers with its HTTP status and one shape. Nothing of a refused request is kept: a day is taken whole or not at all.

JSON
{
  "error": {
    "code": "invalid_line",
    "message": "lines[3]: quantity must be a number.",
    "docs": "https://www.gustoqr.com/docs/api"
  }
}
StatusCodeWhat to do
401unauthorizedThe key is missing, wrong or deleted. Ask the owner for a new one.
403needs_maxThe venue’s plan has no Stock. The owner switches to Max.
404not_foundThe menu number is wrong, or the menu is not this owner’s.
413too_many_linesMore than 5,000 different items in a day. Send totals per item, not one line per receipt.
422invalid_dayThe date in the address is not a day we take.
422invalid_lineOne line is wrong; the message names it, counting from 0. Fix it and send the day again.
422no_lines, invalid_sourcelines is missing, or source is not lowercase letters, digits, - or _.
422unknown_itemWhen matching: no menu item has that id.
429rate_limitedWait the seconds in Retry-After, then send again. The limit is 300 changes a minute per key.
5xxOur side. Send the same request again after a minute, then after five, then every fifteen.

A network error or a timeout is treated like a 5xx: send the same request again. Because a day replaces itself, you never have to work out whether the first try arrived.

9. Before you go live

  • The key is the venue owner’s, and the menu number is that venue’s.
  • The date you send is the till’s business date, and the job runs after the till has closed the day.
  • Voided and refunded items are taken off the quantities.
  • You send a code for each item, if the till has one.
  • One real day was sent, and reading it back shows no line unmatched.
  • The stock went down by what you expected for one item you checked by hand.
  • A failed send is tried again, and a day that was missed is sent later under its own date.
  • Someone gets told when the job has failed for a whole day.

To see which days arrived, list them: a gap is a day that never came in. List the days that came in

10. Questions

Does the stock have to be live?

No. Ordering from suppliers, cost and what went missing are worked out per day or per count, so once a day is enough. If the owner wants a warning during service that something is running out, send the day so far every few minutes; each send replaces the last.

Our till can only write a file or print a report. Is that enough?

Yes. Anything that holds item, quantity and day will do: a CSV export, a database table, an end-of-day file. A small script reads it and sends it, as in the PowerShell sample.

Does GustoQR change anything in the till?

No. It reads nothing from the till and writes nothing to it. It only takes what you send.

Do we send prices?

Only if you like. amount and total are kept for the owner’s reports. Stock works on quantities alone.

How do we test without touching a real venue’s stock?

Ask the owner to make a second menu as a draft, with a few items and recipes, and send to its number. When you are done, take the test days back: Take a day back

One dealer, many venues?

Each venue’s owner gives you their own key. The code is the same; only the key and the menu number change.

Can the till ask what is in stock?

Yes: Get the stock. A read-only key is enough for that.

Reference

Send a day’s salesPUT /menus/:id/sales/:day
List the days that came inGET /menus/:id/sales
Get one dayGET /menus/:id/sales/:day
Take a day backDELETE /menus/:id/sales/:day
List the till’s itemsGET /menus/:id/pos-items
Match the till’s itemsPUT /menus/:id/pos-items
List a menu’s itemsGET /menus/:id/items
Get the stockGET /menus/:id/stock

The same list as a machine-readable file: https://api.gustoqr.com/v1/openapi.json

Help

Stuck, or connecting a till we should know about? Write to support@luvi.io with the venue’s name and the answer you got.