> For the complete documentation index, see [llms.txt](https://monicredit.gitbook.io/mc-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monicredit.gitbook.io/mc-api/collection/settlement-bank.md).

# Settlement Bank

At the end of the day, all transactions are gathered and routed to the settlement bank being the destination of all transactions according to the conflagrations set.

Create Settlement -

Endpoint : POST - {{baseUrl}}/v1/payment/settlement\_bank

In this case, the request is to add a new settlement bank through the API.

| Parameter         | Required | Description  |
| ----------------- | -------- | ------------ |
| title             | yes      | string       |
| account\_no       | yes      | string       |
| account\_name     | yes      | string       |
| bank\_code        | yes      | string       |
| bank\_name        | yes      | string       |
| display           | yes      | enum(yes,no) |
| settlement\_email | yes      | email        |

Example Request

```sh
curl -X POST \
  {{baseUrl}}/v1/payment/settlement_bank \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "testing",
    "account_no": "0000000",
    "account_name": "testing testing",
    "bank_code": "006",
    "bank_slug": "BNG",
    "bank_name": "required",
    "display": "YES",
    "settlement_email": "settlement@gmail.com"
  }'
```

Response

```json
{
    "status": true,
    "message": "settlement_bank.created",
    "data": {}
}
```

Fetch

Overview

Endpoint: GET - {{baseUrl}}/v1/payment/settlement\_bank

In this case, the request is to access/fetch all settlement banks through the API.

| Parameter            | Required | Description |
| -------------------- | -------- | ----------- |
| search               | no       | string      |
| settlement\_bank\_id | no       | string      |

Example Request

```sh
//A code snippet of how to consume the API

curl -X GET \
  {{baseUrl}}/v1/payment/settlement_bank \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN"
```

Response

```json
{
    "status": true,
    "message": "settlement_bank.view",
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1,
                "title": "test",
                "settle_bank": "Test",
                "merchant_id": "MC00000",
                "account_no": "000000000",
                "account_name": "Test Test",
                "bank_code": "GBN",
                "bank_slug": "BNG",
                "rev_status": "revhead",
                "created_at": "2022-04-23T15:00:10.000000Z",
                "updated_at": "2022-04-23T15:00:10.000000Z",
                "bank_name": "required",
                "display": "yes",
                "order_no": 0000,
                "settlement_email": test@test.ng
            }
        ],
        "first_page_url": "https://demo.backend.monicredit.com/api/v1/payment/settlement_bank?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://demo.backend.monicredit.com/api/v1/payment/settlement_bank?page=1",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://demo.backend.monicredit.com/api/v1/payment/settlement_bank?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "https://demo.backend.monicredit.com/api/v1/payment/settlement_bank",
        "per_page": 50,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
}
```

### Update

Overview

Endpoint: PUT - {{baseUrl}}/v1/payment/settlement-bank/:settlement\_id

In this case, the request is to update a settlement bank through the API.

| Parameter         | Required | Description |
| ----------------- | -------- | ----------- |
| title             | no       | string      |
| merchant\_id      | no       | string      |
| account\_no       | no       | string      |
| account\_name     | no       | string      |
| bank\_code        | no       | string      |
| bank\_slug        | no       | string      |
| bank\_name        | no       | string      |
| display           | no       | string      |
| settlement\_email | no       | string      |

Example Request

```sh
//A code snippet of how to consume the API

curl -X PUT \
  {{baseUrl}}/v1/payment/settlement-bank/:settlement_id \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "test",
    "merchant_id": "6545fdfdfJKDHHJ",
    "account_no": "000000",
    "account_name": "Test Test",
    "bank_code": "006",
    "bank_slug": "BNG",
    "bank_name": "required",
    "display": "yes",
    "settlement_email": "settle@gmail.com"
  }'
```

Response

```json
{
    "status": true,
    "message": "settlement_bank.updated",
    "data": {}
}
```
