Skip to main content

CreatePriceRequest

A RECURRING price requires recurring. A ONE_TIME price must not have it.

productIdstring<uuid>required

The product of the price. It cannot change after the price is created.

Example: 8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60
unitAmountinteger<int32>required

The amount of the price: for each billing period of a RECURRING price, once for a ONE_TIME price. A positive integer in the smallest currency unit (for example, 1990 cents to charge 19.90 EUR). Without tax for an EXCLUSIVE price.

Possible values: >= 1

Example: 1990
currencyPayment-Currency

Three-letter ISO currency code, in uppercase. Defaults to the default currency of your account, else EUR.

Example: EUR
typePrice-Type

How the price bills: RECURRING (the default) or ONE_TIME. Only a RECURRING price can start or switch a subscription. Treat the set as open: more values can be added later.

Default value: RECURRING
Example: RECURRING
recurring object

The billing period of a RECURRING price. Absent on a ONE_TIME price. A subscription created from the price copies these values.

intervalPrice-Intervalrequired

The unit of the billing period. minute and hour are accepted in test mode only.

Possible values: [minute, hour, day, week, month, year]

Example: month
intervalCountinteger<int32>required

Number of intervals between payments. The billing period cannot be longer than one year.

Possible values: >= 1

Example: 1
trialPeriodDaysinteger<int32>

Number of trial days of a subscription created from the price.

Possible values: >= 1 and <= 1825

Example: 7
taxBehaviorTaxBehavior

How the tax of the product's tax rate applies to unitAmount:

  • INCLUSIVE: unitAmount holds the tax.
  • EXCLUSIVE: the tax is added to unitAmount.

No value means INCLUSIVE. Treat the set as open: more values can be added later.

Example: EXCLUSIVE
activePrice-Active

Whether the price is active. An inactive price cannot start a subscription, and a subscription cannot switch to it. Prices are never deleted: set active to false to archive one. Subscriptions that already use it keep their copy of its values. A new price is active unless created with active: false.

Example: true
nicknamePrice-Nickname

An internal label of the price. Buyers never see it.

Possible values: <= 100 characters

Example: Monthly
metadataobject

A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.

Example: {"systemId":"12345"}
CreatePriceRequest
{
"productId": "8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60",
"unitAmount": 1990,
"currency": "EUR",
"type": "RECURRING",
"recurring": {
"interval": "month",
"intervalCount": 1,
"trialPeriodDays": 7
},
"taxBehavior": "EXCLUSIVE",
"active": true,
"nickname": "Monthly",
"metadata": {
"systemId": "12345"
}
}