Stripe Price ID → Price Calculator
This tool converts a Stripe Price ID into a calculated price. Give it a Stripe Price ID, a restricted API key scoped to read-only price access, and a unit quantity — and it returns the total amount in the price's currency.
No account needed. The endpoint is public.
How it works
- The API fetches the Stripe Price object using your restricted key.
- It converts the price into a decision model (JDM document).
- It evaluates the model against your inputs and returns the calculated total.
Currently supports per-unit billing schemes only.
Try it
Fill in your Stripe Price ID, a read-only restricted key, and a quantity, then send the request.
POST /calculations/prices
| Field | Type | Required | Description |
|---|---|---|---|
stripePriceId | string | Yes | The Stripe Price ID (e.g. price_abc123) |
stripeRestrictedKey | string | Yes | A Stripe restricted key with read-only access to prices |
inputs.unitQuantity | number | Yes | The number of units to calculate the price for |
Code
Responses
Code
totalAmount is returned in the smallest currency unit (e.g. cents for USD). Divide by 100 to get the display amount.
Creating a restricted key
To keep things secure, use a Stripe restricted key scoped to read-only access on Prices only. Do not use your secret key.
- Go to Stripe Dashboard → Developers → API keys → Restricted keys
- Create a key with
Prices: Readpermission only - Use that key as
stripeRestrictedKeyin your request
Error responses
| Status | Meaning |
|---|---|
400 | Missing or invalid request fields |
404 | Stripe Price ID not found |
422 | Price is inactive or uses an unsupported billing scheme |
502 | Could not reach Stripe |
Last modified on