Skip to main content
GET
/
v1
/
products
/
{id}
Go (SDK)
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Products.Get(ctx, "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Product != nil {
        // handle response
    }
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "trial_interval": "day",
  "trial_interval_count": 123,
  "name": "<string>",
  "description": "<string>",
  "visibility": "draft",
  "recurring_interval": "day",
  "recurring_interval_count": 123,
  "is_recurring": true,
  "is_archived": true,
  "organization_id": "<string>",
  "metadata": {},
  "prices": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "source": "catalog",
      "amount_type": "<string>",
      "price_currency": "<string>",
      "tax_behavior": "location",
      "is_archived": true,
      "product_id": "<string>",
      "type": "<string>",
      "recurring_interval": "day",
      "price_amount": 123,
      "legacy": true
    }
  ],
  "benefits": [
    {
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "type": "<string>",
      "description": "<string>",
      "selectable": true,
      "deletable": true,
      "is_deleted": true,
      "organization_id": "<string>",
      "metadata": {},
      "properties": {
        "note": "<string>"
      }
    }
  ],
  "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": "2023-11-07T05:31:56Z",
      "version": "<string>",
      "service": "<string>",
      "is_uploaded": true,
      "created_at": "2023-11-07T05:31:56Z",
      "size_readable": "<string>",
      "public_url": "<string>"
    }
  ],
  "attached_custom_fields": [
    {
      "custom_field_id": "<string>",
      "custom_field": {
        "created_at": "2023-11-07T05:31:56Z",
        "modified_at": "2023-11-07T05:31:56Z",
        "id": "<string>",
        "metadata": {},
        "type": "<string>",
        "slug": "<string>",
        "name": "<string>",
        "organization_id": "<string>",
        "properties": {
          "form_label": "<string>",
          "form_help_text": "<string>",
          "form_placeholder": "<string>",
          "textarea": true,
          "min_length": 1073741823,
          "max_length": 1073741823
        }
      },
      "order": 123,
      "required": true
    }
  ]
}

Documentation Index

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

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

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Path Parameters

id
string<uuid4>
required

The product ID.

Response

Successful Response

A product.

id
string<uuid4>
required

The ID of the object.

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

trial_interval
enum<string> | null
required

The interval unit for the trial period.

Available options:
day,
week,
month,
year
trial_interval_count
integer | null
required

The number of interval units for the trial period.

name
string
required

The name of the product.

description
string | null
required

The description of the product.

visibility
enum<string>
required

The visibility of the product.

Available options:
draft,
private,
public
recurring_interval
enum<string> | null
required

The recurring interval of the product. If None, the product is a one-time purchase.

Available options:
day,
week,
month,
year
recurring_interval_count
integer | null
required

Number of interval units of the subscription. If this is set to 1 the charge will happen every interval (e.g. every month), if set to 2 it will be every other month, and so on. None for one-time products.

is_recurring
boolean
required

Whether the product is a subscription.

is_archived
boolean
required

Whether the product is archived and no longer available.

organization_id
string<uuid4>
required

The ID of the organization owning the product.

metadata
object
required
prices
(LegacyRecurringProductPriceFixed · object | LegacyRecurringProductPriceCustom · object | LegacyRecurringProductPriceFree · object | ProductPriceFixed · object | ProductPriceCustom · object | ProductPriceFree · object | ProductPriceSeatBased · object | ProductPriceMeteredUnit · object)[]
required

List of prices for this product.

A recurring price for a product, i.e. a subscription.

Deprecated: The recurring interval should be set on the product itself.

benefits
(BenefitCustom · object | BenefitDiscord · object | BenefitGitHubRepository · object | BenefitDownloadables · object | BenefitLicenseKeys · object | BenefitMeterCredit · object | BenefitFeatureFlag · object)[]
required

List of benefits granted by the product.

A benefit of type custom.

Use it to grant any kind of benefit that doesn't fit in the other types.

medias
ProductMediaFileRead · object[]
required

List of medias associated to the product.

attached_custom_fields
AttachedCustomField · object[]
required

List of custom fields attached to the product.