Polar icon

Polar

Consume Polar.sh API

Actions13

Overview

This node integrates with the Polar.sh API to manage products, specifically allowing users to retrieve multiple product records in one operation. The "Get Many" operation under the "Product" resource fetches a list of products from the Polar.sh system, optionally filtered and limited by user-defined criteria.

Common scenarios where this node is beneficial include:

  • Synchronizing product catalogs between Polar.sh and other systems.
  • Retrieving product lists for reporting or analytics.
  • Filtering products based on attributes like archived status or recurring billing.
  • Fetching all products or a subset based on a limit for batch processing.

For example, a user might want to get all active (non-archived) recurring products belonging to a specific organization to update pricing or availability in another platform.

Properties

Name Meaning
Return All Whether to return all matching products or only up to a specified limit.
Limit Maximum number of product results to return when "Return All" is false. Minimum value is 1.
Filters Collection of filters to narrow down the product search:
  Is Archived Filter products by their archived status (true or false).
  Is Recurring Filter products by whether they are recurring products (true or false).
  Organization ID Filter products belonging to a specific organization by its ID (string).
  Query Search query string to filter products by name or description.

Output

The output is an array of JSON objects representing the retrieved products. Each object corresponds to a product record as returned by the Polar.sh API. The exact structure includes fields such as product ID, name, description, pricing details, metadata, and status flags (e.g., archived, recurring).

No binary data is output by this operation.

Example output snippet (simplified):

[
  {
    "id": "prod_123",
    "name": "Premium Subscription",
    "description": "Access to premium features",
    "is_archived": false,
    "is_recurring": true,
    "organization_id": "org_456",
    "prices": [
      {
        "type": "standard",
        "amount_type": "fixed",
        "price_amount": 999,
        "price_currency": "usd",
        "recurring_interval": "month"
      }
    ],
    "metadata": {
      "category": "subscription"
    }
  },
  ...
]

Dependencies

  • Requires an API key credential for authenticating with the Polar.sh API.
  • The node uses the Polar.sh REST API endpoints, switching between sandbox and production URLs based on environment configuration.
  • No additional external dependencies beyond the Polar.sh API and n8n's HTTP request capabilities.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Providing invalid filter values (e.g., malformed organization ID) may result in empty responses or errors.
    • Requesting too many items without enabling "Return All" can lead to truncated results.
  • Error messages:

    • Authentication errors typically indicate invalid or expired API keys; verify and update credentials.
    • Rate limiting or quota exceeded errors suggest too many requests in a short time; consider adding delays or reducing request frequency.
    • Validation errors on filters or parameters usually specify which field is incorrect; review input values carefully.
  • To resolve errors, ensure correct API credentials, validate input parameters, and consult Polar.sh API documentation for limits and constraints.

Links and References

Discussion