Skip to main content

Update subscription item

POST 

/subscriptions/:subscriptionId/item/:itemId

Update subscription item.

Authorization Action:

pay:subscriptions:update

Request

Path Parameters

    subscriptionId stringrequired
    itemId stringrequired

Body

required
    price stringrequired

    The ID of the new price object.

    expand string[]

    Specifies which fields in the response should be expanded.

Responses

Schema
    cancel_at number

    A date in the future at which the subscription will automatically get canceled

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    current_period_end numberrequired

    End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

    current_period_start numberrequired

    Start of the current period that the subscription has been invoiced for.

    customer object
    address objectrequired

    The customer's address.

    city string
    country string

    Two-letter country code (ISO 3166-1 alpha-2).

    line1 string

    Address line 1 (e.g., street, block, PO Box, or company name).

    line2 string

    Address line 2 (e.g., apartment, suite, unit, or building).

    postal_code string

    ZIP or postal code.

    state string

    State, county, province, prefecture, or region.

    delinquent booleanrequired

    When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

    email string

    The customer's email address.

    name string

    The customer's full name or business name.

    phone string

    The customer's phone number.

    subscriptions object

    The customer's current subscriptions, if any.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    days_until_due numberrequired

    Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically.

    ended_at number

    If the subscription has ended, the date the subscription ended.

    items object[]required

    List of subscription items, each with an attached price.

  • Array [
  • price objectrequired
    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    active boolean

    Whether the price can be used for new purchases. Defaults to true.

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    currency_options object

    Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.

    recurring object
    interval stringrequired

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

    Specifies billing frequency

    interval_count number

    Possible values: >= 1

    The number of intervals between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).

    trial_period_days number

    Default number of trial days when subscribing a customer to this price.

    usage_type string

    Possible values: [licensed]

    Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed.

    unit_amount_decimal stringrequired

    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.

    quantity number

    The quantity of the plan to which the customer should be subscribed.

    subscription stringrequired

    The subscription this subscription_item belongs to.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • ]
  • metadata object
    start_date numberrequired

    Date when the subscription was first created. The date might differ from the created date due to backdating.

    status stringrequired

    Possible values: [active, all, canceled, ended, incomplete, incomplete_expired, past_due, paused, trialing, unpaid]

    Status of the subscription.

    trial_end number

    If the subscription has a trial, the end of that trial.

    trial_start number

    If the subscription has a trial, the beginning of that trial.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

Loading...