Returns a list of your subscription items for a given subscription.
Parameters
- subscriptionstringRequired
The ID of the subscription whose items will be retrieved.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
subscription items, starting after subscription item starting_
. Each entry in the array is a separate subscription item object. If no more subscription items are available, the resulting array will be empty.
{ "object": "list", "url": "/v1/subscription_items", "has_more": false, "data": [ { "id": "si_OCgWsGlqpbN4EP", "object": "subscription_item", "created": 1688507587, "metadata": {}, "price": { "id": "price_1NQH9iLkdIwHu7ix3tkaSxhj", "object": "price", "active": true, "billing_scheme": "per_unit", "created": 1688507586, "currency": "usd", "custom_unit_amount": null, "livemode": false, "lookup_key": null, "metadata": {}, "nickname": null, "product": "prod_OCgWE6cbwiSu27", "recurring": { "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": "1000" }, "quantity": 1, "subscription": "sub_1NQH9iLkdIwHu7ixxhHui9yi", "tax_rates": [] } ]}
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
Parameters
- proration_
behaviorenum Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resetting
billing_
, or starting a trial), or if an item’scycle_ anchor=now quantity
changes. The default value iscreate_
.prorations Possible enum valuesalways_
invoice Always invoice immediately for prorations.
create_
prorations Will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions.
none
Disable creating prorations in this request.
More parameters
- clear_
usageboolean - proration_
datetimestamp
Returns
An subscription item object with a deleted flag upon success. Otherwise, this call raises an error, such as if the subscription item has already been deleted.
{ "id": "si_NcLYdDxLHxlFo7", "object": "subscription_item", "deleted": true}
A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.
Related guide: Subscription schedules
You can add one or multiple tax IDs to a customer or account. Customer and account tax IDs get displayed on related invoices and credit notes.
Related guides: Customer tax identification numbers, Account tax IDs
Test Clocks Test helper
A test clock enables deterministic control over objects in testmode. With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.