Trial Offers v1

Trial offers let you define free or paid introductory pricing for a subscription item. A TrialOffer specifies the price to charge during the trial, how many billing intervals the trial lasts, and what price the subscription item transitions to when the trial ends. You attach a TrialOffer to a subscription item using items[current_trial][trial_offer] when creating or updating a subscription.

Was this section helpful?YesNo
Create a trial offer
POST/v1/product_catalog/trial_offers
Update a trial offer
POST/v1/product_catalog/trial_offers/:id
Retrieve a trial offer
GET/v1/product_catalog/trial_offers/:id
List trial offers
GET/v1/product_catalog/trial_offers

The Trial Offer object v1

Attributes

  • idstring

    Unique identifier for the object.

  • activeboolean

    Whether the trial offer is active. Set to false to archive the trial offer.

  • durationobject

    The duration of the trial offer.

  • end_behaviorobject

    The behavior of the trial offer when it ends.

  • nicknamenullable string

    A brief description of the trial offer, hidden from customers.

    The maximum length is 255 characters.

  • pricestringExpandable

    The price during the trial offer.

More attributes

  • objectstring, value is "product_catalog.trial_offer"

  • livemodeboolean

The Trial Offer object
{
"id": "to_1Hh5Xx2eZvKYlo2C8JaUOv4R",
"object": "product_catalog.trial_offer",
"livemode": false,
"active": true,
"duration": {
"relative": {
"iterations": 2
},
"type": "relative"
},
"end_behavior": {
"transition": {
},
"type": "transition"
},
}

Create a trial offer v1

POST /v1/product_catalog/trial_offers

Creates a trial offer.

Parameters

  • durationobjectRequired

    Duration of one service period of the trial.

  • end_behaviorobjectRequired

    Define behavior that occurs at the end of the trial.

  • pricestringRequired

    Price configuration during the trial period (amount, billing scheme, etc).

  • activeboolean

    Whether the trial offer can be used for new subscriptions. Defaults to true.

  • nicknamestring

    A brief description of the trial offer, hidden from customers.

    The maximum length is 255 characters.

Returns

Returns a trial offer object if the call succeeded.

curl https://api.stripe.com/v1/product_catalog/trial_offers \
-u "sk_test_BQokikJOvBiI2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d "duration[relative][iterations]=2" \
-d "end_behavior[transition][price]=" \
-d price=
Response
{
"id": "to_1Hh5Xx2eZvKYlo2C8JaUOv4R",
"object": "product_catalog.trial_offer",
"livemode": false,
"active": true,
"duration": {
"relative": {
"iterations": 2
},
"type": "relative"
},
"end_behavior": {
"transition": {
},
"type": "transition"
},
}