Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Orders, lines and payments

    The fields of an order, how its lines, discounts and VAT add up, and how payments, refunds, the sync state and the revision sit on it.

    On this page

    One object describes an order from its first line to its refunds. The open sale Bon 1042 is the example of this page. Amounts and quantities are decimal strings, never JSON numbers. Money and rounding gives the arithmetic.

    Bon 1042, open

    {
      "id": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
      "number": "Bon 1042",
      "tillId": "e57a3b65-d690-4e6c-8a6b-8f946c4e6610",
      "businessDayId": "aaed5ba1-2a19-4c94-ac7f-119c9288a12c",
      "cashier": "Cristina Lungu",
      "customerId": null,
      "createdAt": "2026-11-23T07:08:00Z",
      "status": "open",
      "lines": [
        {
          "sku": "PA-0101",
          "name": "White bread, 500 g",
          "quantity": "2",
          "unitPrice": "4.80",
          "discountPercent": 0,
          "discount": "0.00",
          "total": "9.60"
        },
        {
          "sku": "UL-0101",
          "name": "Sunflower oil, 1 l",
          "quantity": "2",
          "unitPrice": "9.80",
          "discountPercent": 0,
          "discount": "0.00",
          "total": "19.60"
        },
        {
          "sku": "LA-0307",
          "name": "Cheese, 400 g",
          "quantity": "1",
          "unitPrice": "21.50",
          "discountPercent": 0,
          "discount": "0.00",
          "total": "21.50"
        },
        {
          "sku": "DT-0101",
          "name": "Dishwashing liquid, 1 l",
          "quantity": "1",
          "unitPrice": "12.50",
          "discountPercent": 10,
          "discount": "1.25",
          "total": "11.25"
        }
      ],
      "subtotal": "63.20",
      "discount": "1.25",
      "total": "61.95",
      "vatBreakdown": [
        {
          "rate": "21",
          "total": "11.25",
          "vat": "1.95",
          "base": "9.30"
        },
        {
          "rate": "11",
          "total": "50.70",
          "vat": "5.02",
          "base": "45.68"
        }
      ],
      "vat": "6.97",
      "currency": "RON",
      "paid": "0.00",
      "due": "61.95",
      "refunded": "0.00",
      "payments": [],
      "refunds": [],
      "sync": null,
      "revision": 5
    }

    Who and what

    FieldMeaning
    idIdentifier of the order. Use it in every request about the order.
    numberThe number of the order, which is also the number of its receipt.
    tillIdThe till that rang the order up. See Tills and cashiers.
    businessDayIdThe business day the order belongs to. See Business day.
    cashierThe cashier.
    customerIdThe customer attached to the order, or null. updateOrder sets it while the order is open.
    createdAtWhen the order was started.
    currencyThe currency of every amount: RON.

    Lines

    A line is an item at its shelf price, VAT included, for a quantity of whole units. Add a line adds units by sku or barcode; units of an item already on the order join its line. The units must be on the shelf: the check runs when you add them and again when payment starts (out_of_stock).

    FieldMeaning
    skuThe code of the item.
    quantityUnits sold, a whole number from 1.
    unitPriceShelf price of one unit, VAT included.
    discountPercentWhole percentage taken off the line, up to the limit of the cashier profile.
    discountThe discount in money: its share of quantity times unit price.
    totalPrice of the line after the discount, VAT included.

    Totals and VAT by rate

    The lines of Bon 1042, with a 10% discount on DT-0101:

    ItemskuquantityunitPricediscountPercentdiscounttotal
    White bread, 500 gPA-010124.8000.009.60
    Sunflower oil, 1 lUL-010129.8000.0019.60
    Cheese, 400 gLA-0307121.5000.0021.50
    Dishwashing liquid, 1 lDT-0101112.50101.2511.25
    • subtotal is the lines at shelf price, before discounts: 63.20.
    • discount is the sum of the discounts of the lines: 1.25.
    • total is what the customer pays, subtotal minus discount: 61.95.

    vatBreakdown has one row for each VAT rate that has sales, highest rate first. total is the price of the lines with that rate, vat is the VAT inside that price and base is the price without VAT. vat of the order is the sum of the vat of the rows: 6.97.

    ratetotalvatbase
    2111.251.959.30
    1150.705.0245.68

    Payments

    payments lists every attempt in the order it was made. An approved payment settles its amount; a declined one settles nothing and stays on the order as a record, with the amount it asked for. paid is the sum of the approved payments and due is total minus paid. A payment smaller than the due leaves the order partially_paid: see Split a payment.

    FieldMeaning
    methodcard or cash.
    statusapproved or declined.
    amountThe part of the order the payment settles.
    given, changeCash: what the customer handed over and the change that went back. null for a card.
    cardCard: brand, last4, entry (contactless or chip), authCode of an approved payment and declineReason of a declined one. null for cash.

    A declined card payment

    {
      "id": "dfbb24fc-cf45-4c34-9062-c2dc2556ffa0",
      "orderId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
      "method": "card",
      "status": "declined",
      "amount": "61.95",
      "given": null,
      "change": null,
      "card": {
        "brand": "mastercard",
        "last4": "9204",
        "entry": "contactless",
        "authCode": null,
        "declineReason": "insufficient_funds"
      },
      "at": "2026-11-23T07:14:12Z"
    }

    Refunds

    A refund is a record on a paid order: the units returned, the amount given back, the method it went back to, a reason (wrong_item, damaged, changed_mind or price_error) and restock. It never edits the payments. A refund of every unit makes the order refunded; a refund of some units leaves it paid. See Refund and void.

    Sync and revision

    • sync is null until the sale is paid, and stays null on a voided order. A paid sale is posted once stock, the books and reporting have it, and queued while the till stores it because it had no network. Only a posted sale can be refunded.
    • revision grows when the order changes: a line, a status, a payment, a refund, the posting of a queued sale. Send the revision you read as expectedRevision. A request that only moves the card reader, such as retryCardPayment, leaves it as it is.