Saltar al contenido principal

CheckoutSessionLineItem

One line of a checkout session. It is a copy taken when the session was created: a later change of the price, product or tax rate does not change it.

priceIdstring<uuid>required

The price of the line.

Example: 3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13
productIdstring<uuid>required

The product of the price.

Example: 8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60
productNamestringrequired

The product name.

Example: Gold plan
descriptionstring

The product description.

Example: Unlimited access to every course
quantityinteger<int32>required

The number of units.

Example: 1
unitAmountinteger<int32>required

The amount of one unit, in the smallest currency unit. Without tax for an EXCLUSIVE price.

Example: 1653
typePrice-Typerequired

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
tax object

The tax of a subscription, copied from the tax rate of its product when priceId was set. A later change of the product's tax rate does not change it: only a switch to a price does.

taxRateIdstring<uuid>required

Unique identifier for the tax rate.

Example: 9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d
displayNameTaxRate-DisplayNamerequired

The name of the tax shown to the buyer.

Possible values: non-empty and <= 50 characters

Example: IVA
percentageTaxRate-Percentagerequired

The rate in percent, with up to 4 decimals. It cannot change after the tax rate is created.

Possible values: >= 0 and <= 100

Example: 21
taxTypeTaxRate-TaxTyperequired

The kind of tax: VAT, IGIC (Canary Islands) or IPSI (Ceuta and Melilla). It cannot change after the tax rate is created. Treat the set as open: more values can be added later.

Default value: VAT
Example: VAT
behaviorTaxBehaviorrequired

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
amountinteger<int32>required

The tax part of the subscription amount, in the smallest currency unit. 0 for a 0% rate.

Possible values: >= 0

Example: 210
billedInFirstPaymentbooleanrequired

Whether the first payment charges the line. A recurring price with a trial is charged when the trial ends, so its line has false.

Example: true
amountSubtotalinteger<int32>required

The line amount without tax, in the smallest currency unit.

Example: 1653
amountTaxinteger<int32>required

The tax of the line, in the smallest currency unit.

Example: 347
amountTotalinteger<int32>required

The line amount with tax, in the smallest currency unit.

Example: 2000
CheckoutSessionLineItem
{
"priceId": "3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13",
"productId": "8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60",
"productName": "Gold plan",
"description": "Unlimited access to every course",
"quantity": 1,
"unitAmount": 1653,
"type": "RECURRING",
"recurring": {
"interval": "month",
"intervalCount": 1,
"trialPeriodDays": 7
},
"tax": {
"taxRateId": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
"displayName": "IVA",
"percentage": 21,
"taxType": "VAT",
"behavior": "EXCLUSIVE",
"amount": 210
},
"billedInFirstPayment": true,
"amountSubtotal": 1653,
"amountTax": 347,
"amountTotal": 2000
}