Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Approve and file

    Sign, approve and file a validated return, and follow it to the answer of the authority.

    On this page

    Three steps stand between a validated return and the authority: someone signs, someone else approves, and the return is filed. Each step records who and when, and each refuses when the return is not ready.

    Sign

    Send the id of the person who signs as signedBy. The person must hold the signing right; otherwise the answer is not_a_signer. The return becomes signed and the signing evidence is recorded.

    curl

    curl -X POST "$RDC_BASE_URL/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/evidence/signing" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "6491ee32-5059-4639-bcbf-f33d64d78d07",
      "expectedRevision": 6,
      "signedBy": "adacf598-0e46-4866-a3c6-ba0234ecacc4"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/evidence/signing`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "6491ee32-5059-4639-bcbf-f33d64d78d07",
        "expectedRevision": 6,
        "signedBy": "adacf598-0e46-4866-a3c6-ba0234ecacc4"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/evidence/signing',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '6491ee32-5059-4639-bcbf-f33d64d78d07',
            'expectedRevision': 6,
            'signedBy': 'adacf598-0e46-4866-a3c6-ba0234ecacc4',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "6491ee32-5059-4639-bcbf-f33d64d78d07",
      "expectedRevision": 6,
      "signedBy": "adacf598-0e46-4866-a3c6-ba0234ecacc4"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/evidence/signing');
    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")}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/evidence/signing");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "6491ee32-5059-4639-bcbf-f33d64d78d07",
      "expectedRevision": 6,
      "signedBy": "adacf598-0e46-4866-a3c6-ba0234ecacc4"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "6491ee32-5059-4639-bcbf-f33d64d78d07",
      "status": "accepted",
      "aggregateId": "3b559a77-5de4-4b9a-9e2e-ca6625d123f2",
      "aggregateRevision": 7
    }

    Approve

    Send the id of the approver as approvedBy. The approver must hold the approval right and must not be the person who signed (self_approval). The return becomes authorized.

    curl

    curl -X POST "$RDC_BASE_URL/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/approval" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "36ef1b08-90df-4b5d-946f-33b8ad4f29ed",
      "expectedRevision": 7,
      "approvedBy": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/approval`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "36ef1b08-90df-4b5d-946f-33b8ad4f29ed",
        "expectedRevision": 7,
        "approvedBy": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/approval',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '36ef1b08-90df-4b5d-946f-33b8ad4f29ed',
            'expectedRevision': 7,
            'approvedBy': 'a0eaa217-d9ed-4f3e-b95a-c4b3176cf035',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "36ef1b08-90df-4b5d-946f-33b8ad4f29ed",
      "expectedRevision": 7,
      "approvedBy": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/approval');
    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")}/declarations/v1/returns/3b559a77-5de4-4b9a-9e2e-ca6625d123f2/approval");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "36ef1b08-90df-4b5d-946f-33b8ad4f29ed",
      "expectedRevision": 7,
      "approvedBy": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "36ef1b08-90df-4b5d-946f-33b8ad4f29ed",
      "status": "accepted",
      "aggregateId": "3b559a77-5de4-4b9a-9e2e-ca6625d123f2",
      "aggregateRevision": 8
    }

    File

    Filing queues the return and uploads it in one action. The answer is accepted, and the return is submitted with the upload index the authority gave.

    curl

    curl -X POST "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
      "expectedRevision": 5
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
        "expectedRevision": 5
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '800ebcec-00c4-4bf8-af9b-5019046edc00',
            'expectedRevision': 5,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
      "expectedRevision": 5
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission');
    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")}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
      "expectedRevision": 5
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
      "status": "accepted",
      "aggregateId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
      "aggregateRevision": 6
    }

    Follow the answer

    Ask the authority where the upload stands with refreshSubmission, or wait for the event. The first call moves a submitted return to processing (în prelucrare); the next one gives the answer: accepted (ok) with the receipt, or rejected (nok) with the message.

    curl

    curl -X POST "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission/refresh" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "f7f97d0a-f0e5-4a45-a412-8a71910acd77",
      "expectedRevision": 6
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission/refresh`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "f7f97d0a-f0e5-4a45-a412-8a71910acd77",
        "expectedRevision": 6
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission/refresh',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'f7f97d0a-f0e5-4a45-a412-8a71910acd77',
            'expectedRevision': 6,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "f7f97d0a-f0e5-4a45-a412-8a71910acd77",
      "expectedRevision": 6
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission/refresh');
    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")}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission/refresh");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "f7f97d0a-f0e5-4a45-a412-8a71910acd77",
      "expectedRevision": 6
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "f7f97d0a-f0e5-4a45-a412-8a71910acd77",
      "status": "accepted",
      "aggregateId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
      "aggregateRevision": 7
    }

    When the outcome is unknown

    If the upload times out and the product cannot tell whether the file arrived, the return is manual_review. Check with the authority and send it again once with resendSubmission; the new upload takes the next upload index and the earlier attempt stays in the history.

    curl

    curl -X POST "$RDC_BASE_URL/declarations/v1/returns/e0a7f7b8-c7cd-46bc-9053-95e250975d06/submission/resend" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "b083c6be-6a99-487b-ae79-e047223782a3",
      "expectedRevision": 7
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/e0a7f7b8-c7cd-46bc-9053-95e250975d06/submission/resend`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "b083c6be-6a99-487b-ae79-e047223782a3",
        "expectedRevision": 7
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/e0a7f7b8-c7cd-46bc-9053-95e250975d06/submission/resend',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'b083c6be-6a99-487b-ae79-e047223782a3',
            'expectedRevision': 7,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "b083c6be-6a99-487b-ae79-e047223782a3",
      "expectedRevision": 7
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/e0a7f7b8-c7cd-46bc-9053-95e250975d06/submission/resend');
    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")}/declarations/v1/returns/e0a7f7b8-c7cd-46bc-9053-95e250975d06/submission/resend");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "b083c6be-6a99-487b-ae79-e047223782a3",
      "expectedRevision": 7
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "b083c6be-6a99-487b-ae79-e047223782a3",
      "status": "accepted",
      "aggregateId": "e0a7f7b8-c7cd-46bc-9053-95e250975d06",
      "aggregateRevision": 8
    }