List Subscriptions - Polar

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

GET

https://api.polar.shhttps://sandbox-api.polar.sh

/v1/subscriptions/

Try it

Python Example

from polar.v2026_04 import Polar

polar = Polar("polar_oat_xxx")

for item in polar.subscriptions.iter_list(
    page=1,
    limit=10,
    sorting=['-started_at'],
):
    print(item)

JavaScript Example

import { createPolar } from "@polar-sh/sdk/2026-04";

const polar = createPolar({
  accessToken: "polar_oat_xxx",
});

for await (const item of polar.subscriptions.iterList(
  {
    "page": 1,
    "limit": 10,
    "sorting": [
      "-started_at"
    ]
  },
)) {
  console.log(item);
}

cURL Example

curl --request GET \
  --url 'https://api.polar.sh/v1/subscriptions/?page=1&limit=10' \
  --header 'Authorization: Bearer <token>'

Fetch Example

const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.polar.sh/v1/subscriptions/?page=1&limit=10', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP Example

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.polar.sh/v1/subscriptions/?page=1&limit=10",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Go Example

package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

url := "https://api.polar.sh/v1/subscriptions/?page=1&limit=10"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Response Structure (200)

{
  "items": [
    {
      "created_at": "2026-01-01T00:00:00.000000Z",
      "modified_at": "2026-01-01T00:00:00.000000Z",
      "id": "<string>",
      "amount": 10000,
      "currency": "usd",
      "recurring_interval": "month",
      "recurring_interval_count": 123,
      "status": "active",
      "current_period_start": "2026-01-01T00:00:00.000000Z",
      "current_period_end": "2026-01-01T00:00:00.000000Z",
      "current_meter_period_start": "2026-01-01T00:00:00.000000Z",
      "current_meter_period_end": "2026-01-01T00:00:00.000000Z",
      "trial_start": "2026-01-01T00:00:00.000000Z",
      "trial_end": "2026-01-01T00:00:00.000000Z",
      "cancel_at_period_end": true,
      "canceled_at": "2026-01-01T00:00:00.000000Z",
      "started_at": "2026-01-01T00:00:00.000000Z",
      "ends_at": "2026-01-01T00:00:00.000000Z",
      "ended_at": "2026-01-01T00:00:00.000000Z",
      "pause_at_period_end": true,
      "paused_at": "2026-01-01T00:00:00.000000Z",
      "resumes_at": "2026-01-01T00:00:00.000000Z",
      "customer_id": "<string>",
      "product_id": "<string>",
      "discount_id": "<string>",
      "checkout_id": "<string>",
      "units": 123,
      "customer_cancellation_reason": "customer_service",
      "customer_cancellation_comment": "<string>",
      "metadata": {},
      "customer": {
        "id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
        "created_at": "2026-01-01T00:00:00.000000Z",
        "modified_at": "2026-01-01T00:00:00.000000Z",
        "metadata": {},
        "email_verified": true,
        "type": "individual",
        "name": "John Doe",
        "billing_name": "John Doe",
        "billing_address": {
          "country": "US",
          "line1": "<string>",
          "line2": "<string>",
          "postal_code": "<string>",
          "city": "<string>",
          "state": "<string>"
        },
        "tax_id": {"[0]": "<string>"},
        "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
        "deleted_at": "2026-01-01T00:00:00.000000Z",
        "first_user_event_at": "2026-01-01T00:00:00.000000Z",
        "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404",
        "external_id": "usr_1337",
        "email": "customer@example.com",
        "locale": "<string>",
        "default_payment_method_id": "<string>"
      },
      "product": {
        "id": "<string>",
        "created_at": "2026-01-01T00:00:00.000000Z",
        "modified_at": "2026-01-01T00:00:00.000000Z",
        "trial_interval": "day",
        "trial_interval_count": 123,
        "name": "<string>",
        "description": "<string>",
        "visibility": "draft",
        "recurring_interval": "day",
        "recurring_interval_count": 123,
        "meter_interval": "day",
        "meter_interval_count": 123,
        "is_recurring": true,
        "is_archived": true,
        "organization_id": "<string>",
        "metadata": {},
        "prices": [
          {
            "created_at": "2026-01-01T00:00:00.000000Z",
            "modified_at": "2026-01-01T00:00:00.000000Z",
            "id": "<string>",
            "source": "catalog",
            "amount_type": "fixed",
            "price_currency": "<string>",
            "tax_behavior": "location",
            "is_archived": true,
            "product_id": "<string>",
            "type": "recurring",
            "recurring_interval": "day",
            "price_amount": 123,
            "legacy": true
          }
        ],
        "benefits": [
          {
            "id": "<string>",
            "created_at": "2026-01-01T00:00:00.000000Z",
            "modified_at": "2026-01-01T00:00:00.000000Z",
            "type": "custom",
            "description": "<string>",
            "selectable": true,
            "deletable": true,
            "is_deleted": true,
            "organization_id": "<string>",
            "metadata": {},
            "visibility": "draft",
            "properties": {
              "note": "<string>"
            },
            "visibility_configurable": true
          }
        ],
        "medias": [
          {
            "id": "<string>",
            "organization_id": "<string>",
            "name": "<string>",
            "path": "<string>",
            "mime_type": "<string>",
            "size": 123,
            "storage_version": "<string>",
            "checksum_etag": "<string>",
            "checksum_sha256_base64": "<string>",
            "checksum_sha256_hex": "<string>",
            "last_modified_at": "2026-01-01T00:00:00.000000Z",
            "version": "<string>",
            "service": "product_media",
            "is_uploaded": true,
            "created_at": "2026-01-01T00:00:00.000000Z",
            "size_readable": "<string>",
            "public_url": "<string>"
          }
        ],
        "attached_custom_fields": [
          {
            "custom_field_id": "<string>",
            "custom_field": {
              "created_at": "2026-01-01T00:00:00.000000Z",
              "modified_at": "2026-01-01T00:00:00.000000Z",
              "id": "<string>",
              "metadata": {},
              "type": "text",
              "slug": "<string>",
              "name": "<string>",
              "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              "properties": {
                "form_label": "<string>",
                "form_help_text": "<string>",
                "form_placeholder": "<string>",
                "textarea": true,
                "min_length": 1073741823,
                "max_length": 1073741823
              }
            },
            "order": 123,
            "required": true
          }
        ]
      },
      "discount": {
        "duration": "once",
        "type": "fixed",
        "amount": 1000,
        "currency": "usd",
        "amounts": {
          "eur": 900,
          "usd": 1000
        },
        "created_at": "2026-01-01T00:00:00.000000Z",
        "modified_at": "2026-01-01T00:00:00.000000Z",
        "id": "<string>",
        "metadata": {},
        "name": "<string>",
        "code": "<string>",
        "starts_at": "2026-01-01T00:00:00.000000Z",
        "ends_at": "2026-01-01T00:00:00.000000Z",
        "max_redemptions": 123,
        "max_redemptions_per_customer": 123,
        "redemptions_count": 123,
        "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"
      },
      "prices": [
        {
          "created_at": "2026-01-01T00:00:00.000000Z",
          "modified_at": "2026-01-01T00:00:00.000000Z",
          "id": "<string>",
          "source": "catalog",
          "amount_type": "fixed",
          "price_currency": "<string>",
          "tax_behavior": "location",
          "is_archived": true,
          "product_id": "<string>",
          "type": "recurring",
          "recurring_interval": "day",
          "price_amount": 123,
          "legacy": true
        }
      ],
      "meters": [
        {
          "created_at": "2026-01-01T00:00:00.000000Z",
          "modified_at": "2026-01-01T00:00:00.000000Z",
          "id": "<string>",
          "consumed_units": 25,
          "credited_units": 100,
          "amount": 0,
          "meter_id": "d498a884-e2cd-4d3e-8002-f536468a8b22",
          "meter": {
            "metadata": {},
            "created_at": "2026-01-01T00:00:00.000000Z",
            "modified_at": "2026-01-01T00:00:00.000000Z",
            "id": "<string>",
            "name": "<string>",
            "unit": "scalar",
            "filter": {
              "conjunction": "and",
              "clauses": [
                {
                  "property": "<string>",
                  "operator": "eq",
                  "value": "<string>"
                }
              ]
            },
            "aggregation": {
              "func": "count"
            },
            "organization_id": "<string>",
            "custom_label": "<string>",
            "custom_multiplier": 123,
            "archived_at": "2026-01-01T00:00:00.000000Z"
          }
        }
      ],
      "pending_update": {
        "created_at": "2026-01-01T00:00:00.000000Z",
        "modified_at": "2026-01-01T00:00:00.000000Z",
        "id": "<string>",
        "applies_at": "2026-01-01T00:00:00.000000Z",
        "product_id": "<string>",
        "seats": 123,
        "units": 123
      },
      "past_due_at": "2026-01-01T00:00:00.000000Z",
      "seats": 123,
      "custom_field_data": {}
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Error Response (422)

{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}