Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Authorisations

    The authorisation a company gave the gateway at the authority: read it and renew it.

    On this page

    Get the authorisation

    GET /efactura/v1/companies/{companyId}/authorisation

    Returns the authorisation the company gave the gateway: its status, its end date, who gave it and what it allows. The answer is 404 until the representative of the company has confirmed access.

    Parameters

    NameInTypeRequiredMeaning
    companyId path string (uuid) Yesrequired The company.

    Responses

    StatusMeaningBody
    200 The authorisation. Authorisation
    401 The token is missing, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 company_not_found: The company does not exist in your account. no_authorisation: The company has no authorisation yet: its representative has not confirmed access at the authority. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl "$RDC_BASE_URL/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation`, {
      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"]}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation');
    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")}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation");
    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

    {
      "companyId": "aaa74c23-5c48-4055-82e9-dc5c4c36c13e",
      "status": "renewal_needed",
      "expires": "2026-12-03",
      "authorisedBy": {
        "name": "Ioana Marin",
        "role": "Chief accountant"
      },
      "scope": [
        "send",
        "receive"
      ],
      "renewal": null,
      "revision": 1
    }

    Start a renewal

    POST /efactura/v1/companies/{companyId}/authorisation/renewal

    Prepares the renewal of an authorisation whose status is renewal_needed. The representative of the company then confirms access at the authority. It is refused for an authorisation that is active, for one that is revoked and while a renewal is under way.

    Parameters

    NameInTypeRequiredMeaning
    companyId path string (uuid) Yesrequired The company.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.

    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, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 The company does not exist in your account. Error
    409 operation_reused: The operationId was already used with a different request. authorisation_revoked: The authorisation was revoked. The gateway cannot renew it. no_renewal_needed: The authorisation does not need renewal yet. renewal_running: A renewal is already under way. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl -X POST "$RDC_BASE_URL/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "9918b72d-5684-45ca-a650-5265b947f97a"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "9918b72d-5684-45ca-a650-5265b947f97a"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '9918b72d-5684-45ca-a650-5265b947f97a',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "9918b72d-5684-45ca-a650-5265b947f97a"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal');
    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")}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "9918b72d-5684-45ca-a650-5265b947f97a"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "9918b72d-5684-45ca-a650-5265b947f97a",
      "status": "accepted",
      "aggregateId": "aaa74c23-5c48-4055-82e9-dc5c4c36c13e",
      "aggregateRevision": 2
    }

    Check a renewal

    POST /efactura/v1/companies/{companyId}/authorisation/renewal/check

    Asks the gateway to look at the authority for the new authorisation. When the representative has confirmed, the status becomes active and expires moves to the new end date.

    Parameters

    NameInTypeRequiredMeaning
    companyId path string (uuid) Yesrequired The company.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.

    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, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 The company does not exist in your account. Error
    409 operation_reused: The operationId was already used with a different request. no_renewal_running: No renewal is under way. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl -X POST "$RDC_BASE_URL/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal/check" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "70eaf4ae-02ab-4e0b-bb10-5abfc16f483a"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal/check`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "70eaf4ae-02ab-4e0b-bb10-5abfc16f483a"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal/check',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '70eaf4ae-02ab-4e0b-bb10-5abfc16f483a',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "70eaf4ae-02ab-4e0b-bb10-5abfc16f483a"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal/check');
    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")}/efactura/v1/companies/aaa74c23-5c48-4055-82e9-dc5c4c36c13e/authorisation/renewal/check");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "70eaf4ae-02ab-4e0b-bb10-5abfc16f483a"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "70eaf4ae-02ab-4e0b-bb10-5abfc16f483a",
      "status": "accepted",
      "aggregateId": "aaa74c23-5c48-4055-82e9-dc5c4c36c13e",
      "aggregateRevision": 3
    }