Add lemonSqueezy buy now button to your site

The ParityDeals Buy Now API allows users to integrate a dynamic buy-now button on their websites that interacts with LemonSqueezy to manage global pricing and checkout sessions based on the visitor’s location.

ParityDeals Buy Now API Documentation

Overview

The ParityDeals Buy Now API allows users to integrate a dynamic buy-now button on their websites that interacts with LemonSqueezy to manage global pricing and checkout sessions based on the visitor’s location. This API handles geographical pricing discrepancies and ensures users see the correct pricing for their location during checkout.

Endpoint

GET https://api.paritydeals.com/api/v1/lemon-squeezy-buy-now/

This endpoint creates a checkout session with LemonSqueezy and applies geographic pricing and discounts as configured in ParityDeals.

Parameters

  • store_id (required): The unique identifier for the store on LemonSqueezy.
  • variants (required): A comma-separated list of product variant IDs available for purchase. The first ID in this list will be pre-selected in the checkout session.
  • pd_suite_id (required): The ParityDeals deal identifier used to apply specific pricing and discounts.
  • success_url (required): The URL to which a user will be redirected after a successful purchase.

Behavior

  • Geographic Pricing: When a user accesses the checkout page via the generated buy-now link, the API automatically fetches and applies pricing based on the user’s location. For example, if the product is priced at $100 in the US and $50 in India, a user from India will see the price as $50 at checkout.
  • Variant Handling: In cases where multiple product variants are available, the API sets the first variant in the variants parameter as the default selection. If a user switches between variants, a temporary discount coupon is generated to maintain the correct price. This coupon:
    • Can be used only once.
    • Expires in 30 minutes.
    • Is automatically applied to ensure the price adjusts without reverting to the default.

Example Usage

Here is how you can construct a URL for integrating the API with a buy-now button on a website:

<a href="https://api.paritydeals.com/api/v1/lemon-squeezy-buy-now/?store_id=2757
&variants=34813,64877,94575&pd_suite_id=792
&success_url=https://www.lightgalleryjs.com/">Buy Now</a>