# Receipt copy and lookup

> Looking up a recorded receipt and printing its copy by receipt number, external identifier or internal identifier.

Source: https://ekasa.ninedigit.sk/en/docs/receipt-lookup

You can later **look up** a recorded receipt, for example when the registration response was lost or you need the
receipt identifier when goods are returned, or **print its copy** when the customer has lost the original receipt.
Nothing is sent to the eKasa system; eKasa reads the receipt from the storage.

You find a receipt by one of three identifiers. Always include the cash register code (`cashRegisterCode`) as well.

| Identifier | Where you get it |
|---|---|
| receipt number (year, month, sequence number) | printed on the receipt, in the result `request.data.receiptNumber` |
| external identifier `externalId` | your own, you sent it at registration |
| internal identifier `id` | in the registration result `request.id` |

With the same identifiers you also download the PDF file of a receipt issued as `pdf`
([Getting the PDF file](https://ekasa.ninedigit.sk/en/docs/receipt-registration/printing#getting-the-pdf-file)).

## Receipt lookup

A lookup returns the stored receipt with the same result as at registration (see
[Registration result](https://ekasa.ninedigit.sk/en/docs/receipt-registration/result)). If the receipt does not exist, the API returns
`404 Not Found` and the .NET library returns `null`.

### Lookup by receipt number

A receipt number is identified by three values: the year, the month and the sequence number within the month.

**HTTP API:**

```http
GET {server_address}/api/v1/requests/receipts/receipt?cashRegisterCode=88812345678900001&year=2026&month=4&receiptNumber=83
```

**.NET library:**

```csharp
var filter = new SingleReceiptRegistrationFilter(
    cashRegisterCode: "88812345678900001",
    receiptNumberId: new ReceiptNumberId(year: 2026, month: 4, number: 83u));

RegisterReceiptResult? receipt = await client.FindReceiptAsync(filter, cancellationToken);
```

### Lookup by external identifier

The external identifier (`externalId`) is provided by the parent application when registering the receipt.

**HTTP API:**

```http
GET {server_address}/api/v1/requests/receipts/receipt?cashRegisterCode=88812345678900001&externalId=5cb23300ce3ccc2d38ccdbde
```

**.NET library:**

```csharp
var filter = new SingleReceiptRegistrationFilter(
    cashRegisterCode: "88812345678900001",
    externalId: new ID("5cb23300ce3ccc2d38ccdbde"));

RegisterReceiptResult? receipt = await client.FindReceiptAsync(filter, cancellationToken);
```

### Lookup by internal identifier

The internal identifier (`id`) is generated by eKasa. It is not the unique receipt identifier (UID) from
the eKasa system.

**HTTP API:**

```http
GET {server_address}/api/v1/requests/receipts/receipt?cashRegisterCode=88812345678900001&id=2d419057-807c-41be-a5d6-aafea8eba13e
```

**.NET library:**

```csharp
var filter = new SingleReceiptRegistrationFilter(
    cashRegisterCode: "88812345678900001",
    id: new Guid("2d419057-807c-41be-a5d6-aafea8eba13e"));

RegisterReceiptResult? receipt = await client.FindReceiptAsync(filter, cancellationToken);
```

## Printing a receipt copy

The copy is printed with the label "KÓPIA DOKLADU" (receipt copy) and without the unique receipt identifier, the QR
code and the verification code (OKP), as required by
[§ 5(3)(e) of Act No. 384/2025 Coll.](https://www.slov-lex.sk/ezbierky-fe/pravne-predpisy/SK/ZZ/2025/384/20260101#paragraf-5.odsek-3.pismeno-e).
If the receipt does not exist, printing fails with the error
[`-104: ReceiptNotFound`](https://ekasa.ninedigit.sk/en/docs/rest-api/error-codes#-104-receiptnotfound).

<figure>

[Image: The original receipt: Cappuccino and Croissant, total 5.70 EUR, VAT summary, QR code, UID and OKP]

<figcaption>Original</figcaption>
</figure>
<figure>

[Image: A copy of the same receipt: the KÓPIA DOKLADU (receipt copy) label highlighted, without the QR code, UID and OKP]

<figcaption>Copy</figcaption>
</figure>

### Copy by receipt number

A receipt number is identified by three values: the year, the month and the sequence number within the month.

**HTTP API:**

```http
POST {server_address}/api/v1/requests/receipts/print_copy?cashRegisterCode=88812345678900001&year=2026&month=4&receiptNumber=83
```

**.NET library:**

```csharp
var receiptId = new ReceiptId(cashRegisterCode: "88812345678900001", year: 2026, month: 4, number: 83u);

PrintResult result = await client.PrintReceiptCopyAsync(receiptId, cancellationToken);
```

### Copy by external identifier

The external identifier (`externalId`) is provided by the parent application when registering the receipt.

**HTTP API:**

```http
POST {server_address}/api/v1/requests/receipts/print_copy?cashRegisterCode=88812345678900001&externalId=5cb23300ce3ccc2d38ccdbde
```

**.NET library:**

```csharp
PrintResult result = await client.PrintReceiptCopyAsync(
    "88812345678900001", new ID("5cb23300ce3ccc2d38ccdbde"), cancellationToken);
```

### Copy by internal identifier

The internal identifier (`id`) is generated by eKasa. It is not the unique receipt identifier (UID) from
the eKasa system.

**HTTP API:**

```http
POST {server_address}/api/v1/requests/receipts/print_copy?cashRegisterCode=88812345678900001&id=2d419057-807c-41be-a5d6-aafea8eba13e
```

**.NET library:**

```csharp
PrintResult result = await client.PrintReceiptCopyAsync(
    "88812345678900001", new Guid("2d419057-807c-41be-a5d6-aafea8eba13e"), cancellationToken);
```

## Where next

- [Duplicate protection](https://ekasa.ninedigit.sk/en/docs/receipt-registration/external-id): The externalId you can find the receipt by.
- [Registration result](https://ekasa.ninedigit.sk/en/docs/receipt-registration/result): What a found receipt contains.
- [Cancellations and returns](https://ekasa.ninedigit.sk/en/docs/receipt-registration/corrections): Correcting a receipt with a reference to the original.
