Skip to main content
One endpoint. It takes your public API key and up to 50 Stripe Price IDs and returns the Price ID to charge each visitor, with an amount to display.
Call it from the visitor’s browser. The country comes from the request, and there is no way to pass a country or IP address.

Request

string
required
Your public API key from the dashboard. Starts with ep_live_, ep_test_ or ep_sbx_ and selects that Stripe environment.
string
required
Comma-separated Stripe Price IDs, 1 to 50. Base or sibling IDs both work. price= is accepted for a single ID.
GET and OPTIONS only, no headers. Responses are JSON with Access-Control-Allow-Origin: * and Cache-Control: no-store.

Response

data has one entry per requested ID, in the order you sent them.
string
The Stripe Price ID to charge. A sibling when the visitor is localized, otherwise the base Price.
string
The base Price this entry belongs to. Use it as the key when you request several IDs.
boolean
true when a market sibling was selected.
boolean
false when EasyPPP does not localize this ID for this key. Pricing fields are then null.
string | null
ISO 3166-1 alpha-2 code of the visitor’s country, or null when unknown. No more precise location is returned.
integer | null
Percentage of the base price this visitor pays. 100 when not localized. Above 100 in premium markets.
number | null
100 - pay, or 0 when there is no discount. Never negative.
string | null
Currency of amount and display: the visitor’s currency when a rate is available, otherwise the Price’s own currency.
integer | null
Amount in the smallest unit of currency, following Stripe’s convention (no decimals for JPY and KRW, three for KWD and BHD, two for most others). Prefer display.
string | null
amount formatted with a currency symbol and the correct number of decimals, for example $49.00, CA$66.15, ¥4,900.
boolean
true when amount was converted from the Price’s currency, at the rate from rates_as_of. Display only.
string
The Stripe Price’s currency, which Stripe charges in. Absent for unknown IDs.
integer
What Stripe charges for price, in the smallest unit of base_currency. Absent for unknown IDs.
string
When the exchange rates were published, ISO 8601 UTC. Absent for unknown IDs.
string | null
Include this when contacting support about a response.
boolean
true when localized pricing is paused: by you, because no card is on file, or because Stripe was disconnected. Every entry then holds the base Price.

A visitor who is not localized

The same fields, pointing at the base Price. display is the base price in the visitor’s currency when a rate is known.
Returned for visitors in the base tier, visitors with no known country (country: null, amount in the base currency), visitors on a VPN or proxy with the guard on, and everyone while the account is paused. The response does not say which.

An ID EasyPPP does not know

Errors

Errors are JSON with a single error field. On any error, show your base price and charge your base Price ID.

Limits and timing

The key

The key is public and belongs in client code. It reads localized prices for the Prices you selected and nothing else. Each Stripe connection (live, test mode, sandbox) has its own key.