---
title: "Partners | Docs | ERP by R&D Copilot"
description: "Customers and suppliers: the companies you sell to and buy from, with their terms and limits."
canonical: "https://erp.rdcopilot.com/docs/api-reference/partners/"
language: en
updated: 2026-11-22
---

# Partners

Customers and suppliers: the companies you sell to and buy from, with their terms and limits.

## List partners

GET `/erp/v1/partners`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `role` | query | `string` | Nooptional | Only customers or only suppliers. One of `customer`, `supplier` |
| `limit` | query | `integer` | Nooptional | Records per page, from 1 to 500. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of partners. | `PartnerPage` |
| `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` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/erp/v1/partners?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/partners?limit=20`, {
  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"]}/erp/v1/partners?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/partners?limit=20');
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")}/erp/v1/partners?limit=20");
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

```json
{
  "items": [
    {
      "id": "88e177c6-55ac-4cd5-90af-70c333498d2b",
      "name": "Hanul Ozana SRL",
      "roles": [
        "customer"
      ],
      "city": "Târgu Neamț",
      "country": "RO",
      "vatId": "RO39172541",
      "paymentTermsDays": 30,
      "creditLimit": "15000.00"
    },
    {
      "id": "59ebc921-4507-4c03-b6ee-9801f14e7b09",
      "name": "Cofetăria Vălul Alb SRL",
      "roles": [
        "customer"
      ],
      "city": "Roman",
      "country": "RO",
      "vatId": "RO39172614",
      "paymentTermsDays": 15,
      "creditLimit": "8000.00"
    }
  ],
  "nextCursor": null
}
```

## Create a partner

POST `/erp/v1/partners`

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `name` | `string` | Yesrequired | Name of the company. |
| `roles` | `string[]` | Yesrequired | What the partner is to you. |
| `city` | `string` | Yesrequired | Town of the partner. |
| `country` | `string` | Yesrequired | Two-letter country code. |
| `vatId` | `string` | Nooptional | VAT identifier, if the partner has one. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `400` | The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. `fields` names each one and says what is wrong with it. | `Error` |
| `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` |
| `409` | The `operationId` was used before with a different request. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/erp/v1/partners" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f",
  "name": "Băuturi Trotuș SRL",
  "roles": [
    "supplier"
  ],
  "city": "Onești",
  "country": "RO",
  "vatId": "RO51603783"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/partners`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f",
    "name": "Băuturi Trotuș SRL",
    "roles": [
      "supplier"
    ],
    "city": "Onești",
    "country": "RO",
    "vatId": "RO51603783"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/erp/v1/partners',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f',
        'name': 'Băuturi Trotuș SRL',
        'roles': [
            'supplier',
        ],
        'city': 'Onești',
        'country': 'RO',
        'vatId': 'RO51603783',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f",
  "name": "Băuturi Trotuș SRL",
  "roles": [
    "supplier"
  ],
  "city": "Onești",
  "country": "RO",
  "vatId": "RO51603783"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/partners');
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")}/erp/v1/partners");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f",
  "name": "Băuturi Trotuș SRL",
  "roles": [
    "supplier"
  ],
  "city": "Onești",
  "country": "RO",
  "vatId": "RO51603783"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "198aa2c7-7aa6-4ef8-91b6-2655bcdfce2f",
  "status": "accepted",
  "aggregateId": "6c530bd6-7a0b-45d5-ab13-c97963e33d0a",
  "aggregateRevision": 1
}
```

## Get a partner

GET `/erp/v1/partners/{partnerId}`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `partnerId` | path | `string (uuid)` | Yesrequired | The partner. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The partner. | `Partner` |
| `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 customer or supplier does not exist, or is not one of the kind the request needs. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/erp/v1/partners/88e177c6-55ac-4cd5-90af-70c333498d2b" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/partners/88e177c6-55ac-4cd5-90af-70c333498d2b`, {
  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"]}/erp/v1/partners/88e177c6-55ac-4cd5-90af-70c333498d2b',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/partners/88e177c6-55ac-4cd5-90af-70c333498d2b');
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")}/erp/v1/partners/88e177c6-55ac-4cd5-90af-70c333498d2b");
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

```json
{
  "id": "88e177c6-55ac-4cd5-90af-70c333498d2b",
  "name": "Hanul Ozana SRL",
  "roles": [
    "customer"
  ],
  "city": "Târgu Neamț",
  "country": "RO",
  "vatId": "RO39172541",
  "paymentTermsDays": 30,
  "creditLimit": "15000.00"
}
```
