Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.automatic_taxobjectOptionalSettings for automatic tax lookup for this invoice preview.
body.automatic_tax.enabledbooleanRequired within parent
body.automatic_tax.liabilityobjectOptional
body.automatic_tax.liability.accountstringOptional
body.automatic_tax.liability.typestringRequired within parentOne of: account, self
body.currencystringOptionalThe currency to preview this invoice in. Defaults to that of `customer` if not specified.
Format: currency
body.customerstringOptionalThe 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_accountstringOptionalThe 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_detailsobjectOptionalDetails 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.addressJSONOptional
body.customer_details.address (anyOf 1)objectAlternative
body.customer_details.address (anyOf 1).citystringOptionalMaximum length: 5000
body.customer_details.address (anyOf 1).countrystringOptionalMaximum length: 5000
body.customer_details.address (anyOf 1).line1stringOptionalMaximum length: 5000
body.customer_details.address (anyOf 1).line2stringOptionalMaximum length: 5000
body.customer_details.address (anyOf 1).postal_codestringOptionalMaximum length: 5000
body.customer_details.address (anyOf 1).statestringOptionalMaximum length: 5000
body.customer_details.address (anyOf 2)stringAlternativeOne of:
body.customer_details.shippingJSONOptional
body.customer_details.shipping (anyOf 1)objectAlternative
body.customer_details.shipping (anyOf 1).addressobjectRequired within parent
body.customer_details.shipping (anyOf 1).address.citystringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).address.countrystringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).address.line1stringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).address.line2stringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).address.postal_codestringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).address.statestringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 1).namestringRequired within parentMaximum length: 5000
body.customer_details.shipping (anyOf 1).phonestringOptionalMaximum length: 5000
body.customer_details.shipping (anyOf 2)stringAlternativeOne of:
body.customer_details.taxobjectOptional
body.customer_details.tax.ip_addressJSONOptional
body.customer_details.tax.ip_address (anyOf 1)stringAlternative
body.customer_details.tax.ip_address (anyOf 2)stringAlternativeOne of:
body.customer_details.tax_exemptstringOptionalOne of: , exempt, none, reverse
body.customer_details.tax_idsarrayOptional
body.customer_details.tax_ids[]ModelEach itemExpand Create a customer — request body — body tax id data item
body.discountsJSONOptionalThe 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)arrayAlternative
body.discounts (anyOf 1)[]objectEach item
body.discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
body.discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
body.discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
body.discounts (anyOf 2)stringAlternativeOne of:
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.invoice_itemsarrayOptionalList of invoice items to add or update in the upcoming invoice preview (up to 250).
body.invoice_items[]objectEach item
body.invoice_items[].amountintegerOptional
body.invoice_items[].currencystringOptionalFormat: currency
body.invoice_items[].descriptionstringOptionalMaximum length: 5000
body.invoice_items[].discountablebooleanOptional
body.invoice_items[].discountsJSONOptional
body.invoice_items[].discounts (anyOf 1)arrayAlternative
body.invoice_items[].discounts (anyOf 1)[]objectEach item
body.invoice_items[].discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
body.invoice_items[].discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
body.invoice_items[].discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
body.invoice_items[].discounts (anyOf 2)stringAlternativeOne of:
body.invoice_items[].invoiceitemstringOptionalMaximum length: 5000
body.invoice_items[].metadataJSONOptional
body.invoice_items[].metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
body.invoice_items[].metadata (anyOf 1).*stringAdditional keys
body.invoice_items[].metadata (anyOf 2)stringAlternativeOne of:
body.invoice_items[].periodobjectOptional
body.invoice_items[].period.endintegerRequired within parentFormat: unix-time
body.invoice_items[].period.startintegerRequired within parentFormat: unix-time
body.invoice_items[].pricestringOptionalMaximum length: 5000
body.invoice_items[].price_dataobjectOptional
body.invoice_items[].price_data.currencystringRequired within parentFormat: currency
body.invoice_items[].price_data.productstringRequired within parentMaximum length: 5000
body.invoice_items[].price_data.tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
body.invoice_items[].price_data.unit_amountintegerOptional
body.invoice_items[].price_data.unit_amount_decimalstringOptionalFormat: decimal
body.invoice_items[].quantityintegerOptional
body.invoice_items[].quantity_decimalstringOptionalFormat: decimal
body.invoice_items[].tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
body.invoice_items[].tax_codeJSONOptional
body.invoice_items[].tax_code (anyOf 1)stringAlternative
body.invoice_items[].tax_code (anyOf 2)stringAlternativeOne of:
body.invoice_items[].tax_ratesJSONOptional
body.invoice_items[].tax_rates (anyOf 1)arrayAlternative
body.invoice_items[].tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
body.invoice_items[].tax_rates (anyOf 2)stringAlternativeOne of:
body.invoice_items[].unit_amountintegerOptional
body.invoice_items[].unit_amount_decimalstringOptionalFormat: decimal
body.issuerobjectOptionalThe connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
body.issuer.accountstringOptional
body.issuer.typestringRequired within parentOne of: account, self
body.on_behalf_ofJSONOptionalThe 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)stringAlternative
body.on_behalf_of (anyOf 2)stringAlternativeOne of:
body.preview_modestringOptionalCustomizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
One of: next, recurring
body.schedulestringOptionalThe 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_detailsobjectOptionalThe schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
body.schedule_details.billing_modeobjectOptional
body.schedule_details.billing_mode.flexibleobjectOptional
body.schedule_details.billing_mode.flexible.proration_discountsstringOptionalOne of: included, itemized
body.schedule_details.billing_mode.typestringRequired within parentOne of: classic, flexible
body.schedule_details.end_behaviorstringOptionalOne of: cancel, release
body.schedule_details.phasesarrayOptional
body.schedule_details.phases[]objectEach item
body.schedule_details.phases[].add_invoice_itemsarrayOptional
body.schedule_details.phases[].add_invoice_items[]ModelEach itemExpand Create a schedule — request body — body phases item add invoice items item
body.schedule_details.phases[].application_fee_percentnumberOptional
body.schedule_details.phases[].automatic_taxobjectOptional
body.schedule_details.phases[].automatic_tax.enabledbooleanRequired within parent
body.schedule_details.phases[].automatic_tax.liabilityobjectOptional
body.schedule_details.phases[].automatic_tax.liability.accountstringOptional
body.schedule_details.phases[].automatic_tax.liability.typestringRequired within parentOne of: account, self
body.schedule_details.phases[].billing_cycle_anchorstringOptionalOne of: automatic, phase_start
body.schedule_details.phases[].billing_thresholdsJSONOptional
body.schedule_details.phases[].billing_thresholds (anyOf 1)objectAlternative
body.schedule_details.phases[].billing_thresholds (anyOf 1).amount_gteintegerOptional
body.schedule_details.phases[].billing_thresholds (anyOf 1).reset_billing_cycle_anchorbooleanOptional
body.schedule_details.phases[].billing_thresholds (anyOf 2)stringAlternativeOne of:
body.schedule_details.phases[].collection_methodstringOptionalOne of: charge_automatically, send_invoice
body.schedule_details.phases[].default_payment_methodstringOptionalMaximum length: 5000
body.schedule_details.phases[].default_tax_ratesJSONOptional
body.schedule_details.phases[].default_tax_rates (anyOf 1)arrayAlternative
body.schedule_details.phases[].default_tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
body.schedule_details.phases[].default_tax_rates (anyOf 2)stringAlternativeOne of:
body.schedule_details.phases[].descriptionJSONOptional
body.schedule_details.phases[].description (anyOf 1)stringAlternativeMaximum length: 500
body.schedule_details.phases[].description (anyOf 2)stringAlternativeOne of:
body.schedule_details.phases[].discountsJSONOptional
body.schedule_details.phases[].discounts (anyOf 1)arrayAlternative
body.schedule_details.phases[].discounts (anyOf 1)[]objectEach item
body.schedule_details.phases[].discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
body.schedule_details.phases[].discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
body.schedule_details.phases[].discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
body.schedule_details.phases[].discounts (anyOf 2)stringAlternativeOne of:
body.schedule_details.phases[].durationobjectOptional
body.schedule_details.phases[].duration.intervalstringRequired within parentOne of: day, month, week, year
body.schedule_details.phases[].duration.interval_countintegerOptional
body.schedule_details.phases[].end_dateJSONOptional
body.schedule_details.phases[].end_date (anyOf 1)integerAlternativeFormat: unix-time
body.schedule_details.phases[].end_date (anyOf 2)stringAlternativeOne of: now
Maximum length: 5000
body.schedule_details.phases[].invoice_settingsobjectOptional
body.schedule_details.phases[].invoice_settings.account_tax_idsJSONOptional
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 1)arrayAlternative
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 1)[]stringEach itemMaximum length: 5000
body.schedule_details.phases[].invoice_settings.account_tax_ids (anyOf 2)stringAlternativeOne of:
body.schedule_details.phases[].invoice_settings.days_until_dueintegerOptional
body.schedule_details.phases[].invoice_settings.issuerobjectOptional
body.schedule_details.phases[].invoice_settings.issuer.accountstringOptional
body.schedule_details.phases[].invoice_settings.issuer.typestringRequired within parentOne of: account, self
body.schedule_details.phases[].itemsarrayRequired within parent
body.schedule_details.phases[].items[]ModelEach itemExpand Create a schedule — request body — body phases item items item
body.schedule_details.phases[].metadataobjectOptionalAdditional keys: see wildcard field
body.schedule_details.phases[].metadata.*stringAdditional keys
body.schedule_details.phases[].on_behalf_ofstringOptional
body.schedule_details.phases[].proration_behaviorstringOptionalOne of: always_invoice, create_prorations, none
body.schedule_details.phases[].start_dateJSONOptional
body.schedule_details.phases[].start_date (anyOf 1)integerAlternativeFormat: unix-time
body.schedule_details.phases[].start_date (anyOf 2)stringAlternativeOne of: now
Maximum length: 5000
body.schedule_details.phases[].transfer_dataobjectOptional
body.schedule_details.phases[].transfer_data.amount_percentnumberOptional
body.schedule_details.phases[].transfer_data.destinationstringRequired within parent
body.schedule_details.phases[].trialbooleanOptional
body.schedule_details.phases[].trial_endJSONOptional
body.schedule_details.phases[].trial_end (anyOf 1)integerAlternativeFormat: unix-time
body.schedule_details.phases[].trial_end (anyOf 2)stringAlternativeOne of: now
Maximum length: 5000
body.schedule_details.proration_behaviorstringOptionalOne of: always_invoice, create_prorations, none
body.subscriptionstringOptionalThe 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_detailsobjectOptionalThe subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
body.subscription_details.billing_cycle_anchorobjectOptional
body.subscription_details.billing_cycle_anchor.timestampintegerOptionalFormat: unix-time
body.subscription_details.billing_cycle_anchor.typestringRequired within parentOne of: now, timestamp, unchanged
body.subscription_details.billing_modeobjectOptional
body.subscription_details.billing_mode.flexibleobjectOptional
body.subscription_details.billing_mode.flexible.proration_discountsstringOptionalOne of: included, itemized
body.subscription_details.billing_mode.typestringRequired within parentOne of: classic, flexible
body.subscription_details.billing_schedulesJSONOptional
body.subscription_details.billing_schedules (anyOf 1)arrayAlternative
body.subscription_details.billing_schedules (anyOf 1)[]ModelEach itemExpand Update a subscription — request body — body billing schedules array item
body.subscription_details.billing_schedules (anyOf 2)stringAlternativeOne of:
body.subscription_details.cancel_atJSONOptional
body.subscription_details.cancel_at (anyOf 1)integerAlternativeFormat: unix-time
body.subscription_details.cancel_at (anyOf 2)stringAlternativeOne of:
body.subscription_details.cancel_at (anyOf 3)stringAlternativeOne of: max_billed_until, max_period_end, min_period_end
body.subscription_details.cancel_at_period_endbooleanOptional
body.subscription_details.cancel_nowbooleanOptional
body.subscription_details.default_tax_ratesJSONOptional
body.subscription_details.default_tax_rates (anyOf 1)arrayAlternative
body.subscription_details.default_tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
body.subscription_details.default_tax_rates (anyOf 2)stringAlternativeOne of:
body.subscription_details.itemsarrayOptional
body.subscription_details.items[]ModelEach itemExpand Update a subscription — request body — body items item
body.subscription_details.metadataJSONOptional
body.subscription_details.metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
body.subscription_details.metadata (anyOf 1).*stringAdditional keys
body.subscription_details.metadata (anyOf 2)stringAlternativeOne of:
body.subscription_details.pauseobjectOptional
body.subscription_details.pause.bill_forobjectOptional
body.subscription_details.pause.bill_for.outstanding_usage_throughobjectOptional
body.subscription_details.pause.bill_for.outstanding_usage_through.typestringRequired within parentOne of: none, now
body.subscription_details.pause.bill_for.unused_time_fromobjectOptional
body.subscription_details.pause.bill_for.unused_time_from.typestringRequired within parentOne of: item_current_period_start, none, now
body.subscription_details.pause.invoicing_behaviorstringOptionalOne of: invoice, pending_invoice_item
body.subscription_details.pause.typestringOptionalOne of: subscription
body.subscription_details.proration_behaviorstringOptionalOne of: always_invoice, create_prorations, none
body.subscription_details.proration_dateintegerOptionalFormat: unix-time
body.subscription_details.resume_atstringOptionalOne of: now
Maximum length: 5000
body.subscription_details.start_dateintegerOptionalFormat: unix-time
body.subscription_details.trial_endJSONOptional
body.subscription_details.trial_end (anyOf 1)stringAlternativeOne of: now
Maximum length: 5000
body.subscription_details.trial_end (anyOf 2)integerAlternativeFormat: 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 media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Pay an invoice — response body

Referenced models: Pay an invoice — response body

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
FieldTypePresenceDescription and constraints
$objectRoot
discountablebooleanOptional
discountsarrayOptional
discounts[]objectEach item
discounts[].couponstringOptionalMaximum length: 5000
discounts[].discountstringOptionalMaximum length: 5000
discounts[].promotion_codestringOptionalMaximum length: 5000
metadataobjectOptionalAdditional keys: see wildcard field
metadata.*stringAdditional keys
periodobjectOptional
period.endobjectRequired within parent
period.end.timestampintegerOptionalFormat: unix-time
period.end.typestringRequired within parentOne of: min_item_period_end, phase_end, timestamp
period.startobjectRequired within parent
period.start.timestampintegerOptionalFormat: unix-time
period.start.typestringRequired within parentOne of: max_item_period_start, phase_start, timestamp
pricestringOptionalMaximum length: 5000
price_dataobjectOptional
price_data.currencystringRequired within parentFormat: currency
price_data.productstringRequired within parentMaximum length: 5000
price_data.tax_behaviorstringOptionalOne of: exclusive, inclusive, unspecified
price_data.unit_amountintegerOptional
price_data.unit_amount_decimalstringOptionalFormat: decimal
quantityintegerOptional
tax_ratesJSONOptional
tax_rates (anyOf 1)arrayAlternative
tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
tax_rates (anyOf 2)stringAlternativeOne of:
Update a subscription — request body — body billing schedules array item
FieldTypePresenceDescription and constraints
$objectRoot
applies_toarrayOptional
applies_to[]objectEach item
applies_to[].pricestringOptionalMaximum length: 5000
applies_to[].typestringRequired within parentOne of: price
bill_untilobjectOptional
bill_until.durationobjectOptional
bill_until.duration.intervalstringRequired within parentOne of: day, month, week, year
bill_until.duration.interval_countintegerOptional
bill_until.timestampintegerOptionalFormat: unix-time
bill_until.typestringRequired within parentOne of: duration, timestamp
keystringOptionalMaximum length: 200
Update a subscription — request body — body items item
FieldTypePresenceDescription and constraints
$objectRoot
billing_thresholdsJSONOptional
billing_thresholds (anyOf 1)objectAlternative
billing_thresholds (anyOf 1).usage_gteintegerRequired within parent
billing_thresholds (anyOf 2)stringAlternativeOne of:
clear_usagebooleanOptional
current_trialobjectOptional
current_trial.trial_offerstringRequired within parentMaximum length: 5000
deletedbooleanOptional
discountsJSONOptional
discounts (anyOf 1)arrayAlternative
discounts (anyOf 1)[]objectEach item
discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
discounts (anyOf 2)stringAlternativeOne of:
idstringOptionalMaximum length: 5000
metadataJSONOptional
metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
metadata (anyOf 1).*stringAdditional keys
metadata (anyOf 2)stringAlternativeOne of:
pricestringOptionalMaximum length: 5000
price_dataModelOptionalExpand Update a subscription — request body — body items item price data
quantityintegerOptional
tax_ratesJSONOptional
tax_rates (anyOf 1)arrayAlternative
tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
tax_rates (anyOf 2)stringAlternativeOne of:

Referenced models: Update a subscription — request body — body items item price data

Create a schedule — request body — body phases item items item
FieldTypePresenceDescription and constraints
$objectRoot
billing_thresholdsJSONOptional
billing_thresholds (anyOf 1)objectAlternative
billing_thresholds (anyOf 1).usage_gteintegerRequired within parent
billing_thresholds (anyOf 2)stringAlternativeOne of:
discountsJSONOptional
discounts (anyOf 1)arrayAlternative
discounts (anyOf 1)[]objectEach item
discounts (anyOf 1)[].couponstringOptionalMaximum length: 5000
discounts (anyOf 1)[].discountstringOptionalMaximum length: 5000
discounts (anyOf 1)[].promotion_codestringOptionalMaximum length: 5000
discounts (anyOf 2)stringAlternativeOne of:
metadataobjectOptionalAdditional keys: see wildcard field
metadata.*stringAdditional keys
pricestringOptionalMaximum length: 5000
price_dataModelOptionalExpand Update a subscription — request body — body items item price data
quantityintegerOptional
tax_ratesJSONOptional
tax_rates (anyOf 1)arrayAlternative
tax_rates (anyOf 1)[]stringEach itemMaximum length: 5000
tax_rates (anyOf 2)stringAlternativeOne of:

Referenced models: Update a subscription — request body — body items item price data

Create a customer — request body — body tax id data item
FieldTypePresenceDescription and constraints
$objectRoot
typestringRequired within parentOne 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
valuestringRequired within parent
Create a Location — response body — address
FieldTypePresenceDescription and constraints
$objectRoot
cityJSONOptional
city (anyOf 1)stringAlternativeCity, district, suburb, town, or village.
Maximum length: 5000
city (anyOf 2)nullAlternative
countryJSONOptional
country (anyOf 1)stringAlternativeTwo-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
Maximum length: 5000
country (anyOf 2)nullAlternative
line1JSONOptional
line1 (anyOf 1)stringAlternativeAddress line 1, such as the street, PO Box, or company name.
Maximum length: 5000
line1 (anyOf 2)nullAlternative
line2JSONOptional
line2 (anyOf 1)stringAlternativeAddress line 2, such as the apartment, suite, unit, or building.
Maximum length: 5000
line2 (anyOf 2)nullAlternative
postal_codeJSONOptional
postal_code (anyOf 1)stringAlternativeZIP or postal code.
Maximum length: 5000
postal_code (anyOf 2)nullAlternative
stateJSONOptional
state (anyOf 1)stringAlternativeState, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
Maximum length: 5000
state (anyOf 2)nullAlternative
PostApplicationFeesIdRefund — response body — application / object: application
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the application.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: application

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.