1. Fetch from the browser
Call/v1/price once per page load with every Price ID shown on the page (up to 50). Call it from the visitor’s browser, not from your server: the country comes from whoever makes the request, and your server is not in the visitor’s country.
pricing.js
null when anything went wrong.
2. Show the price
Renderdisplay. It is already formatted for the visitor’s currency with the right number of decimals, so do not divide amount by 100 yourself.
PricingCard.jsx
- Render the base price immediately and swap in
displaywhen the response arrives. Never block the page on the request. - When
localizedis true anddiscount_percentis above zero, say so. A short “Pricing for ” line is enough. Showing the base price struck through next to it is common. - When
localizedis false, show nothing extra. The visitor is paying your normal price. - In a premium market
payis above 100 anddiscount_percentis 0. Showdisplayand skip the discount line.
3. Send the Price ID to your server
Wherever you create the Checkout Session, Subscription or Payment Intent today with a hard-coded Price ID, use theprice value from the response instead. The sibling is a real Price in your account, so Stripe treats it like any other.
display value on the page is an estimate in the visitor’s currency for them to read; it is not what Stripe bills. If you use Stripe’s Adaptive Pricing, Checkout may present its own converted amount.
Fallbacks
Your page must look and work exactly as it does today whenever EasyPPP is not reachable or has nothing to say.
The response carries
Cache-Control: no-store. Fetch once per page load and keep the result in memory while the visitor is on the page; there is no limit on requests.
Keys and environments
Use theep_test_ or ep_sbx_ key while developing and switch to ep_live_ when you deploy. Each key returns Prices from its own Stripe environment, so a test key never hands you a live Price ID. Keys are public and safe to ship in client code.
When you are developing, the country is yours. To see a localized result you need to request from a localized country or test with a teammate who is in one.