---
title: "Sales orders | Docs | ERP by R&D Copilot"
description: "Enter, confirm and reserve sales orders."
canonical: "https://erp.rdcopilot.com/docs/api-reference/sales-orders/"
language: en
updated: 2026-11-22
---

# Sales orders

Enter, confirm and reserve sales orders.

## List sales orders

GET `/erp/v1/sales-orders`

Returns sales orders in pages, newest first.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `status` | query | `string` | Nooptional | Only orders in this status. One of `draft`, `confirmed`, `reserved`, `delivered`, `invoiced`, `paid` |
| `customerId` | query | `string (uuid)` | Nooptional | Only the orders of this customer. |
| `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 sales orders. | `SalesOrderPage` |
| `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/sales-orders?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/sales-orders?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/sales-orders?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/sales-orders?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/sales-orders?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": "5bbf3ba9-79a4-497d-9427-bb0ffdc159d1",
      "number": "CV-1047",
      "customerId": "88e177c6-55ac-4cd5-90af-70c333498d2b",
      "customerName": "Hanul Ozana SRL",
      "date": "2026-11-21",
      "status": "confirmed",
      "lines": [
        {
          "code": "ZA-0201",
          "name": "Sugar, 1 kg",
          "quantity": "100",
          "unit": "bag",
          "unitPrice": "4.29",
          "vatRate": "11",
          "net": "429.00",
          "reserved": "0",
          "short": "100"
        },
        {
          "code": "AM-0518",
          "name": "Paper bags, pack of 100",
          "quantity": "6",
          "unit": "pack",
          "unitPrice": "13.13",
          "vatRate": "21",
          "net": "78.78",
          "reserved": "0",
          "short": "6"
        }
      ],
      "net": "507.78",
      "vat": "63.73",
      "total": "571.51",
      "vatBreakdown": [
        {
          "rate": "11",
          "base": "429.00",
          "vat": "47.19"
        },
        {
          "rate": "21",
          "base": "78.78",
          "vat": "16.54"
        }
      ],
      "currency": "RON",
      "deliveryId": null,
      "deliveryNumber": null,
      "invoiceId": null,
      "invoiceNumber": null,
      "revision": 2
    },
    {
      "id": "5abf3a16-7ea1-4766-8d3d-f1ee18ab26f4",
      "number": "CV-1046",
      "customerId": "f5f8d551-a070-4047-87f4-c7adb8dd4ddb",
      "customerName": "Silozurile Zănești SRL",
      "date": "2026-11-21",
      "status": "reserved",
      "lines": [
        {
          "code": "UL-0101",
          "name": "Sunflower oil, 1 l",
          "quantity": "48",
          "unit": "bottle",
          "unitPrice": "7.84",
          "vatRate": "11",
          "net": "376.32",
          "reserved": "48",
          "short": "0"
        },
        {
          "code": "LA-0307",
          "name": "Cheese, 400 g",
          "quantity": "24",
          "unit": "pack",
          "unitPrice": "18.65",
          "vatRate": "11",
          "net": "447.60",
          "reserved": "24",
          "short": "0"
        }
      ],
      "net": "823.92",
      "vat": "90.63",
      "total": "914.55",
      "vatBreakdown": [
        {
          "rate": "11",
          "base": "823.92",
          "vat": "90.63"
        }
      ],
      "currency": "RON",
      "deliveryId": null,
      "deliveryNumber": null,
      "invoiceId": null,
      "invoiceNumber": null,
      "revision": 3
    }
  ],
  "nextCursor": null
}
```

## Create a sales order

POST `/erp/v1/sales-orders`

Enters an order as a draft. Each line takes the sales price of its item at this moment. The order is confirmed with `confirmSalesOrder`.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `customerId` | `string (uuid)` | Yesrequired | The customer. It is the `id` of a partner. |
| `lines` | `OrderLineInput[]` | Yesrequired | The lines: an item once each. |
| `lines[].code` | `string` | Yesrequired | Code of the item. |
| `lines[].quantity` | `string` | Yesrequired | Whole units, at least 1. |

### 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` |
| `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` | `partner_not_found`: The customer or supplier does not exist, or is not one of the kind the request needs. `item_not_found`: The item does not exist. | `Error` |
| `409` | The `operationId` was used before with a different request. | `Error` |
| `422` | `no_lines`: The document has no line. `duplicate_item`: An item appears on more than one line. `invalid_quantity`: A quantity is not a whole number from 1 to 1000000. | `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/sales-orders" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "ae72c8b0-f759-4c6e-a790-09971f6379e4",
  "customerId": "59ebc921-4507-4c03-b6ee-9801f14e7b09",
  "lines": [
    {
      "code": "ZA-0201",
      "quantity": "20"
    },
    {
      "code": "UL-0101",
      "quantity": "12"
    }
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/sales-orders`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "ae72c8b0-f759-4c6e-a790-09971f6379e4",
    "customerId": "59ebc921-4507-4c03-b6ee-9801f14e7b09",
    "lines": [
      {
        "code": "ZA-0201",
        "quantity": "20"
      },
      {
        "code": "UL-0101",
        "quantity": "12"
      }
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/erp/v1/sales-orders',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'ae72c8b0-f759-4c6e-a790-09971f6379e4',
        'customerId': '59ebc921-4507-4c03-b6ee-9801f14e7b09',
        'lines': [
            {
                'code': 'ZA-0201',
                'quantity': '20',
            },
            {
                'code': 'UL-0101',
                'quantity': '12',
            },
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "ae72c8b0-f759-4c6e-a790-09971f6379e4",
  "customerId": "59ebc921-4507-4c03-b6ee-9801f14e7b09",
  "lines": [
    {
      "code": "ZA-0201",
      "quantity": "20"
    },
    {
      "code": "UL-0101",
      "quantity": "12"
    }
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/sales-orders');
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/sales-orders");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "ae72c8b0-f759-4c6e-a790-09971f6379e4",
  "customerId": "59ebc921-4507-4c03-b6ee-9801f14e7b09",
  "lines": [
    {
      "code": "ZA-0201",
      "quantity": "20"
    },
    {
      "code": "UL-0101",
      "quantity": "12"
    }
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "ae72c8b0-f759-4c6e-a790-09971f6379e4",
  "status": "accepted",
  "aggregateId": "74bf6304-7842-41e8-9928-f4420004d89c",
  "aggregateRevision": 1
}
```

## Get a sales order

GET `/erp/v1/sales-orders/{salesOrderId}`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `salesOrderId` | path | `string (uuid)` | Yesrequired | The sales order. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The order at its current revision. | `SalesOrder` |
| `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 sales order does not exist. | `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/sales-orders/5ebf4062-8294-45ba-b582-ae4b932bb9de" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/sales-orders/5ebf4062-8294-45ba-b582-ae4b932bb9de`, {
  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/sales-orders/5ebf4062-8294-45ba-b582-ae4b932bb9de',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/sales-orders/5ebf4062-8294-45ba-b582-ae4b932bb9de');
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/sales-orders/5ebf4062-8294-45ba-b582-ae4b932bb9de");
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": "5ebf4062-8294-45ba-b582-ae4b932bb9de",
  "number": "CV-1042",
  "customerId": "88e177c6-55ac-4cd5-90af-70c333498d2b",
  "customerName": "Hanul Ozana SRL",
  "date": "2026-11-18",
  "status": "invoiced",
  "lines": [
    {
      "code": "FA-0010",
      "name": "White flour, 10 kg bag",
      "quantity": "24",
      "unit": "bag",
      "unitPrice": "38.90",
      "vatRate": "11",
      "net": "933.60",
      "reserved": "24",
      "short": "0"
    },
    {
      "code": "UL-0101",
      "name": "Sunflower oil, 1 l",
      "quantity": "60",
      "unit": "bottle",
      "unitPrice": "7.84",
      "vatRate": "11",
      "net": "470.40",
      "reserved": "60",
      "short": "0"
    },
    {
      "code": "ZA-0201",
      "name": "Sugar, 1 kg",
      "quantity": "80",
      "unit": "bag",
      "unitPrice": "4.29",
      "vatRate": "11",
      "net": "343.20",
      "reserved": "80",
      "short": "0"
    },
    {
      "code": "LA-0307",
      "name": "Cheese, 400 g",
      "quantity": "36",
      "unit": "pack",
      "unitPrice": "18.65",
      "vatRate": "11",
      "net": "671.40",
      "reserved": "36",
      "short": "0"
    },
    {
      "code": "DT-0412",
      "name": "Dishwashing liquid, 5 l",
      "quantity": "12",
      "unit": "canister",
      "unitPrice": "23.47",
      "vatRate": "21",
      "net": "281.64",
      "reserved": "12",
      "short": "0"
    },
    {
      "code": "AM-0518",
      "name": "Paper bags, pack of 100",
      "quantity": "9",
      "unit": "pack",
      "unitPrice": "13.13",
      "vatRate": "21",
      "net": "118.17",
      "reserved": "9",
      "short": "0"
    }
  ],
  "net": "2818.41",
  "vat": "350.01",
  "total": "3168.42",
  "vatBreakdown": [
    {
      "rate": "11",
      "base": "2418.60",
      "vat": "266.05"
    },
    {
      "rate": "21",
      "base": "399.81",
      "vat": "83.96"
    }
  ],
  "currency": "RON",
  "deliveryId": "4a4f7bb2-5be2-49f4-90a9-8c63c9f310f7",
  "deliveryNumber": "LIV-2026-01842",
  "invoiceId": "bdcb9002-9dfc-468d-bad1-06fa8e9bd48b",
  "invoiceNumber": "FCT-2026-00418",
  "revision": 5
}
```

## Confirm a sales order

POST `/erp/v1/sales-orders/{salesOrderId}/confirm`

Moves a draft to `confirmed` when the unpaid invoices of the customer plus this order stay within the credit limit. Over the limit the order stays a draft.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `salesOrderId` | path | `string (uuid)` | Yesrequired | The sales order. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `expectedRevision` | `integer` | Yesrequired | The revision of the order you read. |

### 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` |
| `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 sales order does not exist. | `Error` |
| `409` | `operation_reused`: The `operationId` was used before with a different request. `revision_conflict`: The record has changed since the revision you sent as `expectedRevision`. `wrong_status`: The record is not in a status that allows this change. `credit_limit_exceeded`: The customer's unpaid invoices plus this order are over the credit limit. The order stays a draft. | `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/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/confirm" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "bcf8f768-d67b-47aa-a7af-25b74eb53991",
  "expectedRevision": 1
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/confirm`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "bcf8f768-d67b-47aa-a7af-25b74eb53991",
    "expectedRevision": 1
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/confirm',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'bcf8f768-d67b-47aa-a7af-25b74eb53991',
        'expectedRevision': 1,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "bcf8f768-d67b-47aa-a7af-25b74eb53991",
  "expectedRevision": 1
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/confirm');
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/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/confirm");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "bcf8f768-d67b-47aa-a7af-25b74eb53991",
  "expectedRevision": 1
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "bcf8f768-d67b-47aa-a7af-25b74eb53991",
  "status": "accepted",
  "aggregateId": "74bf6304-7842-41e8-9928-f4420004d89c",
  "aggregateRevision": 2
}
```

## Reserve stock for a sales order

POST `/erp/v1/sales-orders/{salesOrderId}/reserve`

Sets aside the free stock for each line. When every line is covered the order becomes `reserved`; otherwise it stays `confirmed`, each line shows what is still `short`, and reserving again after a receipt takes the rest.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `salesOrderId` | path | `string (uuid)` | Yesrequired | The sales order. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `expectedRevision` | `integer` | Yesrequired | The revision of the order you read. |

### 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` |
| `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 sales order does not exist. | `Error` |
| `409` | `operation_reused`: The `operationId` was used before with a different request. `revision_conflict`: The record has changed since the revision you sent as `expectedRevision`. `wrong_status`: The record is not in a status that allows this change. `nothing_to_reserve`: No unit that the order still wants is free in stock. | `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/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/reserve" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "cd26f38e-8527-4023-adc9-5899886fd3c0",
  "expectedRevision": 2
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/reserve`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "cd26f38e-8527-4023-adc9-5899886fd3c0",
    "expectedRevision": 2
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/reserve',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'cd26f38e-8527-4023-adc9-5899886fd3c0',
        'expectedRevision': 2,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "cd26f38e-8527-4023-adc9-5899886fd3c0",
  "expectedRevision": 2
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/erp/v1/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/reserve');
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/sales-orders/74bf6304-7842-41e8-9928-f4420004d89c/reserve");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "cd26f38e-8527-4023-adc9-5899886fd3c0",
  "expectedRevision": 2
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "cd26f38e-8527-4023-adc9-5899886fd3c0",
  "status": "accepted",
  "aggregateId": "74bf6304-7842-41e8-9928-f4420004d89c",
  "aggregateRevision": 3
}
```
