Using Priceur API
Authentication
To authenticate with Priceur API, pass a key
HTTP parameter. You will find your key on your Dashboard.
Example: https://priceur.com/api/v1/plans?key=public_test_123EXAMPLE321
Priceur gives you 2 keys for each connected Stripe account:
- A public key: use this key for client side integration. With this key, only public (non archived) plans will be returned.
- A private key: only use this key for server-side integration. With this key, ALL plans will be returned, including archived plans. Private keys allow additional query parameters (see below).
GET /api/v1/plans: get the list of plans in localized currency
This will return the list of all plans in the currency relevant to the requesting user.
HTTP parameters:
Parameter | Presence | Value | Description |
---|---|---|---|
key |
Mandatory | Priceur API Key | The API key (either private or public) corresponding to the Stripe account you want |
ip |
Optional | IP address |
Specify the IP of the originator used to determine relevant plans currency. If not present, Priceur will use the IP of the incoming request. Note: This parameter only works when using a private API key. |
currency |
Optional | Currency code |
Force the currency of the plans to return. If not present, Priceur will either use the ip parameter or IP of the incoming request.Note: This parameter only works when using a private API key. |
Request Examples:
- Base usage:
GET https://priceur.com/api/v1/plans?key=public_test_123EXAMPLE321
- Force IP address:
GET https://priceur.com/api/v1/plans?key=private_test_123EXAMPLE321&ip=1.2.3.4
- Force Currency:
GET https://priceur.com/api/v1/plans?key=private_test_123EXAMPLE321¤cy=USD
Result example:
{
"currency_code":"EUR",
"live_mode":true,
"provider":"stripe"
"plans":{
"test_plan":{
"provider_id":"test_plan",
"aggregate_usage":null,
"billing_scheme":"per_unit",
"interval":"month",
"nickname":"This is a Plan for testing",
"usage_type":"licensed",
"active":true,
"livemode":false,
"amount":{
"decimal":"149.00",
"full":14900,
"major":"149",
"minor":"00",
"tag":"149\u20ac",
"tag_with_decimal":"149.00\u20ac"
},
"interval_count":1,
"trial_period_days":null,
"metadata":{
"example_metadata":"example value",
"legacy":"true"
},
"tiers":null,
"transform_usage":null,
"product":{
"name":"Test Product",
"metadata":{
}
},
"currency":{
"active":true,
"template":"1$",
"code":"EUR",
"symbol":"\u20ac",
"name":"Euro",
"name_plural":"euros",
"symbol_native":"\u20ac",
"decimal_digits":2,
"symbol_after":"\u20ac",
"symbol_before":""
},
"description":"Test Plan (149\u20ac/month)"
},
"other_plan":{ /* ... */ },
// More plans...
},
}
GET /api/v1/plan/:provider_id : get a specific plan
This will return the plan passed in parameter in the currency relevant to the requesting user.
URL parameter:
Parameter | Presence | Value | Description |
---|---|---|---|
:provider_id |
Mandatory | Provider ID | The Stripe plan ID of the plan in the primary currency. |
HTTP parameters:
Parameter | Presence | Value | Description |
---|---|---|---|
key |
Mandatory | Priceur API Key | The API key (either private or public) corresponding to the Stripe account you want |
ip |
Optional | IP address |
Specify the IP of the originator used to determine plan currency. If not present, Priceur will use the IP of the incoming request. Note: This parameter only works when using a private API key. |
currency |
Optional | Currency code |
Force the currency choice, overriding IP-based geolocation. If not present, Priceur will either use the ip parameter or IP of the incoming request.Note: This parameter only works when using a private API key. |
Request Example:
GET https://priceur.com/api/v1/plan/test_plan?key=public_test_123EXAMPLE321
Result example:
Same as above except that only one plan is returned.