Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Benefits
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Billing Events
- Organization Events
OAuth 2.0 API
- Connect
- Clients
Get Checkout Link
Get a checkout link by ID.
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.CheckoutLinks.Get(ctx, "<value>")
if err != nil {
log.Fatal(err)
}
if res.CheckoutLink != nil {
// handle response
}
}
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"payment_processor": "stripe",
"client_secret": "<string>",
"success_url": "<string>",
"label": "<string>",
"allow_discount_codes": true,
"discount_id": "<string>",
"organization_id": "<string>",
"products": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"recurring_interval": "month",
"is_recurring": true,
"is_archived": true,
"organization_id": "<string>",
"prices": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
}
],
"benefits": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"type": "custom",
"description": "<string>",
"selectable": true,
"deletable": true,
"organization_id": "<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>"
}
]
}
],
"discount": {
"duration": "once",
"type": "fixed",
"amount": 123,
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"name": "<string>",
"code": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"max_redemptions": 123,
"redemptions_count": 123,
"organization_id": "<string>"
},
"product_id": "<string>",
"product_price_id": "<string>",
"product": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"recurring_interval": "month",
"is_recurring": true,
"is_archived": true,
"organization_id": "<string>",
"prices": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
}
],
"benefits": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"type": "custom",
"description": "<string>",
"selectable": true,
"deletable": true,
"organization_id": "<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>"
}
]
},
"product_price": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
},
"url": "<string>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The checkout link ID.
Response
Checkout link data.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Payment processor used.
stripe
Client secret used to access the checkout link.
URL where the customer will be redirected after a successful payment.
Optional label to distinguish links internally
Whether to allow the customer to apply discount codes. If you apply a discount through discount_id
, it'll still be applied, but the customer won't be able to change it.
ID of the discount to apply to the checkout. If the discount is not applicable anymore when opening the checkout link, it'll be ignored.
The organization ID.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the product.
The name of the product.
The description of the product.
The recurring interval of the product. If None
, the product is a one-time purchase.
month
, year
Whether the product is a subscription.
Whether the product is archived and no longer available.
The ID of the organization owning the product.
List of prices for this product.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the price.
"fixed"
Whether the price is archived and no longer available.
The ID of the product owning the price.
The type of the price.
"recurring"
The recurring interval of the price.
month
, year
The currency.
The price in cents.
List of benefits granted by the product.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the benefit.
The type of the benefit.
custom
, ads
, discord
, github_repository
, downloadables
, license_keys
The description of the benefit.
Whether the benefit is selectable when creating a product.
Whether the benefit is deletable.
The ID of the organization owning the benefit.
List of medias associated to the product.
The ID of the object.
"product_media"
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
Product data for a checkout link.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the product.
The name of the product.
The description of the product.
The recurring interval of the product. If None
, the product is a one-time purchase.
month
, year
Whether the product is a subscription.
Whether the product is archived and no longer available.
The ID of the organization owning the product.
List of prices for this product.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the price.
"fixed"
Whether the price is archived and no longer available.
The ID of the product owning the price.
The type of the price.
"recurring"
The recurring interval of the price.
month
, year
The currency.
The price in cents.
List of benefits granted by the product.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the benefit.
The type of the benefit.
custom
, ads
, discord
, github_repository
, downloadables
, license_keys
The description of the benefit.
Whether the benefit is selectable when creating a product.
Whether the benefit is deletable.
The ID of the organization owning the benefit.
List of medias associated to the product.
The ID of the object.
"product_media"
A recurring price for a product, i.e. a subscription.
Deprecated: The recurring interval should be set on the product itself.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the price.
"fixed"
Whether the price is archived and no longer available.
The ID of the product owning the price.
The type of the price.
"recurring"
The recurring interval of the price.
month
, year
The currency.
The price in cents.
Was this page helpful?
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.CheckoutLinks.Get(ctx, "<value>")
if err != nil {
log.Fatal(err)
}
if res.CheckoutLink != nil {
// handle response
}
}
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"payment_processor": "stripe",
"client_secret": "<string>",
"success_url": "<string>",
"label": "<string>",
"allow_discount_codes": true,
"discount_id": "<string>",
"organization_id": "<string>",
"products": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"recurring_interval": "month",
"is_recurring": true,
"is_archived": true,
"organization_id": "<string>",
"prices": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
}
],
"benefits": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"type": "custom",
"description": "<string>",
"selectable": true,
"deletable": true,
"organization_id": "<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>"
}
]
}
],
"discount": {
"duration": "once",
"type": "fixed",
"amount": 123,
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"name": "<string>",
"code": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"max_redemptions": 123,
"redemptions_count": 123,
"organization_id": "<string>"
},
"product_id": "<string>",
"product_price_id": "<string>",
"product": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"recurring_interval": "month",
"is_recurring": true,
"is_archived": true,
"organization_id": "<string>",
"prices": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
}
],
"benefits": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"type": "custom",
"description": "<string>",
"selectable": true,
"deletable": true,
"organization_id": "<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>"
}
]
},
"product_price": {
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"amount_type": "<string>",
"is_archived": true,
"product_id": "<string>",
"type": "<string>",
"recurring_interval": "month",
"price_currency": "<string>",
"price_amount": 123,
"legacy": true
},
"url": "<string>"
}