---
title: "Complete and receipt | Docs | Self-Checkout by R&D Copilot"
description: "Start the payment, record the answer of the card reader, read the receipt and release the lane."
canonical: "https://checkout.rdcopilot.com/docs/guides/complete-and-receipt/"
language: en
updated: 2026-11-22
---

# Complete and receipt

Start the payment, record the answer of the card reader, read the receipt and release the lane.

Payment has three steps: the lane starts it, the card reader answers, and the system closes the basket with a receipt. The lane is then `complete` until the shopper has the receipt.

## Start the payment

The basket needs at least one counted line, no line waiting for a weight and no intervention waiting. The lane moves to `payment`.

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "72151f2d-2a58-4822-b5bd-4767a4fa0905",
  "expectedRevision": 3
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "72151f2d-2a58-4822-b5bd-4767a4fa0905",
    "expectedRevision": 3
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '72151f2d-2a58-4822-b5bd-4767a4fa0905',
        'expectedRevision': 3,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "72151f2d-2a58-4822-b5bd-4767a4fa0905",
  "expectedRevision": 3
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment');
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")}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "72151f2d-2a58-4822-b5bd-4767a4fa0905",
  "expectedRevision": 3
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "72151f2d-2a58-4822-b5bd-4767a4fa0905",
  "status": "accepted",
  "aggregateId": "094a0e7f-0541-49b0-b063-3fa75d8468a8",
  "aggregateRevision": 4
}
```

| Refused with | Code | Why |
| --- | --- | --- |
| `409` | `basket_empty` | No line is counted yet. |
| `409` | `weight_pending` | The last line waits for its weight. |
| `409` | `assistance_pending` | An intervention waits. |

## Record the answer of the card reader

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment/result" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "714cd5d7-89eb-4592-8c86-d0d0e15ad9b9",
  "expectedRevision": 4,
  "result": "approved"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment/result`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "714cd5d7-89eb-4592-8c86-d0d0e15ad9b9",
    "expectedRevision": 4,
    "result": "approved"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment/result',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '714cd5d7-89eb-4592-8c86-d0d0e15ad9b9',
        'expectedRevision': 4,
        'result': 'approved',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "714cd5d7-89eb-4592-8c86-d0d0e15ad9b9",
  "expectedRevision": 4,
  "result": "approved"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment/result');
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")}/selfcheckout/v1/baskets/094a0e7f-0541-49b0-b063-3fa75d8468a8/payment/result");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "714cd5d7-89eb-4592-8c86-d0d0e15ad9b9",
  "expectedRevision": 4,
  "result": "approved"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "714cd5d7-89eb-4592-8c86-d0d0e15ad9b9",
  "status": "accepted",
  "aggregateId": "094a0e7f-0541-49b0-b063-3fa75d8468a8",
  "aggregateRevision": 5
}
```

-   `approved` completes the basket. It takes the next receipt number of the store, `paidAt` is set, and the event `basket.completed` is sent.
-   `declined` keeps the lane in `payment` and counts the decline. After 3 declines in a row the lane stops with the intervention `payment_problem`.
-   `cancelPayment` takes the basket back to scanning, for a shopper who adds an item or pays another way.

## Read the receipt

The receipt is the paid basket. Its number is `receipt` (Bon 1043 in the quickstart), `total` is the amount with VAT, and `vatBreakdown` has one row for each rate with the VAT contained in its amount. A basket with items of two rates has two rows.

Get a paid basket with two VAT rates

curl

```bash
curl "$RDC_BASE_URL/selfcheckout/v1/baskets/b6402596-2e53-4abd-bdc0-df8cdb8dba98" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/baskets/b6402596-2e53-4abd-bdc0-df8cdb8dba98`, {
  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"]}/selfcheckout/v1/baskets/b6402596-2e53-4abd-bdc0-df8cdb8dba98',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/baskets/b6402596-2e53-4abd-bdc0-df8cdb8dba98');
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")}/selfcheckout/v1/baskets/b6402596-2e53-4abd-bdc0-df8cdb8dba98");
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": "b6402596-2e53-4abd-bdc0-df8cdb8dba98",
  "storeId": "5c15af2a-ec60-41c3-b91c-db5b305b4fd1",
  "laneId": "d25b0432-ea78-46dc-921e-29051a2a9202",
  "status": "paid",
  "lines": [
    {
      "id": "69868a9e-fb51-477d-88f6-368958304f15",
      "code": "20101015",
      "sku": "PN-0101",
      "name": "White bread, 500 g",
      "kind": "packaged",
      "status": "active",
      "grams": 520,
      "unitPrice": "4.90",
      "vatRate": "11",
      "total": "4.90",
      "ageApprovedBy": null
    },
    {
      "id": "59b9cd64-8392-4ddc-a3bf-e917f73af56a",
      "code": "20101015",
      "sku": "PN-0101",
      "name": "White bread, 500 g",
      "kind": "packaged",
      "status": "active",
      "grams": 520,
      "unitPrice": "4.90",
      "vatRate": "11",
      "total": "4.90",
      "ageApprovedBy": null
    },
    {
      "id": "ce8095fd-949f-4879-ad22-61f94e7423c4",
      "code": "20202040",
      "sku": "LP-0204",
      "name": "Milk, 1 l",
      "kind": "packaged",
      "status": "active",
      "grams": 1040,
      "unitPrice": "8.20",
      "vatRate": "11",
      "total": "8.20",
      "ageApprovedBy": null
    },
    {
      "id": "7d05809f-4773-44b1-9361-27ba98d02a71",
      "code": "20202040",
      "sku": "LP-0204",
      "name": "Milk, 1 l",
      "kind": "packaged",
      "status": "active",
      "grams": 1040,
      "unitPrice": "8.20",
      "vatRate": "11",
      "total": "8.20",
      "ageApprovedBy": null
    },
    {
      "id": "45692730-310d-4669-a3d6-056e15a2369f",
      "code": "20202040",
      "sku": "LP-0204",
      "name": "Milk, 1 l",
      "kind": "packaged",
      "status": "active",
      "grams": 1040,
      "unitPrice": "8.20",
      "vatRate": "11",
      "total": "8.20",
      "ageApprovedBy": null
    },
    {
      "id": "80aa81ca-69c4-4f8c-a2f3-510b160a03e4",
      "code": "101",
      "sku": "MR-0001",
      "name": "Apples, per kg",
      "kind": "produce",
      "status": "active",
      "grams": 850,
      "unitPrice": "6.99",
      "vatRate": "11",
      "total": "5.94",
      "ageApprovedBy": null
    },
    {
      "id": "2136e84f-484e-405b-bedc-ab39e592b73b",
      "code": "20301019",
      "sku": "UL-0101",
      "name": "Sunflower oil, 1 l",
      "kind": "packaged",
      "status": "active",
      "grams": 930,
      "unitPrice": "10.99",
      "vatRate": "11",
      "total": "10.99",
      "ageApprovedBy": null
    },
    {
      "id": "1325bb12-3a06-42f6-8bd6-824f11f40002",
      "code": "20504120",
      "sku": "DT-0412",
      "name": "Dishwashing liquid, 1 l",
      "kind": "packaged",
      "status": "active",
      "grams": 1040,
      "unitPrice": "15.90",
      "vatRate": "21",
      "total": "15.90",
      "ageApprovedBy": null
    }
  ],
  "bagGrams": 0,
  "scaleGrams": 6980,
  "total": "67.23",
  "vat": "7.85",
  "vatBreakdown": [
    {
      "rate": "21",
      "gross": "15.90",
      "vat": "2.76"
    },
    {
      "rate": "11",
      "gross": "51.33",
      "vat": "5.09"
    }
  ],
  "currency": "RON",
  "receipt": "Bon 1042",
  "openedAt": "2026-11-23T07:04:20Z",
  "paidAt": "2026-11-23T07:07:15Z",
  "voidReason": null,
  "revision": 1
}
```

Amounts are decimal strings. The prices are shelf prices with VAT included, and the VAT of each rate is computed on the amount of that rate, so the rows add up to the total.

## Release the lane

When the shopper has the receipt, release the lane. It goes back to `idle` and the paid basket stays readable.

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/lanes/d25b0432-ea78-46dc-921e-29051a2a9202/release" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "d96f32af-c413-41c8-8878-0bb5b46ee6e5",
  "expectedRevision": 6
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/lanes/d25b0432-ea78-46dc-921e-29051a2a9202/release`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "d96f32af-c413-41c8-8878-0bb5b46ee6e5",
    "expectedRevision": 6
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/lanes/d25b0432-ea78-46dc-921e-29051a2a9202/release',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'd96f32af-c413-41c8-8878-0bb5b46ee6e5',
        'expectedRevision': 6,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "d96f32af-c413-41c8-8878-0bb5b46ee6e5",
  "expectedRevision": 6
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/lanes/d25b0432-ea78-46dc-921e-29051a2a9202/release');
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")}/selfcheckout/v1/lanes/d25b0432-ea78-46dc-921e-29051a2a9202/release");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "d96f32af-c413-41c8-8878-0bb5b46ee6e5",
  "expectedRevision": 6
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "d96f32af-c413-41c8-8878-0bb5b46ee6e5",
  "status": "accepted",
  "aggregateId": "93745be9-35d3-4b71-a2a6-dfcafee63996",
  "aggregateRevision": 7
}
```

A basket is paid once. A second result for basket 094a0e7f… or any paid basket is refused with `no_payment_pending`.
