> 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/transactions/get-transactions.md).

# Get Transactions

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

```javascript
//A code snippet on 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("https://demo.backend.monicredit.com/api/v1/payment/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 on how to consume the API
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.backend.monicredit.com/api/v1/payment/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 %}

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

This API allows you to retrieve a list of payment transactions from the Monicredit platform.

#### Headers

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

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": "ACX000000000",
            "amount": 0000,
            "status": "CANCELLED",
            "channel": "TRANSFER",
            "charges": 000,
            "customer": {
                "id": "CUS00000000",
                "first_name": "Test",
                "last_name": "Test",
                "full_name": "Test Test",
                "phone": "0000000",
                "email": "test@test.com",
                "merchant": null,
                "created_at": "2022-11-21T21:15:29.000000Z"
            },
            "date_paid": "2022-12-17 09:08:08",
            "auto_id": null,
            "transaction_id": "ACX000000",
            "order_id": "ORD00000",
            "settlement": "FALSE",
            "merchant_id": "TEST",
            "revenue_head_id": null,
            "reconcilation": "FALSE",
            "invoice_amount": 0000,
            "transaction_type": "SINGLE",
            "meta_data": null,
            "vbank_data": null,
            "used": null,
            "amount_paid": null,
            "items": "[{\"item\":\"MAIN-REV\",\"revenue_head_code\":\"REV0000\",\"unit_cost\":\"0000\",\"split_details\":[{\"sub_account_code\":\"SB00000\",\"fee_percentage\":000,\"fee_flat\":0}]}]"
        },
        
    ],
    "links": {
        "first": "http://demo.monicredit.com/api/v1/payment/transactions?page=1",
        "last": "http://demo.monicredit.com/api/v1/payment/transactions?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://demo.monicredit2.test/api/v1/payment/transactions?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "http://demo.monicredit.com/api/v1/payment/transactions",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://monicredit.gitbook.io/mc-api/transactions/get-transactions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
