# GET /invoices — List All Invoices

> Product: **Pabbly Subscription Billing** (v1)
> Base URL: `https://payments.pabbly.com/api/v1`
> Auth: Basic via `Authorization` header
> Canonical: `/subscription-billing/invoice/list-all-invoices`

This API is used to retrieve a list of all the available invoices.

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| limit | string | No | Integer, default=10, min=1, max=100 The number of resources to be returned. |
| page | string | No | By default first page will be listed. For navigating through pages, use the page parameter. |
| product_id | string | No | Uniquely identifies the product. It is the api identifier for the product. |
| start_date | string | No | Format: yyyy-mm-dd |
| end_date | string | No | Format: yyyy-mm-dd |
| query_filter | string | No | Incase you want to add filter in api response. |

**Response (200)** — List All Invoices:

```json
{
    "status": "success",
    "message": "Invoice details",
    "data": [
        {
            "customer_id": "63b7d8df6d3278260497146e",
            "status": "sent",
            "quantity": 1,
            "due_amount": 100,
            "payment_term": "custom",
            "subscription_id": "63ca9485ad508a2c18ffc9b9",
            "subscription": {
                "plan": {
                    "plan_type": "flat_fee",
                    "plan_active": "true",
                    "currency_code": "USD",
                    "currency_symbol": "$",
                    "custom_payment_term": 10,
                    "createdAt": "2023-01-20T13:17:37.801Z",
                    "updatedAt": "2023-01-20T13:17:37.801Z",
                    "id": "63ca9471ad508a2c18ffc9b8",
                    "product_id": "611e50190d18507650f6f695",
                    "plan_name": "Custom Payment Term Recurring",
                    "plan_code": "custom-payment-term-recurring",
                    "price": 100,
                    "billing_period": "m",
                    "billing_period_num": "1",
                    "billing_cycle": "lifetime",
                    "billing_cycle_num": null,
                    "trial_period": 0,
                    "setup_fee": 0,
                    "plan_description": "<p>This is the test plan description.</p><p><br></p><p><img src=\"https://s3psb.pabbly.com/product/images/2022/2/Y9fZRFgdHKIR-1643959680-PlandescriptionImage.png\"></p><p><br></p><p>From the checkout customizer,</p><p><br></p><ul><li>You can change the bullet type.</li><li>You can change list style.</li><li>You can change text size</li><li>You can change the bullet color.</li><li>Image size should be 400W x 250H, Max Size - 100kb.</li></ul><p><br></p>"
                },
                "setup_fee": 0,
                "currency_code": "USD",
                "currency_symbol": "$",
                "payment_method": "63ca9489ad508a2c18ffc9bc",
                "taxable": true,
                "gateway_type": "test",
                "payment_terms": "custom",
                "gateway_id": "611e4ffd0d18507650f6f694",
                "gateway_name": "Test Gateway",
                "custom_fields": [],
                "requested_ip": "::1",
                "createdAt": "2023-01-20T13:17:57.468Z",
                "updatedAt": "2023-01-20T13:18:51.029Z",
                "id": "63ca9485ad508a2c18ffc9b9",
                "customer_id": "63b7d8df6d3278260497146e",
                "product_id": "611e50190d18507650f6f695",
                "plan_id": "63ca9471ad508a2c18ffc9b8",
                "amount": 100,
                "email_id": "test@inboxkitten.com",
                "status": "live",
                "quantity": 1,
                "starts_at": "2023-01-20T13:17:57.575Z",
                "activation_date": "2023-01-20T13:18:02.022Z",
                "expiry_date": "2123-01-20T13:17:57.575Z",
                "trial_days": 0,
                "trial_expiry_date": "",
                "next_billing_date": "",
                "last_billing_date": "2023-01-20T13:18:02.022Z",
                "canceled_date": null
            },
            "product_id": "611e50190d18507650f6f695",
            "setup_fee": 0,
            "currency_symbol": "$",
            "currency_code": "USD",
            "credit_note": {
                "total_tax": "0.00",
                "status": "success",
                "new_plan_total": 100,
                "total_credit_amount": 0,
                "charge_amount": 100,
                "credit_applied": []
            },
            "due_date": "2023-03-02T13:18:02.022Z",
            "amount": 100,
            "invoice_id": "INV-877",
            "createdAt": "2023-02-20T13:18:02.022Z",
            "updatedAt": "2023-01-20T13:18:51.465Z",
            "id": "63ca94b9ad508a2c18ffc9be",
            "invoice_link": "https://payments.pabbly.com/secureinvoice/611e4a4d0d18507650f6f691/?cinvoice_id=38dc8202bd1c250b60f8a3faf3dc7013:e58ffc61246c6c56538f4b699d5384890be0e480cf25f27bd4e869e95b957348874ad6e812e383a9ce63894f1bba03a6bf903919e5e9478acce39c1f9a2ff01dfd2018caa0eb50881eccaf09f10e5755"
        },
        {
            "customer_id": "63b7d8df6d3278260497146e",
            "status": "sent",
            "quantity": 1,
            "due_amount": 100,
            "payment_term": "custom",
            "subscription_id": "63ca9485ad508a2c18ffc9b9",
            "subscription": {
                "plan": {
                    "plan_type": "flat_fee",
                    "plan_active": "true",
                    "currency_code": "USD",
                    "currency_symbol": "$",
                    "custom_payment_term": 10,
                    "createdAt": "2023-01-20T13:17:37.801Z",
                    "updatedAt": "2023-01-20T13:17:37.801Z",
                    "id": "63ca9471ad508a2c18ffc9b8",
                    "product_id": "611e50190d18507650f6f695",
                    "plan_name": "Custom Payment Term Recurring",
                    "plan_code": "custom-payment-term-recurring",
                    "price": 100,
                    "billing_period": "m",
                    "billing_period_num": "1",
                    "billing_cycle": "lifetime",
                    "billing_cycle_num": null,
                    "trial_period": 0,
                    "setup_fee": 0,
                    "plan_description": "<p>This is the test plan description.</p><p><br></p><p><img src=\"https://s3psb.pabbly.com/product/images/2022/2/Y9fZRFgdHKIR-1643959680-PlandescriptionImage.png\"></p><p><br></p><p>From the checkout customizer,</p><p><br></p><ul><li>You can change the bullet type.</li><li>You can change list style.</li><li>You can change text size</li><li>You can change the bullet color.</li><li>Image size should be 400W x 250H, Max Size - 100kb.</li></ul><p><br></p>"
                },
                "setup_fee": 0,
                "currency_code": "USD",
                "currency_symbol": "$",
                "payment_method": "63ca9489ad508a2c18ffc9bc",
                "taxable": true,
                "gateway_type": "test",
                "payment_terms": "custom",
                "gateway_id": "611e4ffd0d18507650f6f694",
                "gateway_name": "Test Gateway",
                "custom_fields": [],
                "requested_ip": "::1",
                "createdAt": "2023-01-20T13:17:57.468Z",
                "updatedAt": "2023-01-20T13:24:25.969Z",
                "id": "63ca9485ad508a2c18ffc9b9",
                "customer_id": "63b7d8df6d3278260497146e",
                "product_id": "611e50190d18507650f6f695",
                "plan_id": "63ca9471ad508a2c18ffc9b8",
                "amount": 100,
                "email_id": "test@inboxkitten.com",
                "status": "live",
                "quantity": 1,
                "starts_at": "2023-01-20T13:17:57.575Z",
                "activation_date": "2023-01-20T13:18:02.022Z",
                "expiry_date": "2123-01-20T13:17:57.575Z",
                "trial_days": 0,
                "trial_expiry_date": "",
                "next_billing_date": "",
                "last_billing_date": "2023-01-20T13:18:02.022Z",
                "canceled_date": null
            },
            "product_id": "611e50190d18507650f6f695",
            "setup_fee": 0,
            "currency_symbol": "$",
            "currency_code": "USD",
            "credit_note": {
                "total_tax": "0.00",
                "status": "success",
                "new_plan_total": 100,
                "total_credit_amount": 0,
                "charge_amount": 100,
                "credit_applied": []
            },
            "due_date": "2023-01-30T13:24:23.232Z",
            "amount": 100,
            "invoice_id": "INV-879",
            "createdAt": "2023-01-20T13:24:24.809Z",
            "updatedAt": "2023-01-20T13:24:26.370Z",
            "id": "63ca9608918b160d84658c20",
            "invoice_link": "https://payments.pabbly.com/secureinvoice/611e4a4d0d18507650f6f691/?cinvoice_id=608a459d38772243daacc153b9a6a9ba:a59759d95f0689f131b59d6b95626c7368c65e6f3d2253067d64b88eedbec5a8f18d4185b2d0abf6a2bafec5d3373e88216edcc8f1ae99a7d0c1adc81b29c8503d21057bd933e29c8f6f3d0b084a18de"
        },
        {
            "customer_id": "63b7d8df6d3278260497146e",
            "status": "sent",
            "quantity": 1,
            "due_amount": 100,
            "payment_term": "custom",
            "subscription_id": "63ca9485ad508a2c18ffc9b9",
            "subscription": {
                "plan": {
                    "plan_type": "flat_fee",
                    "plan_active": "true",
                    "currency_code": "USD",
                    "currency_symbol": "$",
                    "custom_payment_term": 10,
                    "createdAt": "2023-01-20T13:17:37.801Z",
                    "updatedAt": "2023-01-20T13:17:37.801Z",
                    "id": "63ca9471ad508a2c18ffc9b8",
                    "product_id": "611e50190d18507650f6f695",
                    "plan_name": "Custom Payment Term Recurring",
                    "plan_code": "custom-payment-term-recurring",
                    "price": 100,
                    "billing_period": "m",
                    "billing_period_num": "1",
                    "billing_cycle": "lifetime",
                    "billing_cycle_num": null,
                    "trial_period": 0,
                    "setup_fee": 0,
                    "plan_description": "<p>This is the test plan description.</p><p><br></p><p><img src=\"https://s3psb.pabbly.com/product/images/2022/2/Y9fZRFgdHKIR-1643959680-PlandescriptionImage.png\"></p><p><br></p><p>From the checkout customizer,</p><p><br></p><ul><li>You can change the bullet type.</li><li>You can change list style.</li><li>You can change text size</li><li>You can change the bullet color.</li><li>Image size should be 400W x 250H, Max Size - 100kb.</li></ul><p><br></p>"
                },
                "setup_fee": 0,
                "currency_code": "USD",
                "currency_symbol": "$",
                "payment_method": "63ca9489ad508a2c18ffc9bc",
                "taxable": true,
                "gateway_type": "test",
                "payment_terms": "custom",
                "gateway_id": "611e4ffd0d18507650f6f694",
                "gateway_name": "Test Gateway",
                "custom_fields": [],
                "requested_ip": "::1",
                "createdAt": "2023-01-20T13:17:57.468Z",
                "updatedAt": "2023-01-20T13:23:15.981Z",
                "id": "63ca9485ad508a2c18ffc9b9",
                "customer_id": "63b7d8df6d3278260497146e",
                "product_id": "611e50190d18507650f6f695",
                "plan_id": "63ca9471ad508a2c18ffc9b8",
                "amount": 100,
                "email_id": "test@inboxkitten.com",
                "status": "live",
                "quantity": 1,
                "starts_at": "2023-01-20T13:17:57.575Z",
                "activation_date": "2023-01-20T13:18:02.022Z",
                "expiry_date": "2123-01-20T13:17:57.575Z",
                "trial_days": 0,
                "trial_expiry_date": "",
                "next_billing_date": "",
                "last_billing_date": "2023-01-20T13:18:02.022Z",
                "canceled_date": null
            },
            "product_id": "611e50190d18507650f6f695",
            "setup_fee": 0,
            "currency_symbol": "$",
            "currency_code": "USD",
            "credit_note": {
                "total_tax": "0.00",
                "status": "success",
                "new_plan_total": 100,
                "total_credit_amount": 0,
                "charge_amount": 100,
                "credit_applied": []
            },
            "due_date": "2023-01-30T13:21:37.373Z",
            "amount": 100,
            "invoice_id": "INV-878",
            "createdAt": "2023-01-20T13:21:38.043Z",
            "updatedAt": "2023-01-20T13:23:16.427Z",
            "id": "63ca957bad508a2c18ffc9c1",
            "invoice_link": "https://payments.pabbly.com/secureinvoice/611e4a4d0d18507650f6f691/?cinvoice_id=6a2d052d4912d53e68bd92073ef70532:cf5d733bf048e71362eee451bf5ea6625633b53a70685b2ce30a36bea3270a27cb307b493cf14633f337f8f771c4275355bc26d87873e3a98b7bdc73d445bd65927861b180e4c56c737f4a6be2ac960b"
        }
    ]
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}} \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}')
request = Net::HTTP::Get.new(uri)
request.basic_auth '{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, '{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}');

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

String credentials = Base64.getEncoder().encodeToString("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}".getBytes());

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}"))
    .header("Authorization", "Basic " + credentials)
    .GET();

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const credentials = Buffer.from('{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}').toString('base64');

const response = await fetch('https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}', {
  method: 'GET',
  headers: {
    'Authorization': `Basic ${credentials}`,
  },
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}", nil)
    req.SetBasicAuth("{{YOUR_API_KEY}}", "{{YOUR_SECRET_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}"));

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://payments.pabbly.com/api/v1/invoices?limit={{limit}}&page={{page}}&product_id={{product_id}}&start_date={{start_date}}&end_date={{end_date}}&query_filter={{query_filter}}");
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {credentials}");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

---

**Other endpoints in Invoice:**

- [GET /invoice/{{invoice_id}} — Get Single Invoice](/subscription-billing/invoice/get-single-invoice)
- [GET /invoices/transactions/{{invoice_id}} — List All Transactions By Invoice Id](/subscription-billing/invoice/list-all-transactions-by-invoice-id)
- [GET /invoices/{{customer_id}} — List All Invoices By Customer Id](/subscription-billing/invoice/list-all-invoices-by-customer-id)
- [POST /invoice/recordpayment/{{invoice_id}} — Record Payment Invoice](/subscription-billing/invoice/record-payment-invoice)
- [POST /invoice/failedpayment/{{invoice_id}} — Record Failed Payment Invoice](/subscription-billing/invoice/record-failed-payment-invoice)
- [DELETE /invoices/{{invoice_id}} — Delete Invoice](/subscription-billing/invoice/delete-invoice)
- [POST /invoices/create-metered/{{subscription_id}} — Create Metered Invoice](/subscription-billing/invoice/create-metered-invoice)

