# New Features

## Transaction Reversal

<mark style="color:green;">`POST`</mark> `/trans/txReversal`

This endpoint allows end users to request for a reversal for a transaction.

**Parameters**

<table data-full-width="false"><thead><tr><th width="181.7999267578125">Parameters</th><th width="86.199951171875">Type</th><th width="386.2000732421875">Description</th><th>Is Required</th></tr></thead><tbody><tr><td><code>transactionId</code></td><td>string</td><td><p>The unique string generated by BaaS platform to identify a transaction. </p><p>It has to be in the last 1 month. The transaction completed over 1 month ago cannot be reversed.</p></td><td>TRUE</td></tr><tr><td><code>reversalReceiptNo</code></td><td>string</td><td>If the transaction has been reversed already from third party institutions (i.e. M-PESA), end users should fill in the receipt number of the reversal transaction (The new transaction created to counter-effect the original one)</td><td>FALSE</td></tr><tr><td><code>reversedTime</code></td><td>string</td><td>If the transaction has been reversed already from third party institutions (i.e. M-PESA), end users should fill in the reversed time of the new reversal transaction</td><td>FALSE</td></tr><tr><td><code>reversalReason</code></td><td>string</td><td>Reversal reason</td><td>FALSE</td></tr><tr><td><code>voucherBase64</code></td><td>string</td><td>Voucher document</td><td>FALSE</td></tr><tr><td><code>voucherType</code></td><td>string</td><td><p>pdf </p><p>image</p></td><td>FALSE</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="00000" %}

```json
{
  "applicationId": "",
}
```

{% endtab %}
{% endtabs %}

### Query Reversal Request Details&#x20;

<mark style="color:green;">`POST`</mark> `/trans/queryTxReversal`

Use this endpoint to fetch reversal request details.&#x20;

**Parameters**

<table data-full-width="false"><thead><tr><th width="219">Parameters</th><th width="83">Type</th><th width="307">Description</th><th>Required?</th></tr></thead><tbody><tr><td><code>applicationId</code></td><td>string</td><td>The unique string generated by BaaS platform to identify the application</td><td>TRUE</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="00000" %}

```json
{
  "applicationId": "",
  "transactionId": "",
  "reversalReceiptNo": "",
  "reversedTime": "",
  "reversalReason": "",
  "voucher": "",
  "status": "",
  "reversalTxId": ""
}
```

{% endtab %}
{% endtabs %}

## Validate Account (Hakikisha)

<mark style="color:green;">`POST`</mark> `/account/validateAccount`

\<This endpoint allows end users to validate account's name before making the transfer.>

<table data-full-width="false"><thead><tr><th width="127.39990234375">Parameters</th><th width="83">Type</th><th width="412.466796875">Description</th><th>Required?</th></tr></thead><tbody><tr><td><code>accountId</code></td><td>string</td><td>The account/shortcode which the user wants to validate. <br><br>This endpoint does return "freezeStatus" and "restrictStatus" as well.</td><td>TRUE</td></tr><tr><td><code>accountType</code></td><td>int</td><td><p>The type of the counterparty account: <br><br>0 - <strong>Choice Merchant</strong> </p><p>1 - <strong>M-PESA Paybill</strong></p><p>2 - <strong>M-PESA Till</strong></p><p>3 - <strong>Mpesa Mobile</strong></p><p>4 - <strong>Pesalink Account Number</strong></p></td><td>TRUE</td></tr><tr><td><code>bankCode</code></td><td>string</td><td><p>See full list by calling <code>/staticData/getBankCodes</code></p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Mandatory when <code>accountType</code> is 4</p></div></td><td>Conditional</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="00000" %}

```json
"data": {
    "accountType": "", //int, account type
    "accountId": "", //String, account Id
    "accountName": "", //String, return the account name if it's a valid accountId
    "freezeStatus":"", //freezeStatus: 0-normal; 1-frozen
    "restrictStatus":"",//restrict status 0-normal; 1-restrict in; 2-restrict out
}
```

{% endtab %}
{% endtabs %}

## Pull Transaction IDs

<mark style="color:green;">`POST`</mark>  `/query/pullTransactionIds`

This API is for BaaS partners to get all transaction IDs within a certain period of time so that they do not miss any inbound transactions when balance change notifications / callback is not received.

{% hint style="info" %}
Allowed query data timespan: past 30 days\
Allowed query interval: 1 hour\
Maximum `endTime` to  `startTime` span: 4 hours
{% endhint %}

<table><thead><tr><th width="112.7999267578125">Fields</th><th width="124.5999755859375">Type</th><th>Description</th><th>Required?</th></tr></thead><tbody><tr><td><code>startTime</code></td><td>Long</td><td>Unix timestamp of the start time</td><td>Mandatory</td></tr><tr><td><code>endTime</code></td><td>Long</td><td>Unix timestamp of the end time</td><td>Mandatory</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="00000" %}

```json
{
  "transactionID": "00000" //returns list of transaction IDs
}
```

{% endtab %}
{% endtabs %}

## Query Channel Closing Balance

<mark style="color:green;">`POST`</mark> `/report/queryClosingBalance`

Use this endpoint to fetch the consolidated balance across all accounts under your BaaS channel on a certain date.&#x20;

**Parameters**

<table data-full-width="false"><thead><tr><th width="219">Parameters</th><th width="83">Type</th><th width="307">Description</th><th>Is Required</th></tr></thead><tbody><tr><td><code>queryDate</code></td><td>string</td><td>UTC date as at which the closing balance is being sought.</td><td>TRUE</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="00000" %}

```json
{
  "jobId": "",
}
```

{% endtab %}
{% endtabs %}

**Result**

Please refer to [0015-File Job Notification](https://choice-bank.gitbook.io/choice-bank/notifications/callback-configuration#id-0015-account-statement-notification)&#x20;
