> For the complete documentation index, see [llms.txt](https://edrus.gitbook.io/appgregator-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edrus.gitbook.io/appgregator-api-docs/appgregators/payment-gateway/xendit-indonesia-final-version/api/invoices/list-all-invoices.md).

# List All Invoices

You can list all invoices, or list the invoices for a specific updated time. The invoices are returned sorted by created date, with the most recently created invoices appearing first.

### Attributes

<table><thead><tr><th>Attributes</th><th width="150">Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>external_id</td><td>string</td><td>The external id used during generation of invoice. Given that external_id is non-unique, by including external_id, it will return all invoices with that specific external_id.</td><td></td></tr><tr><td>statuses</td><td>array of strings</td><td><p>Indicates the status of the invoices that will be available in the list. It contains PENDING, PAID, SETTLED, EXPIRED. </p><p></p><p>example : ["SETTLED","EXPIRED"]</p></td><td></td></tr><tr><td>limit</td><td>number</td><td>A limit on the number of invoice objects to be returned. Limit can range between 1 and 100.</td><td></td></tr><tr><td>created_after</td><td>string (ISO 8601)</td><td><p>Return invoices where the <code>created</code> field is greater than this value. Both <code>created_after</code> and <code>created_before</code> field should be used in the same time for the filter to take effect. </p><p></p><p></p><p>Example : </p><pre><code>2016-02-24T23:48:36.697Z
</code></pre></td><td></td></tr><tr><td>created_before</td><td>string (ISO 8601)</td><td><p>Return invoices where the <code>created</code> field is less than this value.<br>Both <code>created_after</code> and <code>created_before</code> field should be used in the same time for the filter to take effect. </p><p></p><p></p><p>Example : </p><pre><code>2016-02-24T23:48:36.697Z
</code></pre></td><td></td></tr><tr><td>paid_after</td><td>string (ISO 8601)</td><td><p>Return invoices where the <code>paid_at</code> field is greater than this value.<br>Both <code>paid_after</code> and <code>paid_before</code> field should be used in the same time for the filter to take effect. </p><p></p><p></p><p>Example : </p><pre><code>2016-02-24T23:48:36.697Z
</code></pre></td><td></td></tr><tr><td>paid_before</td><td>string (ISO 8601)</td><td><p>Return invoices where the <code>paid_at</code> field is less than this value.<br>Both <code>paid_after</code> and <code>paid_before</code> field should be used in the same time for the filter to take effect. </p><p></p><p></p><p>Example : </p><pre><code>2016-02-24T23:48:36.697Z
</code></pre></td><td></td></tr><tr><td>expired_after</td><td>string (ISO 8601)</td><td><p>Return invoices where the <code>expiry_date</code> field is less than this value.<br>Both <code>expired_after</code> and <code>expired_before</code> field should be used in the same time for the filter to take effect. </p><p></p><p></p><p>Example : </p><pre><code>2016-02-24T23:48:36.697Z
</code></pre></td><td></td></tr><tr><td>last_invoice_id</td><td>string</td><td>A cursor for use in pagination.<br><code>last_invoice_id</code> is an invoice ID that defines your starting point for the list. For instance, if you make a list request and receive 10 objects, starting with <code>obj_bar</code>, your subsequent call can include <code>last_invoice_id</code>=<code>obj_bar</code> in order to fetch the previous page of the list.</td><td></td></tr><tr><td>client_types</td><td>array of strings</td><td><p>Indicates the method used to create the invoice. It contains:<br><code>API_GATEWAY</code> Invoice created via create invoice API<br><code>DASHBOARD</code> Invoice created via dashboard<br><code>INTEGRATION</code> Invoice created via 3rd party integration such as Shopify and Woocommerce<br><code>ON_DEMAND</code> Invoice created via On Demand<br><code>RECURRING</code> Invoice created via Recurring Payment<br><code>MOBILE</code> Invoice created via Mobile App. </p><p></p><p></p><p></p><p>example : </p><pre><code>["DASHBOARD","API_GATEWAY"]
</code></pre></td><td></td></tr><tr><td>payment_channels</td><td>array of strings</td><td>Indicates the channels used to pay the invoice.</td><td></td></tr><tr><td>on_demand_link</td><td>string</td><td>The link for the specific on demand. If you input on_demand_link, it will return invoices that created from that specific on demand link.</td><td></td></tr><tr><td>recurring_payment_id</td><td>string</td><td>The recurring payment id for specific recurring payment, it will return invoices that created from that specific recurring payment id.</td><td></td></tr></tbody></table>

<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/xendit/invoices/`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | U2Fsd...    |

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

```javascript
[
    {
        "id": "62f094097098f7678f55fc3f",
        "external_id": "INV0055/VIII/2022",
        "user_id": "6279ce4495d10c9afc3171b8",
        "payment_method": "BANK_TRANSFER",
        "status": "SETTLED",
        "merchant_name": "aplikasi keuangan",
        "merchant_profile_picture_url": "https://du8nwjtfkinx.cloudfront.net/xendit.png",
        "amount": 8500000,
        "paid_amount": 8500000,
        "bank_code": "MANDIRI",
        "paid_at": "2022-08-08T04:42:11.099Z",
        "description": "Invoice Demo #INV0055",
        "expiry_date": "2022-08-09T04:41:45.227Z",
        "invoice_url": "https://checkout-staging.xendit.co/web/62f094097098f7678f55fc3f",
        "available_banks": [
            {
                "bank_code": "MANDIRI",
                "collection_type": "POOL",
                "bank_account_number": "8860874135163",
                "transfer_amount": 8500000,
                "bank_branch": "Virtual Account",
                "account_holder_name": "APLIKASI KEUANGAN",
                "identity_amount": 0
            },
            {
                "bank_code": "BRI",
                "collection_type": "POOL",
                "transfer_amount": 8500000,
                "bank_branch": "Virtual Account",
                "account_holder_name": "APLIKASI KEUANGAN",
                "identity_amount": 0
            },
            {
                "bank_code": "BNI",
                "collection_type": "POOL",
                "transfer_amount": 8500000,
                "bank_branch": "Virtual Account",
                "account_holder_name": "APLIKASI KEUANGAN",
                "identity_amount": 0
            },
            {
                "bank_code": "PERMATA",
                "collection_type": "POOL",
                "transfer_amount": 8500000,
                "bank_branch": "Virtual Account",
                "account_holder_name": "APLIKASI KEUANGAN",
                "identity_amount": 0
            },
            {
                "bank_code": "BCA",
                "collection_type": "POOL",
                "transfer_amount": 8500000,
                "bank_branch": "Virtual Account",
                "account_holder_name": "APLIKASI KEUANGAN",
                "identity_amount": 0
            }
        ],
        "available_retail_outlets": [
            {
                "retail_outlet_name": "ALFAMART"
            },
            {
                "retail_outlet_name": "INDOMARET"
            }
        ],
        "available_ewallets": [
            {
                "ewallet_type": "OVO"
            },
            {
                "ewallet_type": "DANA"
            },
            {
                "ewallet_type": "SHOPEEPAY"
            },
            {
                "ewallet_type": "LINKAJA"
            }
        ],
        "available_direct_debits": [
            {
                "direct_debit_type": "DD_BRI"
            }
        ],
        "available_paylaters": [],
        "should_exclude_credit_card": false,
        "adjusted_received_amount": 8495005,
        "should_send_email": false,
        "success_redirect_url": "https://projeq.id/?status=success&external_id=INV0035/VIII/2022",
        "failure_redirect_url": "https://projeq.id/?status=failure&external_id=INV0035/VIII/2022",
        "created": "2022-08-08T04:41:46.049Z",
        "updated": "2022-08-08T04:42:11.411Z",
        "currency": "IDR",
        "initial_amount": 8500000,
        "payment_channel": "MANDIRI",
        "payment_destination": "8860874135163",
        "customer": {
            "given_names": "John",
            "surname": "Doe",
            "email": "johndoe@example.com",
            "mobile_number": "+6287774441111",
            "addresses": [
                {
                    "city": "Jakarta Selatan",
                    "country": "Indonesia",
                    "postal_code": "12345",
                    "state": "Daerah Khusus Ibukota Jakarta",
                    "street_line1": "Jalan Makan",
                    "street_line2": "Kecamatan Kebayoran Baru"
                }
            ]
        }
    }
]
```

{% endtab %}
{% endtabs %}

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

```shell
curl --location -g --request GET 'https://us-central1-appgregator.cloudfunctions.net/xendit/invoices?name=ft-4&connection_name=xendit-sanbox-1&limit=1&statuses=["SETTLED","EXPIRED"]' \
--header 'x-api-key: U2Fsd...'
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/xendit/invoices?name=ft-4&connection_name=xendit-sanbox-1&limit=1&statuses=["SETTLED","EXPIRED"]',
  headers: { 
    'x-api-key': 'U2Fsd...'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/xendit/invoices?name=ft-4&connection_name=xendit-sanbox-1&limit=1&statuses=%5B%22SETTLED%22,%22EXPIRED%22%5D',
  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(
    'x-api-key: U2FsdG...'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% 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:

```
GET https://edrus.gitbook.io/appgregator-api-docs/appgregators/payment-gateway/xendit-indonesia-final-version/api/invoices/list-all-invoices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
