---
title: "Reversals | Docs | Accounting by R&D Copilot"
description: "Correct a posted entry with a linked reversal. A posted entry is never edited."
canonical: "https://accounting.rdcopilot.com/docs/api-reference/reversals/"
language: en
updated: 2026-11-22
---

# Reversals

Correct a posted entry with a linked reversal. A posted entry is never edited.

## Reverse a journal entry

POST `/accounting/v1/journal-entries/{entryId}/reversals`

Posts a linked entry with debit and credit swapped, dated `reversalDate`, and gives the source document back for review. The reversed entry stays as it was and carries `reversedBy`. It is refused when the entry already has a reversal or is itself a reversal, when the date is in a locked period and when it is before the entry.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `entryId` | path | `string (uuid)` | Yesrequired | The entry to reverse. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `reversalDate` | `string (date)` | Yesrequired | The date of the reversal. It is not before the entry and its month is not locked. |
| `reason` | `string` | Yesrequired | Why the entry is reversed. |

### 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, a type is wrong, or a reason is empty. `fields` names each one. | `Error` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this account or company, or `customerOrgId` or `legalCompanyId` in the body is not the one of the token. | `Error` |
| `404` | No journal entry with this id exists for your company. | `Error` |
| `409` | `operation_reused`: This `operationId` was already used for a different request. `reversal_conflict`: The entry already has a reversal, or it is itself a reversal. `period_closed`: The period of the date is locked, or there is no period for it. Nothing is posted into it. | `Error` |
| `422` | The reversal is dated before the entry it reverses. | `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/accounting/v1/journal-entries/c5a671de-e7b0-42b8-825d-d15c0612ff58/reversals" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
  "reversalDate": "2026-11-23",
  "reason": "Posted for the wrong supplier"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/journal-entries/c5a671de-e7b0-42b8-825d-d15c0612ff58/reversals`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
    "reversalDate": "2026-11-23",
    "reason": "Posted for the wrong supplier"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/accounting/v1/journal-entries/c5a671de-e7b0-42b8-825d-d15c0612ff58/reversals',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '7676e313-9d1f-42d0-a540-49efc794dfba',
        'reversalDate': '2026-11-23',
        'reason': 'Posted for the wrong supplier',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
  "reversalDate": "2026-11-23",
  "reason": "Posted for the wrong supplier"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/journal-entries/c5a671de-e7b0-42b8-825d-d15c0612ff58/reversals');
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")}/accounting/v1/journal-entries/c5a671de-e7b0-42b8-825d-d15c0612ff58/reversals");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
  "reversalDate": "2026-11-23",
  "reason": "Posted for the wrong supplier"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
  "status": "accepted",
  "aggregateId": "c5a671de-e7b0-42b8-825d-d15c0612ff58",
  "aggregateRevision": 2
}
```
