Zum Hauptinhalt springen
POST
cURL

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Scopes

price-plan:write

Body

The new PricePlan resource

product
any
erforderlich

The product this price plan belongs to.

type
any
erforderlich

The type of the charge. This defines how the price is calculated. A flat_fee price of a usage-based product (a product with a billable metric or a metered measurement) needs a billable metric with the usage aggregation mode billing_cycle; a new price, or a change of the type, that breaks this rule answers 422 at type (code PRICE_PLAN__FLAT_FEE_USAGE_PRICE_WITHOUT_METRIC or PRICE_PLAN__FLAT_FEE_USAGE_PRICE_REALTIME_METRIC).

Possible values:

  • flat_fee: A flat fee is charged, e.g. 10€ per month independent of the number of units.
  • volume: A volume based price is charged, e.g. 10€ for the first 10 units and 9€ for all units when the number of units is above 10. Useful for volume discounts.
  • percentage: A percentage of the total price is charged, e.g. 10% of the total price multiplied by the number of units. Useful for provisions.
  • per_unit: A price per unit is charged, e.g. 10€ per unit per billing interval. Useful for per seat based pricing.
  • tiered: A tiered price is charged. E.g. 10€ per unit for the first 10 units, 9€ per unit for the next 10 units and 8€ per unit for all units above 20.
  • stair_step: A stair step price is charged. E.g. 10€ per unit for the first 10 units, 9€ per unit for all units above 10.
Beispiel:

"flat_fee"

currencyCode
string
erforderlich

The currency of the price

Beispiel:

"EUR"

price
Flat fee · object
erforderlich
internalName
string | null

The internal name of the price plan.

Required string length: 3 - 255
Beispiel:

"Exclusive pricing for partners."

customer
string<uuid> | null

This price is only available for a specific customer. If this is set, the price is only available for the customer with the given ID. All other price plans will be ignored.

Beispiel:

"https://example.com/"

applyTrial
boolean
Standard:true

If this is set to true, the price plan can be applied on a trial. If the product is in trial, and this is false, the price will be charged on subscription start, otherwise after trial.

Beispiel:

true

payInAdvance
boolean | null
Standard:true

If this is set to true, the price will be charged in advance. If this is false, the price will be charged at the end of the billing interval.

Beispiel:

true

proRata
boolean
veraltet

Deprecated: use changeSettlement. True when changeSettlement.increase is prorated, always false for a one-time price. When written, true sets changeSettlement to prorated, credit_prorated, next_invoice and false sets it to full, credit_full, next_invoice. Sent together with changeSettlement, both must agree, otherwise the request answers 422 with the violation code price_plan.pro_rata.conflicts_with_change_settlement. As before, true charges a partial billing interval of a recurring price pro rata.

changeSettlement
object

The settlement default of the price: how a change inside a billed period (quantity, price, items) is settled when the change names no settlement of its own. Changes through the older change routes, for example POST /subscription-items/{id}/change-quantity, use it, and the wallet pre-selects it in the change dialog. A new recurring price sent without changeSettlement and without proRata gets prorated, credit_prorated, next_invoice; a new one-time price gets full, credit_full, next_invoice. An update without the field keeps the stored value. When the object is sent, all three fields are required; an unknown or missing value answers 422 with the violation code price_plan.change_settlement.invalid at changeSettlement.<field>.

freeUnits
number · null · null

The amount of free units. If null, no free units are available. Free units will be applied before passed to the price calculation and are available prorated. If the customer does not uses the free units during a billing period, they are not carried over to the next billing period. If the customer cancels the subscription before ending the billing period, the free units are only available prorated for the remaining billing period.

Example: You offer 2400 free units for 12 months and your price has a billing interval for 1 month. The customer cancels after 6 months. Only 1200 free units are available.

A price plan for a recurring product cannot have free units. Use a metered product instead.

A price plan related to a product of type charge cannot have free units.

Beispiel:

1

billingInterval
object | null

The billing interval of the price plan. If null, this is a one-time charge. Billing intervals of null cannot be prorated. A price of a usage-based product needs a billing interval; a new one-time price of such a product, or a change to null, answers 422 at billingInterval (code PRICE_PLAN__USAGE_PRICE_ONE_TIME).

Beispiel:

"1M"

showPricePerInterval
object | null

Display the billed price per interval in customerfront or invoices. If null, the price will be shown per billing interval. Currently only available for billing intervals of months, years. Currently only allowed to show price per month (1M)

Beispiel:

"1M"

Antwort

PricePlan resource created

type
any
erforderlich

The type of the charge. This defines how the price is calculated. A flat_fee price of a usage-based product (a product with a billable metric or a metered measurement) needs a billable metric with the usage aggregation mode billing_cycle; a new price, or a change of the type, that breaks this rule answers 422 at type (code PRICE_PLAN__FLAT_FEE_USAGE_PRICE_WITHOUT_METRIC or PRICE_PLAN__FLAT_FEE_USAGE_PRICE_REALTIME_METRIC).

Possible values:

  • flat_fee: A flat fee is charged, e.g. 10€ per month independent of the number of units.
  • volume: A volume based price is charged, e.g. 10€ for the first 10 units and 9€ for all units when the number of units is above 10. Useful for volume discounts.
  • percentage: A percentage of the total price is charged, e.g. 10% of the total price multiplied by the number of units. Useful for provisions.
  • per_unit: A price per unit is charged, e.g. 10€ per unit per billing interval. Useful for per seat based pricing.
  • tiered: A tiered price is charged. E.g. 10€ per unit for the first 10 units, 9€ per unit for the next 10 units and 8€ per unit for all units above 20.
  • stair_step: A stair step price is charged. E.g. 10€ per unit for the first 10 units, 9€ per unit for all units above 10.
Beispiel:

"flat_fee"

currencyCode
string
erforderlich

The currency of the price

Beispiel:

"EUR"

price
Flat fee · object
erforderlich
id
string
read-only

The unique identifier of the price plan.

Beispiel:

"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"

internalName
string | null

The internal name of the price plan.

Required string length: 3 - 255
Beispiel:

"Exclusive pricing for partners."

status
any
Standard:active
read-only

The status of the price plan.

Possible values:

  • active: The price is active and can be used.
  • archived: The price is archived and cannot be used anymore. It will be not shown in any lists until explicitly requested.
Beispiel:

"active"

salesChannel
object | null

This price is only available for a specific sales channel. If this is set, the price is only available for the sales channel with the given ID. All other price plans will be ignored.

applyTrial
boolean
Standard:true

If this is set to true, the price plan can be applied on a trial. If the product is in trial, and this is false, the price will be charged on subscription start, otherwise after trial.

Beispiel:

true

payInAdvance
boolean | null
Standard:true

If this is set to true, the price will be charged in advance. If this is false, the price will be charged at the end of the billing interval.

Beispiel:

true

proRata
boolean
veraltet

Deprecated: use changeSettlement. True when changeSettlement.increase is prorated, always false for a one-time price. When written, true sets changeSettlement to prorated, credit_prorated, next_invoice and false sets it to full, credit_full, next_invoice. Sent together with changeSettlement, both must agree, otherwise the request answers 422 with the violation code price_plan.pro_rata.conflicts_with_change_settlement. As before, true charges a partial billing interval of a recurring price pro rata.

changeSettlement
object

The settlement default of the price: how a change inside a billed period (quantity, price, items) is settled when the change names no settlement of its own. Changes through the older change routes, for example POST /subscription-items/{id}/change-quantity, use it, and the wallet pre-selects it in the change dialog. A new recurring price sent without changeSettlement and without proRata gets prorated, credit_prorated, next_invoice; a new one-time price gets full, credit_full, next_invoice. An update without the field keeps the stored value. When the object is sent, all three fields are required; an unknown or missing value answers 422 with the violation code price_plan.change_settlement.invalid at changeSettlement.<field>.

freeUnits
number · null · null

The amount of free units. If null, no free units are available. Free units will be applied before passed to the price calculation and are available prorated. If the customer does not uses the free units during a billing period, they are not carried over to the next billing period. If the customer cancels the subscription before ending the billing period, the free units are only available prorated for the remaining billing period.

Example: You offer 2400 free units for 12 months and your price has a billing interval for 1 month. The customer cancels after 6 months. Only 1200 free units are available.

A price plan for a recurring product cannot have free units. Use a metered product instead.

A price plan related to a product of type charge cannot have free units.

Beispiel:

1

billingInterval
object | null

The billing interval of the price plan. If null, this is a one-time charge. Billing intervals of null cannot be prorated. A price of a usage-based product needs a billing interval; a new one-time price of such a product, or a change to null, answers 422 at billingInterval (code PRICE_PLAN__USAGE_PRICE_ONE_TIME).

Beispiel:

"1M"

showPricePerInterval
object | null

Display the billed price per interval in customerfront or invoices. If null, the price will be shown per billing interval. Currently only available for billing intervals of months, years. Currently only allowed to show price per month (1M)

Beispiel:

"1M"

custom
boolean
read-only

If this price plan is a custom price plan. A price plan is custom if it is defined specific for a customer, a sales channel or a plan.

Beispiel:

true

product
any
read-only

The product this price plan belongs to.

customer
any
read-only

The customer this price plan belongs to.

inUse
boolean
read-only

If this price plan is in use.

Beispiel:

true

The checkout link IDs related to this price plan.

Beispiel: