# Retrieve payment schedules for an invoice

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


This endpoint retrieves payment schedules created for an invoice.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/invoices/a0920247004/payment_schedules \
     -u {site_api_key}:
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Invoice.PaymentSchedules("a0920247004").Request();

List<PaymentSchedule> paymentSchedules = result.PaymentSchedules;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    invoiceAction "github.com/chargebee/chargebee-go/v3/actions/invoice"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := invoiceAction.PaymentSchedules("a0920247004").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        PaymentSchedules := res.PaymentSchedules
    }
}
```

#### 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.InvoicePaymentSchedulesRequest{
    Id : "a0920247004",
}
  res, err := client.Invoice.PaymentSchedules(req)
      if err != nil {
        fmt.Println(err)
    } else {
        PaymentSchedules := res.PaymentSchedules
    }
}
```

#### 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}");
        Result result = Invoice.paymentSchedules("a0920247004").request();

        List<PaymentSchedule> paymentSchedules = result.paymentSchedules();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.invoice.params.InvoicePaymentSchedulesParams;
import com.chargebee.v4.models.invoice.responses.InvoicePaymentSchedulesResponse;
import com.chargebee.v4.models.paymentSchedule.PaymentSchedule;
import java.util.List;

public class InvoicePaymentSchedules {

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

        InvoicePaymentSchedulesResponse response = client.invoices().paymentSchedules("a0920247004");

        List<PaymentSchedule> paymentSchedules = response.getPaymentSchedules();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.invoice.paymentSchedules("a0920247004");

    console.log(result);
    const paymentSchedules = result.payment_schedules;
} 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->invoice()->paymentSchedules("a0920247004");
$paymentSchedules = $result->payment_schedules;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Invoice.payment_schedules("a0920247004")
payment_schedules = response.payment_schedules
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Invoice.payment_schedules("a0920247004")

payment_schedules = result.payment_schedules
```

## Sample Response

```json
{
  "payment_schedules": [
    {
      "id": "16BdWdUNYtQf97w",
      "scheme_id": "16Bk0DUNYt3kk3n",
      "entity_type": "invoice",
      "entity_id": "a0920247004",
      "created_at": 1725593728,
      "object": "payment_schedule",
      "schedule_entries": [
        {
          "id": "16BdWdUNYtQfC7x",
          "date": 1725593728,
          "amount": 13333,
          "status": "payment_due",
          "object": "schedule_entry"
        },
        {..}
      ]
    },
    {..}
  ]
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/invoices/{invoice-id}/payment_schedules

## Returns

- `payment_schedules` (always returned)
  Resource object representing payment\_schedule
