# List collections payment promises

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Eventually Consistent](/docs/api/read-consistency)

Lists collections payment promises for your site. Use filter parameters to narrow results by customer, invoice, or status.

## Sample Request

#### Chargebee CLI

```bash
chargebee collections-payment-promise list-collections-payment-promises \
    -d limit=2
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/collections_payment_promises \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = CollectionsPaymentPromise.ListCollectionsPaymentPromises()
		.Limit(2)
		.Request();

foreach (var listItem in result.List){
  CollectionsPaymentPromise collectionsPaymentPromise = listItem.CollectionsPaymentPromise;
}
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    collectionspaymentpromiseAction "github.com/chargebee/chargebee-go/v3/actions/collectionspaymentpromise"
    "github.com/chargebee/chargebee-go/v3/models/collectionspaymentpromise"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := collectionspaymentpromiseAction.ListCollectionsPaymentPromises(&collectionspaymentpromise.ListCollectionsPaymentPromisesRequestParams{
        Limit : chargebee.Int32(2),
    }).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            CollectionsPaymentPromise := res.List[idx].CollectionsPaymentPromise
        }
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.CollectionsPaymentPromiseListCollectionsPaymentPromisesRequest{
    Limit : chargebee.Int32(2),
}
  res, err := client.CollectionsPaymentPromise.ListCollectionsPaymentPromises(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            CollectionsPaymentPromise := res.List[idx].CollectionsPaymentPromise
        }
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.util.List;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        ListResult result = CollectionsPaymentPromise.listCollectionsPaymentPromises()
            .limit(2)
            .request();

        for (ListResult.Entry entry : result) {
            CollectionsPaymentPromise collectionsPaymentPromise = entry.collectionsPaymentPromise();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.collectionsPaymentPromise.CollectionsPaymentPromise;
import com.chargebee.v4.models.collectionsPaymentPromise.params.ListCollectionsPaymentPromisesParams;
import com.chargebee.v4.models.collectionsPaymentPromise.responses.ListCollectionsPaymentPromisesResponse;
import java.util.List;

public class ListCollectionsPaymentPromises {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        ListCollectionsPaymentPromisesParams params = ListCollectionsPaymentPromisesParams.builder()
            .limit(2)
            .build();

        ListCollectionsPaymentPromisesResponse response = client.collectionsPaymentPromises().listCollectionsPaymentPromises(params);
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.collectionsPaymentPromise.listCollectionsPaymentPromises({
        limit: 2
    });
    result.list.forEach((entry) => {
        console.log(entry);
        const collectionsPaymentPromise = entry.collections_payment_promise;
    });
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->collectionsPaymentPromise()->listCollectionsPaymentPromises([
    "limit" => 2
]);
foreach($result->list as $entry) {
    $collectionsPaymentPromise = $entry->collections_payment_promise;
}
```

#### Python

```python
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.CollectionsPaymentPromise.list_collections_payment_promises(
    cb_client.CollectionsPaymentPromise.ListCollectionsPaymentPromisesParams(
        limit=2
    )
)
for entry in entries.list:
    collections_payment_promise = entry.collections_payment_promise
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

list = ChargeBee::CollectionsPaymentPromise.list_collections_payment_promises({
  :limit => 2
})

list.each do |entry|
  collections_payment_promise = entry.collections_payment_promise
end
```

## Sample Response

```json
{
  "list": [
    {
      "collections_payment_promise": {
        "id": "pp_8aspTSOcUcz72s",
        "invoice_id": "__demo_inv__4",
        "amount": 1000,
        "status": "active",
        "object": "collections_payment_promise"
      }
    },
    {..}
  ],
  "next_offset": "[\"1738512100\",\"pp_8aspTSOcUcz72s\"]"
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/collections_payment_promises

## Input Parameters

- `limit` (optional, integer, default=10, min=1, max=100)
  The number of resources to be returned.

- `offset` (optional, string, max chars=1000)
  Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set `offset` to the value of `next_offset` obtained in the previous iteration of the API call.

## Returns

- `next_offset` (optional, string, max chars=1000)
  This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

- `collections_payment_promise` (Collections payment promise object)
  A `collections_payment_promise` resource from the current page of results.
