---
title: "Add a company | Docs | e-Factura Gateway by R&D Copilot"
description: "Add a company to your account by its CIF, read it, and see what it needs before it can send or receive."
canonical: "https://efactura.rdcopilot.com/docs/companies/add-a-company/"
language: en
updated: 2026-11-22
---

# Add a company

Add a company to your account by its CIF, read it, and see what it needs before it can send or receive.

An account holds the companies you send and receive invoices for. Each company is identified by its CIF and has its own invoices, its own authorisation at the authority, its own synchronisation and its own event endpoint. The `id` of a company is the `companyId` of every request about its invoices and the `legalCompanyId` of its events.

## Add the company

Send the CIF, digits only, and the rights the gateway needs for the company: `send`, `receive` or both. The answer is an operation result, and `aggregateId` is the `id` of the new company.

curl

```bash
curl -X POST "$RDC_BASE_URL/efactura/v1/companies" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "7add495a-6ec4-4f64-b25e-5961d8d75e00",
  "cif": "4017226",
  "scope": [
    "send",
    "receive"
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "7add495a-6ec4-4f64-b25e-5961d8d75e00",
    "cif": "4017226",
    "scope": [
      "send",
      "receive"
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/efactura/v1/companies',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '7add495a-6ec4-4f64-b25e-5961d8d75e00',
        'cif': '4017226',
        'scope': [
            'send',
            'receive',
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "7add495a-6ec4-4f64-b25e-5961d8d75e00",
  "cif": "4017226",
  "scope": [
    "send",
    "receive"
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/efactura/v1/companies");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "7add495a-6ec4-4f64-b25e-5961d8d75e00",
  "cif": "4017226",
  "scope": [
    "send",
    "receive"
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "7add495a-6ec4-4f64-b25e-5961d8d75e00",
  "status": "accepted",
  "aggregateId": "61d24c9f-10f4-40c8-97bc-1b55b0d8839a",
  "aggregateRevision": 1
}
```

Adding the same CIF twice is refused with `company_exists`.

## Read the company

A company carries everything the Companies view of the product shows.

| Field | Meaning |
| --- | --- |
| `authorisation` | What the company allowed the gateway to do at the authority: its status, its end date, who gave it and the rights. `null` until the representative of the company has confirmed access. See [Authorise access at the authority](https://efactura.rdcopilot.com/docs/companies/authorise-access/). |
| `sync` | Whether synchronisation is paused and when the gateway last synchronised the company. See [Sync received invoices](https://efactura.rdcopilot.com/docs/receive/sync-received-invoices/). |
| `endpoint` | The host of the event endpoint, and whether it answers. See [Subscriptions](https://efactura.rdcopilot.com/docs/events/subscriptions/). |

curl

```bash
curl "$RDC_BASE_URL/efactura/v1/companies/c6a26b8c-3323-4e7a-8611-f5a92f5e1a42" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies/c6a26b8c-3323-4e7a-8611-f5a92f5e1a42`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/efactura/v1/companies/c6a26b8c-3323-4e7a-8611-f5a92f5e1a42',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies/c6a26b8c-3323-4e7a-8611-f5a92f5e1a42');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/efactura/v1/companies/c6a26b8c-3323-4e7a-8611-f5a92f5e1a42");
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
{
  "id": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
  "name": "Brumar Distribuție SRL",
  "cif": "48290619",
  "vatId": "RO48290619",
  "authorisation": {
    "status": "active",
    "expires": "2027-03-12",
    "authorisedBy": {
      "name": "Ana Rusu",
      "role": "Finance director"
    },
    "scope": [
      "send",
      "receive"
    ],
    "renewal": null
  },
  "sync": {
    "paused": false,
    "lastAt": "2026-11-23T05:00:00Z"
  },
  "endpoint": {
    "host": "erp.brumar.example",
    "status": "healthy",
    "http": 200
  },
  "revision": 1
}
```

A company can send and receive only while its authorisation is in force. You can create drafts for a company at any time; sending is refused with `authorisation_not_in_force` until the authorisation is there.
