Stripe: Create a preview invoice
Stripe invoices.postInvoicesCreatePreview: arguments, response, policy and SDK examples.
← Invoices operations · Get started
Operation stripe.postinvoicescreatepreview
Provider route: POST /v1/invoices/create_preview. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["invoices"]["postInvoicesCreatePreview"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.invoices.postInvoicesCreatePreview(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_stripe import StripeIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.invoices.post_invoices_create_preview(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
headers | object | Optional | Additional keys: not allowed |
headers.Idempotency-Key | string | Optional | Minimum length: 1 Maximum length: 255 |
body | object | Optional | Additional keys: not allowed |
body.automatic_tax | object | Optional | Settings for automatic tax lookup for this invoice preview. |
body.automatic_tax.enabled | boolean | Required within parent | |
body.automatic_tax.liability | object | Optional | |
body.automatic_tax.liability.account | string | Optional | |
body.automatic_tax.liability.type | string | Required within parent | One of: account, self |
body.currency | string | Optional | The currency to preview this invoice in. Defaults to that of `customer` if not specified. Format: currency |
body.customer | string | Optional | The identifier of the customer whose upcoming invoice you’re retrieving. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. Maximum length: 5000 |
body.customer_account | string | Optional | The identifier of the account representing the customer whose upcoming invoice you’re retrieving. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set. Maximum length: 5000 |
body.customer_details | object | Optional | Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. |
body.customer_details.address | JSON | Optional | |
body.customer_details.address (anyOf 1) | object | Alternative | |
body.customer_details.address (anyOf 1).city | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 1).country | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 1).line1 | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 1).line2 | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 1).postal_code | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 1).state | string | Optional | Maximum length: 5000 |
body.customer_details.address (anyOf 2) | string | Alternative | One of: |
body.customer_details.shipping | JSON | Optional | |
body.customer_details.shipping (anyOf 1) | object | Alternative | |
body.customer_details.shipping (anyOf 1).address | object | Required within parent | |
body.customer_details.shipping (anyOf 1).address.city | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).address.country | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).address.line1 | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).address.line2 | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).address.postal_code | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).address.state | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).name | string | Required within parent | Maximum length: 5000 |
body.customer_details.shipping (anyOf 1).phone | string | Optional | Maximum length: 5000 |
body.customer_details.shipping (anyOf 2) | string | Alternative | One of: |
body.customer_details.tax | object | Optional | |
body.customer_details.tax.ip_address | JSON | Optional | |
body.customer_details.tax.ip_address (anyOf 1) | string | Alternative | |
body.customer_details.tax.ip_address (anyOf 2) | string | Alternative | One of: |
body.customer_details.tax_exempt | string | Optional | One of: , exempt, none, reverse |
body.customer_details.tax_ids | array | Optional | |
body.customer_details.tax_ids[] | Model | Each item | Expand Create a customer — request body — body tax id data item |
body.discounts | JSON | Optional | The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. |
body.discounts (anyOf 1) | array | Alternative | |
body.discounts (anyOf 1)[] | object | Each item | |
body.discounts (anyOf 1)[].coupon | string | Optional | Maximum length: 5000 |
body.discounts (anyOf 1)[].discount | string | Optional | Maximum length: 5000 |
body.discounts (anyOf 1)[].promotion_code | string | Optional | Maximum length: 5000 |
body.discounts (anyOf 2) | string | Alternative | One of: |
body.expand | array | Optional | Specifies which fields in the response should be expanded. |
body.expand[] | string | Each item | Maximum length: 5000 |
body.invoice_items | array | Optional | List of invoice items to add or update in the upcoming invoice preview (up to 250). |
body.invoice_items[] | object | Each item | |
body.invoice_items[].amount | integer | Optional | |
body.invoice_items[].currency | string | Optional | Format: currency |
body.invoice_items[].description | string | Optional | Maximum length: 5000 |
body.invoice_items[].discountable | boolean | Optional | |
body.invoice_items[].discounts | JSON | Optional | |
body.invoice_items[].discounts (anyOf 1) | array | Alternative | |
body.invoice_items[].discounts (anyOf 1)[] | object | Each item | |
body.invoice_items[].discounts (anyOf 1)[].coupon | string | Optional | Maximum length: 5000 |
body.invoice_items[].discounts (anyOf 1)[].discount | string | Optional | Maximum length: 5000 |
body.invoice_items[].discounts (anyOf 1)[].promotion_code | string | Optional | Maximum length: 5000 |
body.invoice_items[].discounts (anyOf 2) | string | Alternative | One of: |
body.invoice_items[].invoiceitem | string | Optional | Maximum length: 5000 |
body.invoice_items[].metadata | JSON | Optional | |
body.invoice_items[].metadata (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
body.invoice_items[].metadata (anyOf 1).* | string | Additional keys | |
body.invoice_items[].metadata (anyOf 2) | string | Alternative | One of: |
body.invoice_items[].period | object | Optional | |
body.invoice_items[].period.end | integer | Required within parent | Format: unix-time |
body.invoice_items[].period.start | integer | Required within parent | Format: unix-time |
body.invoice_items[].price | string | Optional | Maximum length: 5000 |
body.invoice_items[].price_data | object | Optional | |
body.invoice_items[].price_data.currency | string | Required within parent | Format: currency |
body.invoice_items[].price_data.product | string | Required within parent | Maximum length: 5000 |
body.invoice_items[].price_data.tax_behavior | string | Optional | One of: exclusive, inclusive, unspecified |
body.invoice_items[].price_data.unit_amount | integer | Optional | |
body.invoice_items[].price_data.unit_amount_decimal | string | Optional | Format: decimal |
body.invoice_items[].quantity | integer | Optional | |
body.invoice_items[].quantity_decimal | string | Optional | Format: decimal |
body.invoice_items[].tax_behavior | string | Optional | One of: exclusive, inclusive, unspecified |
body.invoice_items[].tax_code | JSON | Optional | |
body.invoice_items[].tax_code (anyOf 1) | string | Alternative | |
body.invoice_items[].tax_code (anyOf 2) | string | Alternative | One of: |
body.invoice_items[].tax_rates | JSON | Optional | |
body.invoice_items[].tax_rates (anyOf 1) | array | Alternative | |
body.invoice_items[].tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
body.invoice_items[].tax_rates (anyOf 2) | string | Alternative | One of: |
body.invoice_items[].unit_amount | integer | Optional | |
body.invoice_items[].unit_amount_decimal | string | Optional | Format: decimal |
body.issuer | object | Optional | The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. |
body.issuer.account | string | Optional | |
body.issuer.type | string | Required within parent | One of: account, self |
body.on_behalf_of | JSON | Optional | The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://docs.stripe.com/billing/invoices/connect) documentation for details. |
body.on_behalf_of (anyOf 1) | string | Alternative | |
body.on_behalf_of (anyOf 2) | string | Alternative | One of: |
body.preview_mode | string | Optional | Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. One of: next, recurring |
body.schedule | string | Optional | The identifier of the schedule whose upcoming invoice you’d like to retrieve. Cannot be used with subscription or subscription fields. Maximum length: 5000 |
body.schedule_details | object | Optional | The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. |
body.schedule_details.billing_mode | object | Optional | |
body.schedule_details.billing_mode.flexible | object | Optional | |
body.schedule_details.billing_mode.flexible.proration_discounts | string | Optional | One of: included, itemized |
body.schedule_details.billing_mode.type | string | Required within parent | One of: classic, flexible |
body.schedule_details.end_behavior | string | Optional | One of: cancel, release |
body.schedule_details.phases | array | Optional | |
body.schedule_details.phases[] | object | Each item | |
body.schedule_details.phases[].add_invoice_items | array | Optional | |
body.schedule_details.phases[].add_invoice_items[] | Model | Each item | Expand Create a schedule — request body — body phases item add invoice items item |
body.schedule_details.phases[].application_fee_percent | number | Optional | |
body.schedule_details.phases[].automatic_tax | object | Optional | |
body.schedule_details.phases[].automatic_tax.enabled | boolean | Required within parent | |
body.schedule_details.phases[].automatic_tax.liability | object | Optional | |
body.schedule_details.phases[].automatic_tax.liability.account | string | Optional | |
body.schedule_details.phases[].automatic_tax.liability.type | string | Required within parent | One of: account, self |
body.schedule_details.phases[].billing_cycle_anchor | string | Optional | One of: automatic, phase_start |
body.schedule_details.phases[].billing_thresholds | JSON | Optional | |
body.schedule_details.phases[].billing_thresholds (anyOf 1) | object | Alternative | |
body.schedule_details.phases[].billing_thresholds (anyOf 1).amount_gte | integer | Optional | |
body.schedule_details.phases[].billing_thresholds (anyOf 1).reset_billing_cycle_anchor | boolean | Optional | |
body.schedule_details.phases[].billing_thresholds (anyOf 2) | string | Alternative | One of: |
body.schedule_details.phases[].collection_method | string | Optional | One of: charge_automatically, send_invoice |
body.schedule_details.phases[].default_payment_method | string | Optional | Maximum length: 5000 |
body.schedule_details.phases[].default_tax_rates | JSON | Optional | |
body.schedule_details.phases[].default_tax_rates (anyOf 1) | array | Alternative | |
body.schedule_details.phases[].default_tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
body.schedule_details.phases[].default_tax_rates (anyOf 2) | string | Alternative | One of: |
body.schedule_details.phases[].description | JSON | Optional | |
body.schedule_details.phases[].description (anyOf 1) | string | Alternative | Maximum length: 500 |
body.schedule_details.phases[].description (anyOf 2) | string | Alternative | One of: |
body.schedule_details.phases[].discounts | JSON | Optional | |
body.schedule_details.phases[].discounts (anyOf 1) | array | Alternative | |
body.schedule_details.phases[].discounts (anyOf 1)[] | object | Each item | |
body.schedule_details.phases[].discounts (anyOf 1)[].coupon | string | Optional | Maximum length: 5000 |
body.schedule_details.phases[].discounts (anyOf 1)[].discount | string | Optional | Maximum length: 5000 |
body.schedule_details.phases[].discounts (anyOf 1)[].promotion_code | string | Optional | Maximum length: 5000 |
body.schedule_details.phases[].discounts (anyOf 2) | string | Alternative | One of: |
body.schedule_details.phases[].duration | object | Optional | |
body.schedule_details.phases[].duration.interval | string | Required within parent | One of: day, month, week, year |
body.schedule_details.phases[].duration.interval_count | integer | Optional | |
body.schedule_details.phases[].end_date | JSON | Optional | |
body.schedule_details.phases[].end_date (anyOf 1) | integer | Alternative | Format: unix-time |
body.schedule_details.phases[].end_date (anyOf 2) | string | Alternative | One of: now Maximum length: 5000 |
body.schedule_details.phases[].invoice_settings | object | Optional | |
body.schedule_details.phases[].invoice_settings.account_tax_ids | JSON | Optional | |
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 1) | array | Alternative | |
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 1)[] | string | Each item | Maximum length: 5000 |
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 2) | string | Alternative | One of: |
body.schedule_details.phases[].invoice_settings.days_until_due | integer | Optional | |
body.schedule_details.phases[].invoice_settings.issuer | object | Optional | |
body.schedule_details.phases[].invoice_settings.issuer.account | string | Optional | |
body.schedule_details.phases[].invoice_settings.issuer.type | string | Required within parent | One of: account, self |
body.schedule_details.phases[].items | array | Required within parent | |
body.schedule_details.phases[].items[] | Model | Each item | Expand Create a schedule — request body — body phases item items item |
body.schedule_details.phases[].metadata | object | Optional | Additional keys: see wildcard field |
body.schedule_details.phases[].metadata.* | string | Additional keys | |
body.schedule_details.phases[].on_behalf_of | string | Optional | |
body.schedule_details.phases[].proration_behavior | string | Optional | One of: always_invoice, create_prorations, none |
body.schedule_details.phases[].start_date | JSON | Optional | |
body.schedule_details.phases[].start_date (anyOf 1) | integer | Alternative | Format: unix-time |
body.schedule_details.phases[].start_date (anyOf 2) | string | Alternative | One of: now Maximum length: 5000 |
body.schedule_details.phases[].transfer_data | object | Optional | |
body.schedule_details.phases[].transfer_data.amount_percent | number | Optional | |
body.schedule_details.phases[].transfer_data.destination | string | Required within parent | |
body.schedule_details.phases[].trial | boolean | Optional | |
body.schedule_details.phases[].trial_end | JSON | Optional | |
body.schedule_details.phases[].trial_end (anyOf 1) | integer | Alternative | Format: unix-time |
body.schedule_details.phases[].trial_end (anyOf 2) | string | Alternative | One of: now Maximum length: 5000 |
body.schedule_details.proration_behavior | string | Optional | One of: always_invoice, create_prorations, none |
body.subscription | string | Optional | The identifier of the subscription for which you’d like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer’s subscriptions. Maximum length: 5000 |
body.subscription_details | object | Optional | The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. |
body.subscription_details.billing_cycle_anchor | object | Optional | |
body.subscription_details.billing_cycle_anchor.timestamp | integer | Optional | Format: unix-time |
body.subscription_details.billing_cycle_anchor.type | string | Required within parent | One of: now, timestamp, unchanged |
body.subscription_details.billing_mode | object | Optional | |
body.subscription_details.billing_mode.flexible | object | Optional | |
body.subscription_details.billing_mode.flexible.proration_discounts | string | Optional | One of: included, itemized |
body.subscription_details.billing_mode.type | string | Required within parent | One of: classic, flexible |
body.subscription_details.billing_schedules | JSON | Optional | |
body.subscription_details.billing_schedules (anyOf 1) | array | Alternative | |
body.subscription_details.billing_schedules (anyOf 1)[] | Model | Each item | Expand Update a subscription — request body — body billing schedules array item |
body.subscription_details.billing_schedules (anyOf 2) | string | Alternative | One of: |
body.subscription_details.cancel_at | JSON | Optional | |
body.subscription_details.cancel_at (anyOf 1) | integer | Alternative | Format: unix-time |
body.subscription_details.cancel_at (anyOf 2) | string | Alternative | One of: |
body.subscription_details.cancel_at (anyOf 3) | string | Alternative | One of: max_billed_until, max_period_end, min_period_end |
body.subscription_details.cancel_at_period_end | boolean | Optional | |
body.subscription_details.cancel_now | boolean | Optional | |
body.subscription_details.default_tax_rates | JSON | Optional | |
body.subscription_details.default_tax_rates (anyOf 1) | array | Alternative | |
body.subscription_details.default_tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
body.subscription_details.default_tax_rates (anyOf 2) | string | Alternative | One of: |
body.subscription_details.items | array | Optional | |
body.subscription_details.items[] | Model | Each item | Expand Update a subscription — request body — body items item |
body.subscription_details.metadata | JSON | Optional | |
body.subscription_details.metadata (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
body.subscription_details.metadata (anyOf 1).* | string | Additional keys | |
body.subscription_details.metadata (anyOf 2) | string | Alternative | One of: |
body.subscription_details.pause | object | Optional | |
body.subscription_details.pause.bill_for | object | Optional | |
body.subscription_details.pause.bill_for.outstanding_usage_through | object | Optional | |
body.subscription_details.pause.bill_for.outstanding_usage_through.type | string | Required within parent | One of: none, now |
body.subscription_details.pause.bill_for.unused_time_from | object | Optional | |
body.subscription_details.pause.bill_for.unused_time_from.type | string | Required within parent | One of: item_current_period_start, none, now |
body.subscription_details.pause.invoicing_behavior | string | Optional | One of: invoice, pending_invoice_item |
body.subscription_details.pause.type | string | Optional | One of: subscription |
body.subscription_details.proration_behavior | string | Optional | One of: always_invoice, create_prorations, none |
body.subscription_details.proration_date | integer | Optional | Format: unix-time |
body.subscription_details.resume_at | string | Optional | One of: now Maximum length: 5000 |
body.subscription_details.start_date | integer | Optional | Format: unix-time |
body.subscription_details.trial_end | JSON | Optional | |
body.subscription_details.trial_end (anyOf 1) | string | Alternative | One of: now Maximum length: 5000 |
body.subscription_details.trial_end (anyOf 2) | integer | Alternative | Format: unix-time |
Referenced models: Create a schedule — request body — body phases item add invoice items item, Update a subscription — request body — body billing schedules array item, Update a subscription — request body — body items item, Create a schedule — request body — body phases item items item, Create a customer — request body — body tax id data item
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Pay an invoice — response body |
Referenced models: Pay an invoice — response body
Schemas
Section titled “Schemas”708 more schemas are linked from the tables above, on the schema pages.
Create a schedule — request body — body phases item add invoice items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
discountable | boolean | Optional | |
discounts | array | Optional | |
discounts[] | object | Each item | |
discounts[].coupon | string | Optional | Maximum length: 5000 |
discounts[].discount | string | Optional | Maximum length: 5000 |
discounts[].promotion_code | string | Optional | Maximum length: 5000 |
metadata | object | Optional | Additional keys: see wildcard field |
metadata.* | string | Additional keys | |
period | object | Optional | |
period.end | object | Required within parent | |
period.end.timestamp | integer | Optional | Format: unix-time |
period.end.type | string | Required within parent | One of: min_item_period_end, phase_end, timestamp |
period.start | object | Required within parent | |
period.start.timestamp | integer | Optional | Format: unix-time |
period.start.type | string | Required within parent | One of: max_item_period_start, phase_start, timestamp |
price | string | Optional | Maximum length: 5000 |
price_data | object | Optional | |
price_data.currency | string | Required within parent | Format: currency |
price_data.product | string | Required within parent | Maximum length: 5000 |
price_data.tax_behavior | string | Optional | One of: exclusive, inclusive, unspecified |
price_data.unit_amount | integer | Optional | |
price_data.unit_amount_decimal | string | Optional | Format: decimal |
quantity | integer | Optional | |
tax_rates | JSON | Optional | |
tax_rates (anyOf 1) | array | Alternative | |
tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
tax_rates (anyOf 2) | string | Alternative | One of: |
Update a subscription — request body — body billing schedules array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
applies_to | array | Optional | |
applies_to[] | object | Each item | |
applies_to[].price | string | Optional | Maximum length: 5000 |
applies_to[].type | string | Required within parent | One of: price |
bill_until | object | Optional | |
bill_until.duration | object | Optional | |
bill_until.duration.interval | string | Required within parent | One of: day, month, week, year |
bill_until.duration.interval_count | integer | Optional | |
bill_until.timestamp | integer | Optional | Format: unix-time |
bill_until.type | string | Required within parent | One of: duration, timestamp |
key | string | Optional | Maximum length: 200 |
Update a subscription — request body — body items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
billing_thresholds | JSON | Optional | |
billing_thresholds (anyOf 1) | object | Alternative | |
billing_thresholds (anyOf 1).usage_gte | integer | Required within parent | |
billing_thresholds (anyOf 2) | string | Alternative | One of: |
clear_usage | boolean | Optional | |
current_trial | object | Optional | |
current_trial.trial_offer | string | Required within parent | Maximum length: 5000 |
deleted | boolean | Optional | |
discounts | JSON | Optional | |
discounts (anyOf 1) | array | Alternative | |
discounts (anyOf 1)[] | object | Each item | |
discounts (anyOf 1)[].coupon | string | Optional | Maximum length: 5000 |
discounts (anyOf 1)[].discount | string | Optional | Maximum length: 5000 |
discounts (anyOf 1)[].promotion_code | string | Optional | Maximum length: 5000 |
discounts (anyOf 2) | string | Alternative | One of: |
id | string | Optional | Maximum length: 5000 |
metadata | JSON | Optional | |
metadata (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
metadata (anyOf 1).* | string | Additional keys | |
metadata (anyOf 2) | string | Alternative | One of: |
price | string | Optional | Maximum length: 5000 |
price_data | Model | Optional | Expand Update a subscription — request body — body items item price data |
quantity | integer | Optional | |
tax_rates | JSON | Optional | |
tax_rates (anyOf 1) | array | Alternative | |
tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
tax_rates (anyOf 2) | string | Alternative | One of: |
Referenced models: Update a subscription — request body — body items item price data
Create a schedule — request body — body phases item items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
billing_thresholds | JSON | Optional | |
billing_thresholds (anyOf 1) | object | Alternative | |
billing_thresholds (anyOf 1).usage_gte | integer | Required within parent | |
billing_thresholds (anyOf 2) | string | Alternative | One of: |
discounts | JSON | Optional | |
discounts (anyOf 1) | array | Alternative | |
discounts (anyOf 1)[] | object | Each item | |
discounts (anyOf 1)[].coupon | string | Optional | Maximum length: 5000 |
discounts (anyOf 1)[].discount | string | Optional | Maximum length: 5000 |
discounts (anyOf 1)[].promotion_code | string | Optional | Maximum length: 5000 |
discounts (anyOf 2) | string | Alternative | One of: |
metadata | object | Optional | Additional keys: see wildcard field |
metadata.* | string | Additional keys | |
price | string | Optional | Maximum length: 5000 |
price_data | Model | Optional | Expand Update a subscription — request body — body items item price data |
quantity | integer | Optional | |
tax_rates | JSON | Optional | |
tax_rates (anyOf 1) | array | Alternative | |
tax_rates (anyOf 1)[] | string | Each item | Maximum length: 5000 |
tax_rates (anyOf 2) | string | Alternative | One of: |
Referenced models: Update a subscription — request body — body items item price data
Create a customer — request body — body tax id data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
type | string | Required within parent | One of: ad_nrt, ae_trn, al_tin, am_tin, ao_tin, ar_cuit, au_abn, au_arn, aw_tin, az_tin, ba_tin, bb_tin, bd_bin, bf_ifu, bg_uic, bh_vat, bj_ifu, bo_tin, br_cnpj, br_cpf, bs_tin, by_tin, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, cd_nif, ch_uid, ch_vat, cl_tin, cm_niu, cn_tin, co_nit, cr_tin, cv_nif, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, et_tin, eu_oss_vat, eu_vat, fo_vat, gb_vat, ge_vat, gi_tin, gn_nif, hk_br, hr_oib, hu_tin, ic_nif, id_npwp, il_vat, in_gst, is_vat, it_cf, jp_cn, jp_rn, jp_trn, ke_pin, kg_tin, kh_tin, kr_brn, kz_bin, la_tin, li_uid, li_vat, lk_vat, ma_vat, md_vat, me_pib, mk_vat, mr_nif, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, np_pan, nz_gst, om_vat, pe_ruc, ph_tin, pl_nip, py_ruc, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sn_ninea, sr_fin, sv_nit, th_vat, tj_tin, tr_tin, tw_vat, tz_vat, ua_vat, ug_tin, us_ein, uy_ruc, uz_tin, uz_vat, ve_rif, vn_tin, za_vat, zm_tin, zw_tin Maximum length: 5000 |
value | string | Required within parent |
Create a Location — response body — address
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
city | JSON | Optional | |
city (anyOf 1) | string | Alternative | City, district, suburb, town, or village. Maximum length: 5000 |
city (anyOf 2) | null | Alternative | |
country | JSON | Optional | |
country (anyOf 1) | string | Alternative | Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Maximum length: 5000 |
country (anyOf 2) | null | Alternative | |
line1 | JSON | Optional | |
line1 (anyOf 1) | string | Alternative | Address line 1, such as the street, PO Box, or company name. Maximum length: 5000 |
line1 (anyOf 2) | null | Alternative | |
line2 | JSON | Optional | |
line2 (anyOf 1) | string | Alternative | Address line 2, such as the apartment, suite, unit, or building. Maximum length: 5000 |
line2 (anyOf 2) | null | Alternative | |
postal_code | JSON | Optional | |
postal_code (anyOf 1) | string | Alternative | ZIP or postal code. Maximum length: 5000 |
postal_code (anyOf 2) | null | Alternative | |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). Maximum length: 5000 |
state (anyOf 2) | null | Alternative |
PostApplicationFeesIdRefund — response body — application / object: application
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Required within parent | Unique identifier for the object. Maximum length: 5000 |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the application. Maximum length: 5000 |
name (anyOf 2) | null | Alternative | |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: application |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: stripe.postinvoicescreatepreview. Catalog operation: PostInvoicesCreatePreview. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"Stripe-Version": "2026-09-30.endive"}