--- title: "Preview Update" openapi: "openapi POST /v1/billing.preview_update" --- import { DynamicParamField } from "/components/dynamic-param-field.jsx"; import { DynamicResponseField } from "/components/dynamic-response-field.jsx"; import { DynamicResponseExample } from "/components/dynamic-response-example.jsx"; ### Body Parameters The ID of the customer to attach the plan to. The ID of the entity to attach the plan to. The ID of the plan. If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan. The ID of the feature to set quantity for. The quantity of the feature. Whether the customer can adjust the quantity. The version of the plan to attach. Customize the plan to attach. Can override the price, items, free trial, or a combination. Base price configuration for a plan. Base price amount for the plan. Billing interval (e.g. 'month', 'year'). Number of intervals per billing cycle. Defaults to 1. Override the items in the plan. The ID of the feature to configure. Number of free units included. Balance resets to this each interval for consumable features. If true, customer has unlimited access to this feature. Reset configuration for consumable features. Omit for non-consumable features like seats. Interval at which balance resets (e.g. 'month', 'year'). For consumable features only. Number of intervals between resets. Defaults to 1. Pricing for usage beyond included units. Omit for free features. Price per billing_units after included usage. Either 'amount' or 'tiers' is required. Tiered pricing. Either 'amount' or 'tiers' is required. Billing interval. For consumable features, should match reset.interval. Number of intervals per billing cycle. Defaults to 1. Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200). 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go. Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Proration settings for prepaid features. Controls mid-cycle quantity change billing. Billing behavior when quantity increases mid-cycle. Credit behavior when quantity decreases mid-cycle. Rollover config for unused units. If set, unused included units carry over. Max rollover units. Omit for unlimited rollover. When rolled over units expire. Number of periods before expiry. Free trial configuration for a plan. Number of duration_type periods the trial lasts. Unit of time for the trial ('day', 'month', 'year'). If true, payment method required to start trial. Customer is charged after trial ends. Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send_invoice collection method. When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send_invoice collection method. If true, enables the plan immediately even though the invoice is not paid yet. If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review. How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. ### Response The ID of the customer. List of line items for the current billing period. The title of the line item. A detailed description of the line item. The amount in cents for this line item. List of discounts applied to this line item. The total amount in cents for the current billing period. The three-letter ISO currency code (e.g., 'usd'). Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles. Unix timestamp (milliseconds) when the next billing cycle starts. The total amount in cents for the next cycle. ```json 200 { "customerId": "charles", "lineItems": [ { "title": "Pro seed", "description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)", "amount": 20, "discounts": [] } ], "total": 20, "currency": "usd" } ```