Get Direct Checkout URL
checkout.links.get_direct_urlGenerate a verified 1-click checkout URL for a chosen product size, with optional coupon and quantity. Resolve size labels to variant indexes to create a direct purchase link.
Instructions
Generate the direct 1-click checkout purchase URL for a specific product handle and size variant index (https://s.polopan.com/p/{handle}/{size_index}).
PURPOSE & DISAMBIGUATION:
Produces the final, verified 1-click buy link configured with the user's selected size index, unit quantity, and pre-applied coupon code.
Distinct from browsing links: General browsing uses base link (https://s.polopan.com/p/{handle}); this tool generates size-specific purchase permalinks (https://s.polopan.com/p/{handle}/{size_index}).
WHEN TO USE:
ONLY after the user has explicitly selected and confirmed their size (e.g. 'I want size M' or 'size 40').
WHEN NOT TO USE:
Do NOT provide direct checkout URLs with /{size_index} during initial product browsing, shortlisting, or if size is ambiguous (use base link https://s.polopan.com/p/{handle}).
BEHAVIOR & SAFETY:
Read-only link generator with no persistent state modifications or charges.
Automatically resolves variant index if a size string (e.g. 'M', 'L') is provided without size_index.
Encodes optional coupon parameters and quantity parameters into the final URL.
PARAMETERS & CONSTRAINTS:
'handle' (string, required): Unique product handle identifier.
'size' (string, optional): Size label confirmed by user (e.g. 'M', 'L', 'XL', '42').
'size_index' (integer >= 0, optional): Zero-based index of the chosen size variant.
'quantity' (integer 1-10, default 1): Number of units to purchase.
'coupon' (string, optional): Optional discount coupon code to pre-apply (e.g. 'SAVE15').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Size label confirmed by the user (e.g. 'M', 'L', 'XL', '40') | |
| coupon | No | Optional discount coupon code to pre-apply in the checkout session | |
| handle | Yes | Unique product handle identifier (e.g. 'solid-linen-shirt', 'shopify_11206') | |
| quantity | No | Number of units to purchase (1 to 10, default 1) | |
| size_index | No | Zero-based index of the chosen size variant |