checkout
Redirects the customer to the checkout page with their cart contents.Parameters
string
Pre-applied coupon code
CheckoutOptions
Example: Checkout with Coupon
buildCheckoutUrl
Builds the checkout URL without redirecting. Useful for opening in a new tab or iframe.Parameters
string
Coupon code to pre-apply
string
Checkout language (e.g., ‘en’, ‘de’, ‘fr’)
Example: Open Checkout in New Tab
buildCheckoutUrlSync (Deprecated)
Coupons
validateCoupon
Validates a coupon code before checkout. Affiliate/referral codes are separate from coupons and should usevalidateAffiliateCode or applyAffiliateCode.
Parameters
string
required
Coupon code to validate
string
Product ID to check product-specific coupons
string
Selected variant ID to check variant-specific coupons. Requires
options.productId.Response
CouponValidation
Affiliate Codes
validateAffiliateCode
Validates an affiliate/referral code without storing it.applyAffiliateCode
Validates and stores the normalized affiliate code.checkout() sends the stored code as affiliate_code.
Example: Coupon Input with Validation
Checkout Flow
After Checkout
After successful checkout, the cart is automatically cleared. If you need to handle the return:Next Steps
Cart API
Manage shopping cart items before checkout
Webhooks Guide
Get notified when orders are paid or cancelled