Skip to content

Stripe: Create a price

Stripe prices.postPrices: arguments, response, policy and SDK examples.

← Prices operations · Get started

Operation stripe.postprices

Provider route: POST /v1/prices. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["prices"]["postPrices"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.prices.postPrices(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.prices.post_prices(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectRequired within parentAdditional keys: not allowed
body.activebooleanOptionalWhether the price can be used for new purchases. Defaults to `true`.
body.billing_schemestringOptionalDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
One of: per_unit, tiered
body.currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
body.currency_optionsobjectOptionalPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
Additional keys: see wildcard field
body.currency_options.*ModelAdditional keysExpand Create a price — request body — body currency options value
body.custom_unit_amountobjectOptionalWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
body.custom_unit_amount.enabledbooleanRequired within parent
body.custom_unit_amount.maximumintegerOptional
body.custom_unit_amount.minimumintegerOptional
body.custom_unit_amount.presetintegerOptional
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.lookup_keystringOptionalA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
Maximum length: 200
body.metadataobjectOptionalSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Additional keys: see wildcard field
body.metadata.*stringAdditional keys
body.nicknamestringOptionalA brief description of the price, hidden from customers.
Maximum length: 5000
body.productstringOptionalThe ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
Maximum length: 5000
body.product_dataobjectOptionalThese fields can be used to create a new product that this price will belong to.
body.product_data.activebooleanOptional
body.product_data.idstringOptionalMaximum length: 5000
body.product_data.metadataobjectOptionalAdditional keys: see wildcard field
body.product_data.metadata.*stringAdditional keys
body.product_data.namestringRequired within parentMaximum length: 5000
body.product_data.statement_descriptorstringOptionalMaximum length: 22
body.product_data.tax_codestringOptionalMaximum length: 5000
body.product_data.tax_detailsobjectOptional
body.product_data.tax_details.performance_locationstringOptionalMaximum length: 5000
body.product_data.tax_details.tax_codeJSONOptional
body.product_data.tax_details.tax_code (anyOf 1)stringAlternative
body.product_data.tax_details.tax_code (anyOf 2)stringAlternativeOne of:
body.product_data.unit_labelstringOptionalMaximum length: 12
body.recurringobjectOptionalThe recurring components of a price such as `interval` and `usage_type`.
body.recurring.intervalstringRequired within parentOne of: day, month, week, year
body.recurring.interval_countintegerOptional
body.recurring.meterstringOptionalMaximum length: 5000
body.recurring.usage_typestringOptionalOne of: licensed, metered
body.tax_behaviorstringOptionalOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
One of: exclusive, inclusive, unspecified
body.tiersarrayOptionalEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
body.tiers[]objectEach item
body.tiers[].flat_amountintegerOptional
body.tiers[].flat_amount_decimalstringOptionalFormat: decimal
body.tiers[].unit_amountintegerOptional
body.tiers[].unit_amount_decimalstringOptionalFormat: decimal
body.tiers[].up_toJSONRequired within parent
body.tiers[].up_to (anyOf 1)stringAlternativeOne of: inf
Maximum length: 5000
body.tiers[].up_to (anyOf 2)integerAlternative
body.tiers_modestringOptionalDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.
One of: graduated, volume
body.transfer_lookup_keybooleanOptionalIf set to true, will atomically remove the lookup key from the existing price, and assign it to this price.
body.transform_quantityobjectOptionalApply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.
body.transform_quantity.divide_byintegerRequired within parent
body.transform_quantity.roundstringRequired within parentOne of: down, up
body.unit_amountintegerOptionalA positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`.
body.unit_amount_decimalstringOptionalSame as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
Format: decimal

Referenced models: Create a price — request body — body currency options value

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create a price — response body

Referenced models: Create a price — response body

11 more schemas are linked from the tables above, on the schema pages.

Create a price — response body
FieldTypePresenceDescription and constraints
$objectRootPrices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
[Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

Related guides: [Set up a subscription](https://docs.stripe.com/billing/subscriptions/set-up-subscription), [create an invoice](https://docs.stripe.com/billing/invoices/create), and more about [products and prices](https://docs.stripe.com/products-prices/overview).
activebooleanRequired within parentWhether the price can be used for new purchases.
billing_schemestringRequired within parentDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
Known values: per_unit, tiered
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
currency_optionsobjectOptionalPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
Additional keys: see wildcard field
currency_options.*ModelAdditional keysExpand Create a price — response body — currency options value
custom_unit_amountJSONOptional
custom_unit_amount (anyOf 1)JSONAlternativeWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
custom_unit_amount (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a price — response body — custom unit amount value maximum, minimum, preset
custom_unit_amount (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
lookup_keyJSONOptional
lookup_key (anyOf 1)stringAlternativeA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
Maximum length: 5000
lookup_key (anyOf 2)nullAlternative
metadataobjectRequired within parentSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeA brief description of the price, hidden from customers.
Maximum length: 5000
nickname (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: price
productJSONRequired within parentThe ID of the product this price is associated with.
product (anyOf 1)stringAlternativeMaximum length: 5000
product (anyOf 2)ModelAlternativeExpand Create a product — response body
product (anyOf 3)ModelAlternativeExpand Delete a product — response body
recurringJSONOptional
recurring (anyOf 1)JSONAlternativeThe recurring components of a price such as `interval` and `usage_type`.
recurring (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a price — response body — recurring / value / interval: day, month, week, year, usage type: licensed, metered
recurring (anyOf 2)nullAlternative
tax_behaviorJSONOptional
tax_behavior (anyOf 1)stringAlternativeOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
Known values: exclusive, inclusive, unspecified
tax_behavior (anyOf 2)nullAlternative
tiersarrayOptionalEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
tiers[]ModelEach itemExpand Create a plan — response body — tiers item
tiers_modeJSONOptional
tiers_mode (anyOf 1)stringAlternativeDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
Known values: graduated, volume
tiers_mode (anyOf 2)nullAlternative
transform_quantityJSONOptional
transform_quantity (anyOf 1)JSONAlternativeApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.
transform_quantity (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a plan — response body — transform_usage / value / round: down, up
transform_quantity (anyOf 2)nullAlternative
typestringRequired within parentOne of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
Known values: one_time, recurring
unit_amountJSONOptional
unit_amount (anyOf 1)JSONAlternative
unit_amount (anyOf 1) (anyOf 1)integerAlternativeThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
unit_amount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
unit_amount (anyOf 2)nullAlternative
unit_amount_decimalJSONOptional
unit_amount_decimal (anyOf 1)stringAlternativeThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
Format: decimal
unit_amount_decimal (anyOf 2)nullAlternative

Referenced models: Create a price — response body — currency options value, Create a price — response body — custom unit amount value maximum, minimum, preset, Delete a product — response body, Create a plan — response body — tiers item, Create a product — response body, Create a price — response body — recurring / value / interval: day, month, week, year, usage type: licensed, metered, Create a plan — response body — transform_usage / value / round: down, up

Create a price — request body — body currency options value
FieldTypePresenceDescription and constraints
$objectRoot
custom_unit_amountobjectOptional
custom_unit_amount.enabledbooleanRequired within parent
custom_unit_amount.maximumintegerOptional
custom_unit_amount.minimumintegerOptional
custom_unit_amount.presetintegerOptional
tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
tiersarrayOptional
tiers[]objectEach item
tiers[].flat_amountintegerOptional
tiers[].flat_amount_decimalstringOptionalFormat: decimal
tiers[].unit_amountintegerOptional
tiers[].unit_amount_decimalstringOptionalFormat: decimal
tiers[].up_toJSONRequired within parent
tiers[].up_to (anyOf 1)stringAlternativeOne of: inf
Maximum length: 5000
tiers[].up_to (anyOf 2)integerAlternative
unit_amountintegerOptional
unit_amount_decimalstringOptionalFormat: decimal
Delete a product — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: product

SDK function policy ID: stripe.postprices. Catalog operation: PostPrices. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.