# Retrieve a payment promise

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


Returns a collections payment promise by its ID, including the promised amount, promise date, and current status.

## Sample Request

#### Chargebee CLI

```bash
chargebee collections-payment-promise retrieve pp_8aspTSOcUcz72s
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/collections_payment_promises/pp_8aspTSOcUcz72s \
     -u {site_api_key}:
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = CollectionsPaymentPromise.Retrieve("pp_8aspTSOcUcz72s").Request();

CollectionsPaymentPromise collectionsPaymentPromise = result.CollectionsPaymentPromise;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    collectionspaymentpromiseAction "github.com/chargebee/chargebee-go/v3/actions/collectionspaymentpromise"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := collectionspaymentpromiseAction.Retrieve("pp_8aspTSOcUcz72s").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        CollectionsPaymentPromise := res.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.CollectionsPaymentPromiseRetrieveRequest{
    Id : "pp_8aspTSOcUcz72s",
}
  res, err := client.CollectionsPaymentPromise.Retrieve(req)
      if err != nil {
        fmt.Println(err)
    } else {
        CollectionsPaymentPromise := res.CollectionsPaymentPromise
    }
}
```

#### Java

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

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = CollectionsPaymentPromise.retrieve("pp_8aspTSOcUcz72s").request();

        CollectionsPaymentPromise collectionsPaymentPromise = result.collectionsPaymentPromise();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.collectionsPaymentPromise.CollectionsPaymentPromise;
import com.chargebee.v4.models.collectionsPaymentPromise.params.CollectionsPaymentPromiseRetrieveParams;
import com.chargebee.v4.models.collectionsPaymentPromise.responses.CollectionsPaymentPromiseRetrieveResponse;

public class CollectionsPaymentPromiseRetrieve {

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

        CollectionsPaymentPromiseRetrieveResponse response = client.collectionsPaymentPromises().retrieve("pp_8aspTSOcUcz72s");

        CollectionsPaymentPromise collectionsPaymentPromise = response.getCollectionsPaymentPromise();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.collectionsPaymentPromise.retrieve("pp_8aspTSOcUcz72s");

    console.log(result);
    const collectionsPaymentPromise = result.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()->retrieve("pp_8aspTSOcUcz72s");
$collectionsPaymentPromise = $result->collections_payment_promise;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.CollectionsPaymentPromise.retrieve("pp_8aspTSOcUcz72s")
collections_payment_promise = response.collections_payment_promise
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::CollectionsPaymentPromise.retrieve("pp_8aspTSOcUcz72s")

collections_payment_promise = result.collections_payment_promise
```

## Sample Response

```json
{
  "collections_payment_promise": {
    "id": "pp_8aspTSOcUcz72s",
    "customer_id": "__test__8aspTSOcUcz72s",
    "invoice_id": "__demo_inv__4",
    "currency_code": "USD",
    "amount": 1000,
    "promised_by": "ops.user@chargebee.com",
    "promised_on": 1738512000,
    "status": "active",
    "created_at": 1738508400,
    "updated_at": 1738512100,
    "resource_version": 1738512100000,
    "object": "collections_payment_promise"
  }
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/collections_payment_promises/{collections-payment-promise-id}

## Returns

- `collections_payment_promise` (Collections payment promise object)
  The `collections_payment_promise` resource matching the requested identifier.
