# GET /customers — List All Customers

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

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

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| limit | string | No | optional, integer, default=50, 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. |

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

```json
{
    "status": "success",
    "message": "Customers data",
    "data": [
        {
            "billing_address": {
                "street1": "Klarna-Straße 1/2/3",
                "city": "Hausmannstätten",
                "state": "",
                "state_code": "",
                "zip_code": "8071",
                "country": ""
            },
            "shipping_address": {
                "street1": "",
                "city": "",
                "state": "",
                "state_code": "",
                "zip_code": "",
                "country": ""
            },
            "createdAt": "2023-04-06T05:40:30.862Z",
            "updatedAt": "2023-04-06T05:40:30.862Z",
            "id": "642e5b4ee4a22805885ce822",
            "first_name": "Pabbly",
            "last_name": "Test",
            "email_id": "user-at@example.com"
        },
        {
            "billing_address": {
                "street1": "",
                "city": "",
                "state": "",
                "state_code": "",
                "zip_code": "",
                "country": ""
            },
            "shipping_address": {
                "street1": "",
                "city": "",
                "state": "",
                "state_code": "",
                "zip_code": "",
                "country": ""
            },
            "createdAt": "2023-04-06T05:35:07.149Z",
            "updatedAt": "2023-04-06T05:35:07.149Z",
            "id": "642e5a0b1b452e1a18fe4fec",
            "first_name": "Pabbly",
            "last_name": "Test",
            "email_id": "pabbly@inboxkitten.com"
        }
    ]
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/customers?limit={{limit}}&page={{page}} \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}
```

_Ruby_

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

uri = URI('https://payments.pabbly.com/api/v1/customers?limit={{limit}}&page={{page}}')
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/customers?limit={{limit}}&page={{page}}',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/customers?limit={{limit}}&page={{page}}');
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/customers?limit={{limit}}&page={{page}}"))
    .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/customers?limit={{limit}}&page={{page}}', {
  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/customers?limit={{limit}}&page={{page}}", 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/customers?limit={{limit}}&page={{page}}");
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {credentials}");

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

---

**Other endpoints in Customers:**

- [GET /customer/{{customer_id}} — Get Single Customer via Customer ID](/subscription-billing/customers/get-single-customer-via-customer-id)
- [GET /customer/ — Get Single Customer via Customer Email](/subscription-billing/customers/get-single-customer-via-customer-email)
- [GET /customer/purchase-info/{{customer_id}} — Get Customer Purchase Information](/subscription-billing/customers/get-customer-purchase-information)
- [PUT /customer/{{customer_id}} — Update Customer Detail](/subscription-billing/customers/update-customer-detail)
- [POST /subscription — Create Customer With Subscription](/subscription-billing/customers/create-customer-with-subscription)
- [DELETE /customers/{{customer_id}} — Delete Customer](/subscription-billing/customers/delete-customer)
- [POST /customer — Create Customer](/subscription-billing/customers/create-customer)

