Skip to main content
Checkout Links are shareable URLs that customers can use to purchase your products. Unlike checkout sessions, checkout links are permanent and can be reused multiple times.

Base URL

https://api.polar.sh/v1/checkout-links

Authentication

All checkout link endpoints require authentication with an Organization Access Token or Personal Access Token with checkout_links:write scope.
curl -X GET "https://api.polar.sh/v1/checkout-links" \
  -H "Authorization: Bearer polar_oat_..."

Query Parameters

organization_id
string
Filter by organization ID
product_id
string
Filter by product ID
page
integer
default:1
Page number for pagination
limit
integer
default:10
Number of results per page (max 100)

Response

items
array
Array of checkout link objects
pagination
object
Pagination information
Retrieve a specific checkout link by ID.
cURL
curl -X GET "https://api.polar.sh/v1/checkout-links/{id}" \
  -H "Authorization: Bearer polar_oat_..."

Path Parameters

id
string
required
The checkout link ID

Response

Returns a checkout link object. Create a new reusable checkout link for a product.
curl -X POST "https://api.polar.sh/v1/checkout-links" \
  -H "Authorization: Bearer polar_oat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prod_...",
    "success_url": "https://example.com/success",
    "metadata": {
      "campaign": "launch_2024"
    }
  }'

Request Body

product_id
string
required
ID of the product to sell
payment_processor
string
default:"stripe"
Payment processor to use
success_url
string
URL to redirect customers after successful checkout
metadata
object
Custom metadata (key-value pairs)

Response

Returns the created checkout link object with id and client_secret. Update an existing checkout link.
cURL
curl -X PATCH "https://api.polar.sh/v1/checkout-links/{id}" \
  -H "Authorization: Bearer polar_oat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "success_url": "https://example.com/new-success"
  }'

Path Parameters

id
string
required
The checkout link ID

Request Body

All fields are optional. Only include fields you want to update.
success_url
string
New success URL
metadata
object
Updated metadata (replaces existing metadata)

Response

Returns the updated checkout link object. Delete a checkout link. This will make the link inaccessible.
cURL
curl -X DELETE "https://api.polar.sh/v1/checkout-links/{id}" \
  -H "Authorization: Bearer polar_oat_..."

Path Parameters

id
string
required
The checkout link ID to delete

Response

Returns 204 No Content on successful deletion.

Error Responses

404 Not Found
Checkout link not found or you don’t have permission to access it
401 Unauthorized
Missing or invalid authentication token
422 Unprocessable Entity
Invalid request parameters

Use Cases

Marketing Campaigns

Create unique checkout links for different marketing channels:
const emailLink = await polar.checkoutLinks.create({
  productId: 'prod_...',
  successUrl: 'https://example.com/thanks',
  metadata: { source: 'email_campaign' }
});

const socialLink = await polar.checkoutLinks.create({
  productId: 'prod_...',
  successUrl: 'https://example.com/thanks',
  metadata: { source: 'social_media' }
});

Embedded Checkout

Share checkout links directly or embed them in your content:
<a href="https://polar.sh/checkout/{client_secret}">Buy Now</a>

Build docs developers (and LLMs) love