POST
stripe_subscriptions_update.py
from charter.packs import stripe
result = await stripe.subscriptions_update.ainvoke({"subscription": ...})
Path parameters
| Field | Type | Description |
|---|---|---|
subscription * | string | The ID of the subscription to update. |
Body
| Field | Type | Description |
|---|---|---|
description | string | An arbitrary string attached to the subscription. max length 500 |
metadata | map of string | Set of key-value pairs attached to the subscription. |
trialEnd | string | integer | When the trial ends: the string ‘now’ to end it immediately, or a Unix timestamp at most two years out. Overrides any trial the plan defines. A timestamp is seconds, not milliseconds: 1700000000, not 1700000000000. |
cancelAt | integer | CancelAtSentinel | string | When to cancel: a Unix timestamp, or one of ‘max_billed_until’, ‘max_period_end’, ‘min_period_end’. A timestamp before the current period ends prorates if prorations are enabled. Pass an empty string to clear a cancellation that was scheduled earlier; cancel_at_period_end does not clear a timestamp. A timestamp is seconds, not milliseconds: 1700000000, not 1700000000000. |
collectionMethod | CollectionMethod | How to collect payment. Absent, Stripe charges automatically. |
daysUntilDue | integer | Days until an invoice is due. Valid only when collection_method is ‘send_invoice’. ≥ 0 |
defaultPaymentMethod | string | The payment method to charge. It must already belong to this subscription’s customer. |
items | SubscriptionItemUpdate[] | The items to change, up to 20. Absent, the items are left alone. max 20 items |
cancelAtPeriodEnd | boolean | Whether the subscription cancels at the end of the current period. Send it only to change the setting. |
prorationBehavior | ProrationBehaviorOnUpdate | How to handle prorations when the billing cycle or an item quantity changes. Absent, Stripe creates them. |
paymentBehavior | PaymentBehaviorOnUpdate | What to do if payment for the update fails. Absent, Stripe allows the subscription to go past_due. |
prorationDate | integer | A Unix timestamp to calculate prorations against, as though the update happened then. Absent, Stripe uses now. A timestamp is seconds, not milliseconds: 1700000000, not 1700000000000. |
cancellationDetails | CancellationDetails | Why the subscription is being cancelled. |
discounts | SubscriptionDiscount[] | Coupons and promotion codes. A populated array replaces the subscription’s existing discounts. Absent, they are left alone. |