# GET /addons/{{product_id}} — List All Addons

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

This API is used to retrieve a list of all the available addons by product id.

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| product_id | string | Yes |  |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| limit | string | No | Integer, default=10, 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 Addons:

```json
{
    "status": "success",
    "message": "Addons data",
    "data": [
        {
            "billing_period": "m",
            "category_array": [
                "5e3aac233c92e44b424b6dfb"
            ],
            "createdAt": "2020-03-04T08:31:40.457Z",
            "updatedAt": "2020-03-04T08:31:40.457Z",
            "id": "5e5f676c3b2518365c79247a",
            "product_id": "5e3a95143c92e44b424b6d47",
            "user_id": "5b961bc55dfff7797d9cd897",
            "name": "Extra 5GB Data",
            "code": "extra-5gb-data",
            "price": 10,
            "billing_cycle": "lifetime",
            "status": true,
            "associate_plans": "all",
            "plans_array": [
                ""
            ],
            "description": "By adding this addon, you'll get extra 5GB data",
            "category_list": [
                {
                    "category_code": "category 2",
                    "createdAt": "2020-02-05T11:50:59.269Z",
                    "updatedAt": "2020-02-05T11:50:59.269Z",
                    "id": "5e3aac233c92e44b424b6dfb",
                    "product_id": "5e3a95143c92e44b424b6d47",
                    "user_id": "5b961bc55dfff7797d9cd897",
                    "category_name": "Category 2"
                }
            ]
        },
        {
            "billing_period": "y",
            "category_array": [
                "5e3aac233c92e44b424b6dfb"
            ],
            "createdAt": "2020-02-05T11:53:17.843Z",
            "updatedAt": "2020-02-05T11:53:17.843Z",
            "id": "5e3aacad24b63d4b28410d4f",
            "product_id": "5e3a95143c92e44b424b6d47",
            "user_id": "5b961bc55dfff7797d9cd897",
            "name": "Add-on 3 yearly",
            "code": "add-on-3-yearly",
            "price": 500,
            "billing_cycle": "lifetime",
            "status": false,
            "associate_plans": "all_plans",
            "plans_array": null,
            "description": "",
            "category_list": [
                {
                    "category_code": "category 2",
                    "createdAt": "2020-02-05T11:50:59.269Z",
                    "updatedAt": "2020-02-05T11:50:59.269Z",
                    "id": "5e3aac233c92e44b424b6dfb",
                    "product_id": "5e3a95143c92e44b424b6d47",
                    "user_id": "5b961bc55dfff7797d9cd897",
                    "category_name": "Category 2"
                }
            ]
        },
        {
            "billing_period": "m",
            "category_array": [
                "5e3aac233c92e44b424b6dfb",
                "5e3aac1924b63d4b28410d4d"
            ],
            "createdAt": "2020-02-05T11:52:52.617Z",
            "updatedAt": "2020-02-05T11:52:52.617Z",
            "id": "5e3aac9424b63d4b28410d4e",
            "product_id": "5e3a95143c92e44b424b6d47",
            "user_id": "5b961bc55dfff7797d9cd897",
            "name": "Add-on 2 monthly",
            "code": "add-on-2-monthly",
            "price": 250,
            "billing_cycle": "lifetime",
            "status": false,
            "associate_plans": "all_plans",
            "plans_array": null,
            "description": "",
            "category_list": [
                {
                    "category_code": "category 1",
                    "createdAt": "2020-02-05T11:50:49.393Z",
                    "updatedAt": "2020-02-05T11:50:49.393Z",
                    "id": "5e3aac1924b63d4b28410d4d",
                    "product_id": "5e3a95143c92e44b424b6d47",
                    "user_id": "5b961bc55dfff7797d9cd897",
                    "category_name": "Category 1"
                },
                {
                    "category_code": "category 2",
                    "createdAt": "2020-02-05T11:50:59.269Z",
                    "updatedAt": "2020-02-05T11:50:59.269Z",
                    "id": "5e3aac233c92e44b424b6dfb",
                    "product_id": "5e3a95143c92e44b424b6d47",
                    "user_id": "5b961bc55dfff7797d9cd897",
                    "category_name": "Category 2"
                }
            ]
        },
        {
            "billing_period": "",
            "category_array": [
                "5e3aac1924b63d4b28410d4d"
            ],
            "createdAt": "2020-02-05T11:51:18.185Z",
            "updatedAt": "2020-02-05T11:51:18.185Z",
            "id": "5e3aac363c92e44b424b6dfc",
            "product_id": "5e3a95143c92e44b424b6d47",
            "user_id": "5b961bc55dfff7797d9cd897",
            "name": "Add on 1 one time",
            "code": "add-on-1-one-time",
            "price": 100,
            "billing_cycle": "onetime",
            "status": true,
            "associate_plans": "all_plans",
            "plans_array": null,
            "description": "",
            "category_list": [
                {
                    "category_code": "category 1",
                    "createdAt": "2020-02-05T11:50:49.393Z",
                    "updatedAt": "2020-02-05T11:50:49.393Z",
                    "id": "5e3aac1924b63d4b28410d4d",
                    "product_id": "5e3a95143c92e44b424b6d47",
                    "user_id": "5b961bc55dfff7797d9cd897",
                    "category_name": "Category 1"
                }
            ]
        }
    ]
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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/addons/{{product_id}}?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 Add-on:**

- [POST /addon/{{product_id}} — Create Addon](/subscription-billing/add-on/create-addon)
- [GET /addon/{{addonId}} — Get Single Addon](/subscription-billing/add-on/get-single-addon)
- [PUT /addon/{{addon_id}} — Update Addon](/subscription-billing/add-on/update-addon)
- [DELETE /addon/{{addon_id}} — Delete Addon](/subscription-billing/add-on/delete-addon)

