SDK Integration
The PriceParity SDK is a lightweight JavaScript snippet that detects a visitor's location, looks up the correct PPP discount, and injects a Paddle coupon code automatically at checkout.
Installation
Add the script tag to any page where Paddle checkout is triggered — place it before your Paddle.js script.
Your API key is in Dashboard → Settings → API Key.
Script tag attributes
| Attribute | Required | Description |
|---|---|---|
| data-pp-key | Yes | Your PriceParity API key (Dashboard → Settings). |
| data-pp-product | Yes | The Paddle product or price ID to apply PPP discounts to. |
| data-pp-api | No | API base URL. Defaults to https://api.priceparity.net. Only change for self-hosted deployments. |
| data-pp-debug | No | Set to "true" to enable console logs for troubleshooting. |
How the SDK works
Async load
The script loads asynchronously and never blocks page rendering.
Geo detection
The SDK calls the PriceParity API with your API key and product ID. The server detects the visitor's country from their IP address.
Rule matching
The API checks your active pricing rules and tiers to find the correct discount percentage for that country.
Coupon injection
If a discount applies, the API returns a Paddle coupon code. The SDK passes it to Paddle Checkout automatically.
VPN protection
If VPN blocking is enabled on a tier, the API detects VPN/proxy IPs and skips the discount to prevent abuse.
Full example
A minimal checkout page with PriceParity + Paddle.js v2:
Troubleshooting
No discount is applied
Check that the visitor's country has a matching tier in your pricing rule and the rule is active. Add data-pp-debug="true" to see console output.
SDK does nothing on localhost
The SDK only fires on public IPs. Use a VPN or deploy to a staging server to test geo-detection.
401 error in the browser console
Your API key is invalid or the product ID does not belong to this account. Verify both in Dashboard → Settings.
Trial quota exceeded
You have used all 200 evaluations in the current 30-day window. Upgrade to Pro for unlimited evaluations.
Coupon code is not applied at Paddle checkout
Ensure PriceParity SDK loads before Paddle.js. Check that your Paddle integration is using the Checkout.open() method — the SDK hooks into this call.
Still stuck? Email support →