Skip to main content

Documentation Index

Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt

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

Checkout links are permanent, reusable URLs hosted by Polar. Unlike checkout sessions (which are created per-user and expire after a short window), a checkout link has no session and can be shared with anyone — paste it in an email, embed it in a marketing page, or use it as a “Buy now” button on a static site. Manage them through the LaravelPolar facade.
Checkout link vs. checkout session: A session is tied to an authenticated user and pre-fills their details. A link is sessionless and generic — great for public pages, but the customer must fill in their own details at checkout.
The createCheckoutLink method accepts one of three payload types depending on how you want to select the product. Use CheckoutLinkCreateProduct when you want to pin the link to a specific product:
use Danestves\LaravelPolar\LaravelPolar;
use Polar\Models\Components;

$link = LaravelPolar::createCheckoutLink(
    new Components\CheckoutLinkCreateProduct(
        productId: 'product_id_123',
        paymentProcessor: 'stripe',
    )
);

echo $link->url; // share this URL anywhere
Use CheckoutLinkCreateProducts when you want the customer to choose between several products (for example, monthly vs. yearly pricing):
$link = LaravelPolar::createCheckoutLink(
    new Components\CheckoutLinkCreateProducts(
        productIds: ['monthly_product_id', 'yearly_product_id'],
        paymentProcessor: 'stripe',
    )
);
Use CheckoutLinkCreateProductPrice when the product has multiple prices and you want the link to lock in one of them:
$link = LaravelPolar::createCheckoutLink(
    new Components\CheckoutLinkCreateProductPrice(
        productPriceId: 'price_id_123',
        paymentProcessor: 'stripe',
    )
);
Pass the link ID and a CheckoutLinkUpdate payload to change properties such as the label:
LaravelPolar::updateCheckoutLink(
    'cl_xxx',
    new Components\CheckoutLinkUpdate(label: 'Black Friday')
);
LaravelPolar::deleteCheckoutLink('cl_xxx');
Deleting a checkout link is permanent. Any page or email that references the link’s URL will stop working immediately. Update references before deleting.
Retrieve all checkout links for your organisation. The method accepts an optional CheckoutLinksListRequest to filter or paginate:
$response = LaravelPolar::listCheckoutLinks();
$link = LaravelPolar::getCheckoutLink('cl_xxx');

echo $link->url;
echo $link->label;
The returned object is a Components\CheckoutLink instance with all link properties available as public attributes.

Use cases

Checkout links are well-suited for contexts where you cannot generate a per-user session:
  • Marketing pages — embed a link directly in a landing page without routing through your backend on each visit.
  • Transactional emails — include a “Buy now” link in a drip campaign or notification email.
  • Static sites — add a payment button to a documentation page or changelog without a server-side component.
  • “Pay what you want” products — share a single link on social media for a product with a flexible price.
Because checkout links are not tied to a user session, the customer’s details (name, email) will not be pre-filled. If you need to pre-fill customer data, use $user->checkout(...) instead, which creates a session-based checkout attached to the authenticated user.