Skip to main content
Docs

CommerceSubscriptionItemResource

The CommerceSubscriptionItemResource type represents an item in a subscription.

Properties

  • Name
    id
    Type
    string
    Description

    The unique identifier for the subscription item.

  • Name
    paymentSourceId
    Type
    string
    Description

    The identifier of the payment source used for the subscription item.

  • Name
    plan
    Type
    Description

    The plan associated with the subscription item.

  • Name
    planPeriod
    Type
    'month' | 'annual'
    Description

    The billing period of the subscription item.

  • Name
    status
    Type
    'active' | 'ended' | 'upcoming' | 'past_due'
    Description

    The current status of the subscription item.

  • Name
    createdAt
    Type
    Date
    Description

    The date when the subscription item was created.

  • Name
    pastDueAt
    Type
    Date | null
    Description

    The date when the subscription item became past due, or null if it's not past due.

  • Name
    periodStartDate
    Type
    Date
    Description

    The start date of the current billing period.

  • Name
    periodEndDate
    Type
    Date | null
    Description

    The end date of the current billing period, or null if not set.

  • Name
    canceledAtDate
    Type
    Date | null
    Description

    The date when the subscription item was canceled, or null if it's not canceled.

  • Name
    periodStart
    Type
    number
    Description

    Deprecated. Use periodStartDate instead. The Unix timestamp for the start of the current billing period.

  • Name
    periodEnd
    Type
    number
    Description

    Deprecated. Use periodEndDate instead. The Unix timestamp for the end of the current billing period.

  • Name
    canceledAt
    Type
    number | null
    Description

    Deprecated. Use canceledAtDate instead. The Unix timestamp for when the item was canceled, or null.

  • Name
    amount
    Type
    | undefined
    Description

    The amount charged for the subscription item.

  • Name
    credit
    Type
    { amount: CommerceMoney } | undefined
    Description

    Credit info for the subscription item, if any.

  • Name
    cancel
    Type
    (params: CancelSubscriptionParams) => Promise<DeletedObjectResource>
    Description

    A function to cancel the subscription item. Accepts the following parameters:

    • orgId? (string): The ID of the organization to cancel the subscription item for.

Feedback

What did you think of this content?

Last updated on