Work without network
What a till does when it loses its network: cash sales finish and wait in a queue, cards, refunds and closing the day wait, and the queue is posted in order when the network returns.
On this page
A till that loses its network keeps selling what it can. Cash sales finish and wait in a queue on the till; cards, refunds and closing the day wait for the network. When it returns, the till posts the queued sales in the order they were made.
Read the network and the queue
network is online, or offline while the till has no network. queue describes the sales stored on the till and not posted yet.
Read the till while it is offline
curl
curl "$RDC_BASE_URL/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"id": "e57a3b65-d690-4e6c-8a6b-8f946c4e6610",
"code": "till-1",
"name": "Till 1",
"cashier": "Cristina Lungu",
"businessDayId": "aaed5ba1-2a19-4c94-ac7f-119c9288a12c",
"currentOrderId": "7bcf7203-923f-428a-acbc-c6faf8821433",
"network": "offline",
"queue": {
"count": 1,
"oldestAt": "2026-11-23T07:14:04Z",
"ageSeconds": 596
},
"reader": {
"state": "idle",
"orderId": null,
"amount": "0.00",
"attempt": 0
}
} | Field of `queue` | Meaning |
|---|---|
count | Sales stored on the till and not posted yet. |
oldestAt | When the oldest stored sale finished, or null. |
ageSeconds | The age of the oldest stored sale, in seconds. |
What works and what waits
Lines, the customer, hold, resume, void, cash payments and cash movements do not need the network. A card does: startCardPayment and retryCardPayment are refused with network_lost, and so are createRefund and closeBusinessDay. A card that waits for the customer when the network is lost is taken back by the till: its reader is cancelled.
Finish a cash sale
Take the cash
curl
curl -X POST "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/cash-payments" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "4596e849-8826-477a-aff8-1ad1840bc5ad",
"expectedRevision": 5,
"given": "62.00"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/cash-payments`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "4596e849-8826-477a-aff8-1ad1840bc5ad",
"expectedRevision": 5,
"given": "62.00"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/cash-payments',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '4596e849-8826-477a-aff8-1ad1840bc5ad',
'expectedRevision': 5,
'given': '62.00',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "4596e849-8826-477a-aff8-1ad1840bc5ad",
"expectedRevision": 5,
"given": "62.00"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/cash-payments');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/cash-payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "4596e849-8826-477a-aff8-1ad1840bc5ad",
"expectedRevision": 5,
"given": "62.00"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "4596e849-8826-477a-aff8-1ad1840bc5ad",
"status": "accepted",
"aggregateId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
"aggregateRevision": 7
} The order is paid and its sync is queued: the customer has paid and the till stores the sale. It is not posted, so stock, the books and reporting do not have it yet, and no order.paid is sent.
{
"number": "Bon 1042",
"status": "paid",
"sync": "queued",
"revision": 7,
"payments": [
{
"method": "cash",
"amount": "61.95",
"given": "62.00",
"change": "0.05"
}
]
} While the queue is not empty, every new sale joins it, even after the network is back, so the books see the sales in the order they were made.
When the network returns
The till posts the queued sales one at a time, first in, first out. The till does the replay itself; the API has no operation for it. Each order becomes posted and order.paid is sent at that moment, with data.paidAt keeping the time of the payment. queue.count falls to zero when the last one is posted.
{
"number": "Bon 1042",
"status": "paid",
"sync": "posted",
"revision": 8,
"payments": [
{
"method": "cash",
"amount": "61.95",
"given": "62.00",
"change": "0.05"
}
]
} Find and refund queued sales
List the orders with sync set to queued to see what waits on a till. A refund needs a posted sale: createRefund on a queued sale is refused with order_not_posted. Read the order and refund it when its sync is posted. The day cannot close while the queue is not empty.
List the queued sales of the till
curl
curl "$RDC_BASE_URL/pos/v1/orders?tillId=e57a3b65-d690-4e6c-8a6b-8f946c4e6610&sync=queued" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders?tillId=e57a3b65-d690-4e6c-8a6b-8f946c4e6610&sync=queued`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders?tillId=e57a3b65-d690-4e6c-8a6b-8f946c4e6610&sync=queued',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders?tillId=e57a3b65-d690-4e6c-8a6b-8f946c4e6610&sync=queued');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/orders?tillId=e57a3b65-d690-4e6c-8a6b-8f946c4e6610&sync=queued");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Events
A queued sale sends order.paid when it is posted, not when the customer paid. See Event catalogue and Close the day.
When a request is refused
| Code | HTTP | What to do |
|---|---|---|
network_lost | 422 | Take cash, or repeat the request when the till reports online. |
order_not_posted | 422 | Read the order and refund it when its sync is posted. |
queue_not_empty | 422 | Wait until the till reports an empty queue, then close the day. |