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.
List Checkout Links
curl -X GET "https://api.polar.sh/v1/checkout-links" \
-H "Authorization: Bearer polar_oat_..."
Query Parameters
Filter by organization ID
Page number for pagination
Number of results per page (max 100)
Response
Array of checkout link objects Show Checkout Link Object
Unique identifier for the checkout link
Client secret for accessing the checkout link publicly
Full URL to the checkout page
ID of the associated product
Payment processor (stripe)
URL to redirect after successful checkout
Custom metadata attached to the checkout link
Pagination information Total number of checkout links
Get Checkout Link
Retrieve a specific checkout link by ID.
curl -X GET "https://api.polar.sh/v1/checkout-links/{id}" \
-H "Authorization: Bearer polar_oat_..."
Path Parameters
Response
Returns a checkout link object.
Create Checkout Link
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
ID of the product to sell
URL to redirect customers after successful checkout
Custom metadata (key-value pairs)
Response
Returns the created checkout link object with id and client_secret.
Update Checkout Link
Update an existing checkout link.
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
Request Body
All fields are optional. Only include fields you want to update.
Updated metadata (replaces existing metadata)
Response
Returns the updated checkout link object.
Delete Checkout Link
Delete a checkout link. This will make the link inaccessible.
curl -X DELETE "https://api.polar.sh/v1/checkout-links/{id}" \
-H "Authorization: Bearer polar_oat_..."
Path Parameters
The checkout link ID to delete
Response
Returns 204 No Content on successful deletion.
Error Responses
Checkout link not found or you don’t have permission to access it
Missing or invalid authentication token
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 >