---
title: "Orders, lines and payments | Docs | POS by R&D Copilot"
description: "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."
canonical: "https://pos.rdcopilot.com/docs/concepts/orders-lines-and-payments/"
language: en
updated: 2026-11-22
---

# 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.

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](https://pos.rdcopilot.com/docs/concepts/money-and-rounding/) gives the arithmetic.

Bon 1042, open

```json
{
  "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

| Field | Meaning |
| --- | --- |
| `id` | Identifier of the order. Use it in every request about the order. |
| `number` | The number of the order, which is also the number of its receipt. |
| `tillId` | The till that rang the order up. See [Tills and cashiers](https://pos.rdcopilot.com/docs/concepts/tills-and-cashiers/). |
| `businessDayId` | The business day the order belongs to. See [Business day](https://pos.rdcopilot.com/docs/concepts/business-day/). |
| `cashier` | The cashier. |
| `customerId` | The customer attached to the order, or `null`. `updateOrder` sets it while the order is open. |
| `createdAt` | When the order was started. |
| `currency` | The 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](https://pos.rdcopilot.com/docs/api-reference/orders/#add-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`).

| Field | Meaning |
| --- | --- |
| `sku` | The code of the item. |
| `quantity` | Units sold, a whole number from 1. |
| `unitPrice` | Shelf price of one unit, VAT included. |
| `discountPercent` | Whole percentage taken off the line, up to the limit of the cashier profile. |
| `discount` | The discount in money: its share of quantity times unit price. |
| `total` | Price 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`:

| Item | sku | quantity | unitPrice | discountPercent | discount | total |
| --- | --- | --- | --- | --- | --- | --- |
| White bread, 500 g | `PA-0101` | `2` | `4.80` | `0` | `0.00` | `9.60` |
| Sunflower oil, 1 l | `UL-0101` | `2` | `9.80` | `0` | `0.00` | `19.60` |
| Cheese, 400 g | `LA-0307` | `1` | `21.50` | `0` | `0.00` | `21.50` |
| Dishwashing liquid, 1 l | `DT-0101` | `1` | `12.50` | `10` | `1.25` | `11.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.

| rate | total | vat | base |
| --- | --- | --- | --- |
| `21` | `11.25` | `1.95` | `9.30` |
| `11` | `50.70` | `5.02` | `45.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](https://pos.rdcopilot.com/docs/guides/split-a-payment/).

| Field | Meaning |
| --- | --- |
| `method` | `card` or `cash`. |
| `status` | `approved` or `declined`. |
| `amount` | The part of the order the payment settles. |
| `given, change` | Cash: what the customer handed over and the change that went back. `null` for a card. |
| `card` | Card: `brand`, `last4`, `entry` (`contactless` or `chip`), `authCode` of an approved payment and `declineReason` of a declined one. `null` for cash. |

A declined card payment

```json
{
  "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](https://pos.rdcopilot.com/docs/guides/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.
