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
Add the company
Add a company with the rights it needs. Its
authorisationisnull.The representative confirms
The representative of the company confirms at the authority that the gateway may act for it.
The gateway sees the authorisation
The company then has an
authorisationwith the statusactive, 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(); {
"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
} | Field | Meaning |
|---|---|
status | active, renewal_needed or revoked. See Expiry and renewal. |
expires | The day the authorisation ends. |
authorisedBy | The name and the role of the person who gave it. |
scope | What it allows: send, receive or both. |
renewal | waiting while a renewal is under way, else null. |