Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Archive receipts

    List the receipts of a company, keep each file with its hash and check the hash when you read it back.

    The receipt is the proof that the authority accepted a return, so it belongs in your own archive as well. The API gives you the record of the stored file: its name, the upload index it answers and the SHA-256.

    1. List the receipts

      listReceipts returns the receipts of a company, newest period first. Narrow it with form and period.

    2. Store the file and the record

      Keep the file under its name with the sha256, the uploadIndex and the returnId beside it.

    3. Check when you read it back

      Compute the SHA-256 of the file you stored and compare it with the one the API returns. If they differ, the file in your archive is not the receipt.

    curl

    curl "$RDC_BASE_URL/declarations/v1/receipts?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/receipts?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&limit=20`, {
      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"]}/declarations/v1/receipts?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/receipts?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&limit=20');
    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")}/declarations/v1/receipts?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&limit=20");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "id": "c7170b80-c031-4d62-8818-7d4be2223cdf",
          "returnId": "bffa5db8-996e-4309-a693-d91075904265",
          "submissionId": "e368d9bf-b37c-4987-979b-0e7d66d6acef",
          "uploadIndex": "5013480112",
          "name": "recipisa-D300-2026-09-v1.pdf",
          "contentType": "application/pdf",
          "sha256": "34aae118094190a91f9948cb3bee8a0e14d9ffc82d5796c69e32f7659f0cdf6b",
          "storedAt": "2026-10-22T09:47:40Z"
        },
        {
          "id": "a9955f5a-44c4-4dfd-a17e-6032bb936190",
          "returnId": "188e602f-ac95-4698-a7b7-1be1e6dc2227",
          "submissionId": "fcd7a804-a4d1-4dec-bafb-74432359303e",
          "uploadIndex": "5013480118",
          "name": "recipisa-D390-2026-09-v1.pdf",
          "contentType": "application/pdf",
          "sha256": "a9d10e2b35c78ccf04374fd32b9e8148e5fa8cc6c53ce386f38ba2fb35653b44",
          "storedAt": "2026-10-22T10:17:40Z"
        },
        {
          "id": "679a8b44-d1c2-4923-af39-08aec3adbd25",
          "returnId": "8ced2143-3296-4997-b27b-4ee93ec13aa1",
          "submissionId": "4a9bfb0a-2b07-4b7c-a2e5-8e3505bfd295",
          "uploadIndex": "5013480131",
          "name": "recipisa-D394-2026-09-v1.pdf",
          "contentType": "application/pdf",
          "sha256": "94ebccfd00512436815a3e9bc1f52e181ad987a2db9a6d766cf21b3fce988426",
          "storedAt": "2026-10-26T10:42:40Z"
        },
        {
          "id": "4c6b9d25-68e1-46a6-99f9-e4993a807e40",
          "returnId": "2117dae0-ce0b-4500-afc9-54af48b708e9",
          "submissionId": "77a39eaf-1bcd-4530-98a7-5b776bd2d224",
          "uploadIndex": "5013480144",
          "name": "recipisa-D406-2026-09-v1.pdf",
          "contentType": "application/pdf",
          "sha256": "32cbe7672b848679899515612fe5a5ffabbfed3571a0c631dc688470f041e6e9",
          "storedAt": "2026-10-27T11:57:40Z"
        }
      ],
      "nextCursor": null
    }

    Every receipt names its returnId and its submissionId. A corrected return has a receipt for the version that was accepted; the version that was rejected has none, and its message is in the submission. Follow the receiptId of a submission to the receipt.

    curl

    curl "$RDC_BASE_URL/declarations/v1/receipts/c7170b80-c031-4d62-8818-7d4be2223cdf" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/receipts/c7170b80-c031-4d62-8818-7d4be2223cdf`, {
      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"]}/declarations/v1/receipts/c7170b80-c031-4d62-8818-7d4be2223cdf',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/receipts/c7170b80-c031-4d62-8818-7d4be2223cdf');
    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")}/declarations/v1/receipts/c7170b80-c031-4d62-8818-7d4be2223cdf");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "id": "c7170b80-c031-4d62-8818-7d4be2223cdf",
      "returnId": "bffa5db8-996e-4309-a693-d91075904265",
      "submissionId": "e368d9bf-b37c-4987-979b-0e7d66d6acef",
      "uploadIndex": "5013480112",
      "name": "recipisa-D300-2026-09-v1.pdf",
      "contentType": "application/pdf",
      "sha256": "34aae118094190a91f9948cb3bee8a0e14d9ffc82d5796c69e32f7659f0cdf6b",
      "storedAt": "2026-10-22T09:47:40Z"
    }