# Reverse Transactions

This endpoint allows users to reverse a previously processed transaction. When making a request to this endpoint, provide the required body parameters which are the `referenceNumber`or `instrumentNumber`.<br>

<mark style="color:green;">`POST`</mark> `/api/postings/v1/reversetransaction`

**Headers**

| Name                                            | Value                |
| ----------------------------------------------- | -------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`   |
| Authorization<mark style="color:red;">\*</mark> | `Bearer <token>`     |
| Request-Reference                               | `{unique-reference}` |

**Body**

<table><thead><tr><th width="169">Name</th><th width="173">Data Type (length)</th><th width="100" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>referenceNumber</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(50)</em></a></td><td>true</td><td>The reference number for the transaction to be reversed</td></tr><tr><td><code>instrumentNumber</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(50)</em></a></td><td>true</td><td>The instrument number associated with the transaction</td></tr></tbody></table>

{% hint style="danger" %}
Ensure that you provide either the `referenceNumber` or the `instrumentNumber`.
{% endhint %}

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseurl}}/api/postings/v1/reversetransaction' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "referenceNumber": "string",
  "instrumentNumber": "string"
}'
```

</details>

<details>

<summary>Respose: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string",
  "data": {
    "statusCode": "string",
    "referenceNumber": "string",
    "instrumentNumber": "string",
    "duration": "string"
  }
}
```

</details>

[^1]: This is the maximum number of characters allowed.
