Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Authorise access at the authority

    The step that gives the gateway the right to act for a company: what the representative does and what you see in the API.

    On this page

    The gateway uploads and downloads invoices for a company only after the company has allowed it. The company gives that permission at the authority, through its representative. It is not an API call and the gateway does not imitate the screens of the authority: they belong to the authority and can change.

    The steps

    1. Add the company

      Add a company with the rights it needs. Its authorisation is null.

    2. The representative confirms

      The representative of the company confirms at the authority that the gateway may act for it.

    3. The gateway sees the authorisation

      The company then has an authorisation with the status active, an end date, the name of the person who gave it and its rights.

    Read the authorisation

    Until the representative has confirmed, the answer is a 404 with no_authorisation. Afterwards it shows what the Companies view shows: the status, the end date, who authorised and what the authorisation allows.

    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

    {
      "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
    }

    FieldMeaning
    statusactive, renewal_needed or revoked. See Expiry and renewal.
    expiresThe day the authorisation ends.
    authorisedByThe name and the role of the person who gave it.
    scopeWhat it allows: send, receive or both.
    renewalwaiting while a renewal is under way, else null.