Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Approvals

    Approve a signed return and read who approved it and when.

    On this page

    Get the approval of a return

    GET /declarations/v1/returns/{returnId}/approval

    Returns who approved the return and when.

    Parameters

    NameInTypeRequiredMeaning
    returnId path string (uuid) Yesrequired The return.

    Responses

    StatusMeaningBody
    200 The approval. Approval
    401 The token is missing, not valid or has ended. Error
    403 The token does not give access to this data. Error
    404 return_not_found: The return does not exist in your account. approval_not_found: The return has not been approved yet. Error
    429 Too many requests. Retry-After gives the seconds to wait; the request was not processed. Error
    503 The service cannot answer now. Error

    Request

    curl

    curl "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/approval" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/approval`, {
      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/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/approval',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/approval');
    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/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/approval");
    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

    {
      "returnId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
      "approvedBy": {
        "id": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035",
        "name": "Ana Rusu",
        "role": "Finance director, approver"
      },
      "approvedAt": "2026-11-22T16:40:00Z",
      "revision": 5
    }

    Approve a return

    POST /declarations/v1/returns/{returnId}/approval

    Approves a signed return and records the approver and the time. The approver must hold the approval right and must not be the person who signed. It is refused while an error finding remains.

    Parameters

    NameInTypeRequiredMeaning
    returnId path string (uuid) Yesrequired The return.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.
    expectedRevision integer Yesrequired The revision of the return you read.
    approvedBy string (uuid) Yesrequired The approver: the id of a person of your account who holds the approval right and did not sign.

    Responses

    StatusMeaningBody
    202 The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. OperationResult
    401 The token is missing, not valid or has ended. Error
    403 The token does not give access to this data. Error
    404 The return does not exist in your account. Error
    409 revision_conflict: The return changed since the revision you sent. Nothing was applied. operation_reused: The operationId was already used with a different request. invalid_status: The return is not in a status that allows this. Error
    422 blocked_by_findings: The return has an error finding. It cannot be signed, approved or filed while one remains. Nothing was changed. not_an_approver: The person may not approve returns of this company. self_approval: The person who signed the return cannot approve it. Error
    429 Too many requests. Retry-After gives the seconds to wait; the request was not processed. Error
    503 The service cannot answer now. Error

    Request

    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

    JSON

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