# List omnichannel subscriptions

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


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

Returns a list of `omnichannel_subscription` objects. Filter by Chargebee `id`, store-native `id_at_source`, `customer_id`, `source`, purchase/update timestamps, or nested item attributes.

**Apple App Store**: Filter `id_at_source` with the original purchase **Transaction ID**.

**Google Play Store**: Filter `id_at_source` with the subscription **purchase token**. Google may issue a new token after certain subscription changes; Chargebee updates `id_at_source` to the latest token, so use the current token when filtering.

## Sample Request

#### cURL

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

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = OmnichannelSubscription.List().Request();

foreach (var listItem in result.List){
  OmnichannelSubscription omnichannelSubscription = listItem.OmnichannelSubscription;
}
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    omnichannelsubscriptionAction "github.com/chargebee/chargebee-go/v3/actions/omnichannelsubscription"
    "github.com/chargebee/chargebee-go/v3/models/omnichannelsubscription"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := omnichannelsubscriptionAction.List(&omnichannelsubscription.ListRequestParams{}).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            OmnichannelSubscription := res.List[idx].OmnichannelSubscription
        }
    }
}
```

#### 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.OmnichannelSubscriptionListRequest{}
  res, err := client.OmnichannelSubscription.List(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            OmnichannelSubscription := res.List[idx].OmnichannelSubscription
        }
    }
}
```

#### 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 = OmnichannelSubscription.list().request();

        for (ListResult.Entry entry : result) {
            OmnichannelSubscription omnichannelSubscription = entry.omnichannelSubscription();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription;
import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelSubscriptionListParams;
import com.chargebee.v4.models.omnichannelSubscription.responses.OmnichannelSubscriptionListResponse;
import java.util.List;

public class OmnichannelSubscriptionList {

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

        OmnichannelSubscriptionListResponse response = client.omnichannelSubscriptions().list();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.omnichannelSubscription.list();
    result.list.forEach((entry) => {
        console.log(entry);
        const omnichannelSubscription = entry.omnichannel_subscription;
    });
} 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->omnichannelSubscription()->all();
foreach($result->list as $entry) {
    $omnichannelSubscription = $entry->omnichannel_subscription;
}
```

#### Python

```python
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.OmnichannelSubscription.list()
for entry in entries.list:
    omnichannel_subscription = entry.omnichannel_subscription
```

#### Ruby

```ruby
require 'chargebee'

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

list = ChargeBee::OmnichannelSubscription.list()

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

## Sample Response

```json
{
  "list": [
    {
      "omnichannel_subscription": {
        "id": "__test__os_AHsdfs123ld1",
        "app_id": "__test__gps_sdfwerzx5134",
        "customer_id": "__test__XpbTXGTSRp3gEsD8",
        "id_at_source": "20000006743",
        "source": "google_play_store",
        "created_at": 1517487053,
        "object": "omnichannel_subscription",
        "omnichannel_subscription_items": [
          {
            "id": "__test__osi_BXswds133lf1",
            "id_at_source": "com.example.landmarks.premium",
            "status": "active",
            "current_term_start": 1728988425,
            "current_term_end": 1731666825,
            "omnichannel_subscription_item_offers": [
              {
                "id": "__test__off__AHsdfs123LD1",
                "offer_id_at_source": "intro_offer_google_monthly",
                "category": "introductory",
                "category_at_source": "INTRODUCTORY",
                "type": "free_trial",
                "type_at_source": "FREE_TRIAL",
                "discount_type": "percentage",
                "duration": "P1M",
                "percentage": 50,
                "price_currency": "USD",
                "price_units": 2,
                "price_nanos": 90000000,
                "offer_term_start": 1752676649,
                "offer_term_end": 1755268649
              },
              {..}
            ]
          },
          {..}
        ]
      }
    },
    {..}
  ]
}
```

## URL Format

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

## 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`.

- `omnichannel_subscription` (Omnichannel subscription object)
  Resource object representing Omnichannel subscription
