# Settlement Transactions

{% tabs %}
{% tab title="JavaScript" %}
```javascript
//A code snippet of how to consume the API

var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2RlbW8ubW9uaWNyZWRpdC5jb20vYXBpL3YxL2NvcmUvYXV0aC9sb2dpbiIsImlhdCI6MTY2ODk2NzQ0MywiZXhwIjoxNjY4OTcxMDQzLCJuYmYiOjE2Njg5Njc0NDMsImp0aSI6ImF0UE9GVHE4cU4yN2lBWlciLCJzdWIiOiJVU0FETUlOIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.shrbQUV29vXRF30qMeBN3zxlc5JXd03QyMeD6ekzudU");

var raw = "";

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("http://demo.monicredit2.test//payment/transactions/settlement-transactions", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
{% endtab %}

{% tab title="PHP" %}
```php
//A code snippet of how to consume the API

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://demo.monicredit2.test//payment/transactions/settlement-transactions',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2RlbW8ubW9uaWNyZWRpdC5jb20vYXBpL3YxL2NvcmUvYXV0aC9sb2dpbiIsImlhdCI6MTY2ODk2NzQ0MywiZXhwIjoxNjY4OTcxMDQzLCJuYmYiOjE2Njg5Njc0NDMsImp0aSI6ImF0UE9GVHE4cU4yN2lBWlciLCJzdWIiOiJVU0FETUlOIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.shrbQUV29vXRF30qMeBN3zxlc5JXd03QyMeD6ekzudU'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="First Tab" %}

{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}

<mark style="color:blue;">`GET`</mark> `{{BaseURL}}/payment/transactions/settlement-transactions`

#### Query Parameters

| Name                 | Type   | Description |
| -------------------- | ------ | ----------- |
| settlement\_id       | String | S00000000   |
| revenue\_head\_id    | String | REV000000   |
| search               | String | name        |
| settlement\_bank\_id | String | SB0000000   |

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | \{{bearer\_toke\}} |

{% tabs %}
{% tab title="200: OK " %}
```json
{
    "data": [
        {
            "id": 00
            "amount": 00,
            "status": "PENDING",
            "channel": "CARD",
            "charges": 000,
            "customer": {
                "id": "CUS0000",
                "first_name": "Rodrigo",
                "last_name": "Greenholt",
                "full_name": "Rodrigo Greenholt",
                "phone": "0000",
                "email": "test@test.com",
                "merchant": null,
                "created_at": "2022-06-27T14:36:47.000000Z"
            },
            "date_paid": "2022-06-27 15:36:57",
            "auto_id": null,
            "transaction_id": ACX000,
            "order_id": "ORD00000",
            "settlement": 0,
            "merchant_id": "TEST",
            "revenue_head_id": "REV000000",
            "reconcilation": "TRUE",
            "invoice_amount": 0000,
            "transaction_type": "BULK",
            "meta_data": null,
            "vbank_data": null,
            "used": null,
            "amount_paid": 00000,
            "items": "[{\"revenue_head_code\":\"REV000000\",\"name\":\"maiores\",\"unit_cost\":00000,\"split_details\":[{\"sub_account_code\":\"SB000000\",\"fee_percentage\":100,\"fee_flat\":0}]},{\"revenue_head_code\":\"REV00000000\",\"name\":\"quia\",\"unit_cost\":000,\"split_details\":[{\"sub_account_code\":\"SB000000\",\"fee_percentage\":000,\"fee_flat\":0}]}]"
        }
    ],
    "links": {
        "first": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=1",
        "last": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=100",
        "prev": null,
        "next": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 100,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=6",
                "label": "6",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=7",
                "label": "7",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=8",
                "label": "8",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=9",
                "label": "9",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=10",
                "label": "10",
                "active": false
            },
            {
                "url": null,
                "label": "...",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=99",
                "label": "99",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=100",
                "label": "100",
                "active": false
            },
            {
                "url": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions?page=2",
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://demo.monicredit2.test/api/v1/payment/transactions/settlement-transactions",
        "per_page": 10,
        "to": 10,
        "total": 1000
    }
}
```
{% endtab %}
{% endtabs %}
