---
title: "Quickstart | Docs | POS by R&D Copilot"
description: "Ring up one sale on the test company: read the till, add a line, pay by card, try again after a decline and read the paid order."
canonical: "https://pos.rdcopilot.com/docs/get-started/quickstart/"
language: en
updated: 2026-11-22
---

# Quickstart

Ring up one sale on the test company: read the till, add a line, pay by card, try again after a decline and read the paid order.

You ring up Bon 1042 at Till 1 of the test company. The card is declined once and approved at the second try, and the order ends `paid`. You need the client credentials and the base address of your test company. The samples read them from the environment: `$RDC_BASE_URL` and `$RDC_TOKEN`. See [Authentication](https://pos.rdcopilot.com/docs/get-started/authentication/) for the token and [Sandbox and live](https://pos.rdcopilot.com/docs/get-started/sandbox-and-live/) for the test company.

## Read the till

A sale is rung up at a till. `currentOrderId` is the order being rung up, `reader` is the state of the card reader and `network` says whether the till is online.

curl

```bash
curl "$RDC_BASE_URL/pos/v1/tills/e57a3b65-d690-4e6c-8a6b-8f946c4e6610" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```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

```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
<?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#

```csharp
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();
```

Response 200

```json
{
  "id": "e57a3b65-d690-4e6c-8a6b-8f946c4e6610",
  "code": "till-1",
  "name": "Till 1",
  "cashier": "Cristina Lungu",
  "businessDayId": "aaed5ba1-2a19-4c94-ac7f-119c9288a12c",
  "currentOrderId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
  "network": "online",
  "queue": {
    "count": 0,
    "oldestAt": null,
    "ageSeconds": 0
  },
  "reader": {
    "state": "idle",
    "orderId": null,
    "amount": "0.00",
    "attempt": 0
  }
}
```

## Read the current order

The order is `open`, it is at `revision` 5 and `due` is 61.95. Keep the revision: it is the `expectedRevision` of the next change.

curl

```bash
curl "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```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
}
```

## Add a line

Choose a new `operationId` and add one paper bag (`SA-0101`). Send revision 5 as `expectedRevision`. The 202 says the change was accepted. The order is now at revision 6 and `due` is 62.85.

curl

```bash
curl -X POST "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/lines" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "fa72d355-ece7-4ef3-877a-21e26eef40b1",
  "expectedRevision": 5,
  "sku": "SA-0101",
  "quantity": "1"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/lines`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "fa72d355-ece7-4ef3-877a-21e26eef40b1",
    "expectedRevision": 5,
    "sku": "SA-0101",
    "quantity": "1"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/lines',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'fa72d355-ece7-4ef3-877a-21e26eef40b1',
        'expectedRevision': 5,
        'sku': 'SA-0101',
        'quantity': '1',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "fa72d355-ece7-4ef3-877a-21e26eef40b1",
  "expectedRevision": 5,
  "sku": "SA-0101",
  "quantity": "1"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/lines');
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#

```csharp
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/lines");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "fa72d355-ece7-4ef3-877a-21e26eef40b1",
  "expectedRevision": 5,
  "sku": "SA-0101",
  "quantity": "1"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "fa72d355-ece7-4ef3-877a-21e26eef40b1",
  "status": "accepted",
  "aggregateId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
  "aggregateRevision": 6
}
```

## Start the card payment

Send the amount due to the card reader of the till. `amount` is optional and defaults to what is still due; here it is written out. Send revision 6.

Start a card payment

curl

```bash
curl -X POST "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
  "expectedRevision": 6,
  "amount": "62.85"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
    "expectedRevision": 6,
    "amount": "62.85"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'd321f176-6d98-4a4d-8c07-4ce5210601f5',
        'expectedRevision': 6,
        'amount': '62.85',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
  "expectedRevision": 6,
  "amount": "62.85"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-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#

```csharp
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/card-payments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
  "expectedRevision": 6,
  "amount": "62.85"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
  "status": "accepted",
  "aggregateId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
  "aggregateRevision": 7
}
```

The 202 says that the reader has the amount. It does not say that the customer paid. The card is presented on the reader of the till, and the reader reports its result on the order and in events.

## Read the decline

The customer presents a card and the reader declines it. Read the order: the declined card is a payment with `status` `declined`, and `card.declineReason` says why. The order stays `awaiting_payment` and `due` does not change. The decline added one to the revision, which is now 8. `getTill` shows the same on `reader.state`, and the event `payment.declined` carries it: see [Event catalogue](https://pos.rdcopilot.com/docs/events/event-catalogue/).

Get an order after the decline

curl

```bash
curl "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```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": "awaiting_payment",
  "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"
    },
    {
      "sku": "SA-0101",
      "name": "Paper bag",
      "quantity": "1",
      "unitPrice": "0.90",
      "discountPercent": 0,
      "discount": "0.00",
      "total": "0.90"
    }
  ],
  "subtotal": "64.10",
  "discount": "1.25",
  "total": "62.85",
  "vatBreakdown": [
    {
      "rate": "21",
      "total": "12.15",
      "vat": "2.11",
      "base": "10.04"
    },
    {
      "rate": "11",
      "total": "50.70",
      "vat": "5.02",
      "base": "45.68"
    }
  ],
  "vat": "7.13",
  "currency": "RON",
  "paid": "0.00",
  "due": "62.85",
  "refunded": "0.00",
  "payments": [
    {
      "id": "dfbb24fc-cf45-4c34-9062-c2dc2556ffa0",
      "orderId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
      "method": "card",
      "status": "declined",
      "amount": "62.85",
      "given": null,
      "change": null,
      "card": {
        "brand": "mastercard",
        "last4": "9204",
        "entry": "contactless",
        "authCode": null,
        "declineReason": "insufficient_funds"
      },
      "at": "2026-11-23T07:14:16Z"
    }
  ],
  "refunds": [],
  "sync": null,
  "revision": 8
}
```

## Try the card again

Make the reader wait for another card, for the same amount. Send revision 8. The retry does not change the order, so `aggregateRevision` stays 8. Other ways out of a decline are [taking cash instead](https://pos.rdcopilot.com/docs/guides/split-a-payment/) and [cancelling the card payment](https://pos.rdcopilot.com/docs/api-reference/payments/#cancel-card-payment).

Try the card again

curl

```bash
curl -X POST "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments/retry" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "691e7778-6b81-4305-89d7-a9146efd7ee1",
  "expectedRevision": 8
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments/retry`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "691e7778-6b81-4305-89d7-a9146efd7ee1",
    "expectedRevision": 8
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments/retry',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '691e7778-6b81-4305-89d7-a9146efd7ee1',
        'expectedRevision': 8,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "691e7778-6b81-4305-89d7-a9146efd7ee1",
  "expectedRevision": 8
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62/card-payments/retry');
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#

```csharp
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/card-payments/retry");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "691e7778-6b81-4305-89d7-a9146efd7ee1",
  "expectedRevision": 8
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "691e7778-6b81-4305-89d7-a9146efd7ee1",
  "status": "accepted",
  "aggregateId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
  "aggregateRevision": 8
}
```

## Read the paid order

The customer presents a second card and the reader approves it. The order is `paid`, `due` is 0.00 and `sync` is `posted`. `payments` keeps both attempts, and `revision` is 9. Read the order, or let the event `order.paid` tell you.

Get the paid order

curl

```bash
curl "$RDC_BASE_URL/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/orders/9d8c072d-afa0-4272-97ab-4443d54d5b62");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```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": "paid",
  "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"
    },
    {
      "sku": "SA-0101",
      "name": "Paper bag",
      "quantity": "1",
      "unitPrice": "0.90",
      "discountPercent": 0,
      "discount": "0.00",
      "total": "0.90"
    }
  ],
  "subtotal": "64.10",
  "discount": "1.25",
  "total": "62.85",
  "vatBreakdown": [
    {
      "rate": "21",
      "total": "12.15",
      "vat": "2.11",
      "base": "10.04"
    },
    {
      "rate": "11",
      "total": "50.70",
      "vat": "5.02",
      "base": "45.68"
    }
  ],
  "vat": "7.13",
  "currency": "RON",
  "paid": "62.85",
  "due": "0.00",
  "refunded": "0.00",
  "payments": [
    {
      "id": "dfbb24fc-cf45-4c34-9062-c2dc2556ffa0",
      "orderId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
      "method": "card",
      "status": "declined",
      "amount": "62.85",
      "given": null,
      "change": null,
      "card": {
        "brand": "mastercard",
        "last4": "9204",
        "entry": "contactless",
        "authCode": null,
        "declineReason": "insufficient_funds"
      },
      "at": "2026-11-23T07:14:16Z"
    },
    {
      "id": "271b84b0-1c02-46b0-97b0-4207a9011996",
      "orderId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
      "method": "card",
      "status": "approved",
      "amount": "62.85",
      "given": null,
      "change": null,
      "card": {
        "brand": "visa",
        "last4": "4417",
        "entry": "contactless",
        "authCode": "731818",
        "declineReason": null
      },
      "at": "2026-11-23T07:14:32Z"
    }
  ],
  "refunds": [],
  "sync": "posted",
  "revision": 9
}
```

## Read the operation

Look a change up with the `operationId` you sent. The first outcome of the card start is `completed` at revision 7. It does not change later: what the reader did afterwards is on the order. See [Operations](https://pos.rdcopilot.com/docs/api-reference/operations/).

Get an operation

curl

```bash
curl "$RDC_BASE_URL/pos/v1/operations/d321f176-6d98-4a4d-8c07-4ce5210601f5" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/operations/d321f176-6d98-4a4d-8c07-4ce5210601f5`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/pos/v1/operations/d321f176-6d98-4a4d-8c07-4ce5210601f5',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/operations/d321f176-6d98-4a4d-8c07-4ce5210601f5');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/operations/d321f176-6d98-4a4d-8c07-4ce5210601f5");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```json
{
  "operationId": "d321f176-6d98-4a4d-8c07-4ce5210601f5",
  "status": "completed",
  "aggregateId": "9d8c072d-afa0-4272-97ab-4443d54d5b62",
  "aggregateRevision": 7
}
```

Repeat a request with the same `operationId` after a timeout. The change is applied once, and the amount reaches the reader once.
