---
title: "Retrieve a credit balance transaction"
method: GET
path: "/v1/billing/credit_balance_transactions/{id}"
---

# Retrieve a credit balance transaction

`GET /v1/billing/credit_balance_transactions/{id}`

Retrieves a credit balance transaction.

## Path parameters

- `id` string, required

## Query parameters

- `expand` string[]

## Response `200`

Successful response.

- BillingCreditBalanceTransaction — A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant.
  - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
  - `credit` BillingCreditGrantsResourceBalanceCredit
    - `amount` BillingCreditGrantsResourceAmount, required
      - `monetary` BillingCreditGrantsResourceMonetaryAmount
        - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
        - `value` integer, required — A positive integer representing the amount.
      - `type` 'monetary', required — The type of this amount. We currently only support `monetary` billing credits.
    - `credits_application_invoice_voided` BillingCreditGrantsResourceBalanceCreditsApplicationInvoiceVoided
      - `invoice` union, required — The invoice to which the reinstated billing credits were originally applied.
        - string
        - Invoice — Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, Stripe automatically finalizes your invoice and attempts payment. Note that finalizing the invoice, [when automatic](https://docs.stripe.com/invoicing/integration/automatic-advancement-collection), does not happen immediately as the invoice is created. Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice. If your invoice is configured to be billed by sending an email, then based on your [email settings](https://dashboard.stripe.com/account/billing/automatic), Stripe will email the invoice to your customer and await payment. These emails can contain a link to a hosted page to pay the invoice. Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice. More details on the customer's credit balance are [here](https://docs.stripe.com/billing/customer/balance). Related guide: [Send invoices to customers](https://docs.stripe.com/billing/invoices/sending)
          - `account_country` string, nullable — The country of the business associated with this invoice, most often the business creating the invoice.
          - `account_name` string, nullable — The public name of the business associated with this invoice, most often the business creating the invoice.
          - `account_tax_ids` union[], nullable — The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
            - union
              - …
          - `amount_due` integer, required — Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
          - `amount_overpaid` integer, required — Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
          - `amount_paid` integer, required — The amount, in cents (or local equivalent), that was paid.
          - `amount_paid_off_stripe` integer, required — Amount, in cents (or local equivalent), that was paid on the invoice outside of Stripe.
          - `amount_remaining` integer, required — The difference between amount_due and amount_paid, in cents (or local equivalent).
          - `amount_shipping` integer, required — This is the sum of all the shipping amounts.
          - `application` union — ID of the Connect Application that created the invoice.
            - string
            - Application
              - …
            - DeletedApplication
              - …
          - `attempt_count` integer, required — Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
          - `attempted` boolean, required — Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
          - `auto_advance` boolean, required — Controls whether Stripe performs [automatic collection](https://docs.stripe.com/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
          - `automatic_tax` AutomaticTax, required
            - `disabled_reason` 'finalization_requires_location_inputs' | 'finalization_system_error', nullable — If Stripe disabled automatic tax, this enum describes why.
            - `enabled` boolean, required — Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://docs.stripe.com/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
            - `liability` ConnectAccountReference
              - …
            - `provider` string, nullable — The tax provider powering automatic tax.
            - `status` 'complete' | 'failed' | 'requires_location_inputs', nullable — The status of the most recent automated tax calculation for this invoice.
          - `automatically_finalizes_at` integer, nullable — The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
          - `billing_reason` 'automatic_pending_invoice_item_invoice' | 'manual' | 'quote_accept' | 'subscription' | 'subscription_create' | 'subscription_cycle' | 'subscription_threshold' | 'subscription_update' | 'upcoming', nullable — Indicates the reason why the invoice was created. * `manual`: Unrelated to a subscription, for example, created via the invoice editor. * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for upcoming invoices created through the Create Preview Invoice API or when an `invoice.upcoming` event is generated for an upcoming invoice on a subscription.
          - `collection_method` 'charge_automatically' | 'send_invoice', required — Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
          - `confirmation_secret` InvoicesResourceConfirmationSecret
            - `client_secret` string, required — The client_secret of the payment that Stripe creates for the invoice after finalization.
            - `type` string, required — The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization
          - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
          - `currency` string, currency, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
          - `custom_fields` InvoiceSettingCustomField[], nullable — Custom fields displayed on the invoice.
            - `name` string, required — The name of the custom field.
            - `value` string, required — The value of the custom field.
          - `customer` union, required — The ID of the customer to bill.
            - string
            - Customer — This object represents a customer of your business. Use it to [create recurring charges](https://docs.stripe.com/invoicing/customer), [save payment](https://docs.stripe.com/payments/save-during-payment) and contact information, and track payments that belong to the same customer.
              - …
            - DeletedCustomer
              - …
          - `customer_account` string, nullable — The ID of the account representing the customer to bill.
          - `customer_address` Address
            - `city` string, nullable — City, district, suburb, town, or village.
            - `country` string, nullable — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            - `line1` string, nullable — Address line 1, such as the street, PO Box, or company name.
            - `line2` string, nullable — Address line 2, such as the apartment, suite, unit, or building.
            - `postal_code` string, nullable — ZIP or postal code.
            - `state` string, nullable — State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
          - `customer_email` string, nullable — The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_name` string, nullable — The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_phone` string, nullable — The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_shipping` Shipping
            - `address` Address
              - …
            - `carrier` string, nullable — The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
            - `name` string — Recipient name.
            - `phone` string, nullable — Recipient phone (including extension).
            - `tracking_number` string, nullable — The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
          - `customer_tax_exempt` 'exempt' | 'none' | 'reverse', nullable — The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_tax_ids` InvoicesResourceInvoiceTaxId[], nullable — The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
            - `type` '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' | 'unknown' | 'us_ein' | 'uy_ruc' | 'uz_tin' | 'uz_vat' | 've_rif' | 'vn_tin' | 'za_vat' | 'zm_tin' | 'zw_tin', required — The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown`
            - `value` string, nullable — The value of the tax ID.
          - `default_payment_method` union — ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
            - string
            - PaymentMethod — PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
              - …
          - `default_source` union — ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
            - string
            - BankAccount — These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](/payments/bank-debits-transfers)
              - …
            - Card — You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://docs.stripe.com/sources/cards)
              - …
            - Source — `Source` objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://docs.stripe.com/api/sources). We recommend that you adopt the [PaymentMethods API](https://docs.stripe.com/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://docs.stripe.com/sources) and [Sources & Customers](https://docs.stripe.com/sources/customers).
              - …
          - `default_tax_rates` TaxRate[], required — The tax rates applied to this invoice, if any.
            - `active` boolean, required — Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.
            - `country` string, nullable — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
            - `description` string, nullable — An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
            - `display_name` string, required — The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
            - `effective_percentage` number, nullable — Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction.
            - `flat_amount` TaxRateFlatAmount — The amount of the tax rate when the `rate_type`` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate.
              - …
            - `id` string, required — Unique identifier for the object.
            - `inclusive` boolean, required — This specifies if the tax rate is inclusive or exclusive.
            - `jurisdiction` string, nullable — The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
            - `jurisdiction_level` 'city' | 'country' | 'county' | 'district' | 'multiple' | 'state', nullable — The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates.
            - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
            - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
            - `object` 'tax_rate', required — String representing the object's type. Objects of the same type share the same value.
            - `percentage` number, required — Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions.
            - `rate_type` 'flat_amount' | 'percentage', nullable — Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax.
            - `state` string, nullable — [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States.
            - `tax_type` 'amusement_tax' | 'communications_tax' | 'gst' | 'hst' | 'igst' | 'jct' | 'lease_tax' | 'mass_transit_parking_tax' | 'parking_tax' | 'pst' | 'qst' | 'retail_delivery_fee' | 'rst' | 'sales_tax' | 'service_tax' | 'vat', nullable — The high-level tax type, such as `vat` or `sales_tax`.
          - `description` string, nullable — An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
          - `discounts` union[], required — The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
            - union
              - …
          - `due_date` integer, nullable — The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
          - `effective_at` integer, nullable — The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
          - `ending_balance` integer, nullable — Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
          - `footer` string, nullable — Footer displayed on the invoice.
          - `from_invoice` InvoicesResourceFromInvoice
            - `action` string, required — The relation between this invoice and the cloned invoice
            - `invoice` union, required — The invoice that was cloned.
              - …
          - `hosted_invoice_url` string, nullable — The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
          - `id` string, required — Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
          - `invoice_pdf` string, nullable — The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
          - `issuer` ConnectAccountReference, required
            - `account` union — The connected account being referenced when `type` is `account`.
              - …
            - `type` 'account' | 'self', required — Type of the account referenced.
          - `last_finalization_error` ApiErrors
            - `advice_code` string — For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one.
            - `charge` string — For card errors, the ID of the failed charge.
            - `code` string — For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
            - `decline_code` string — For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
            - `doc_url` string — A URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
            - `message` string — A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
            - `network_advice_code` string — For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
            - `network_decline_code` string — For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
            - `param` string — If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
            - `payment_intent` PaymentIntent — A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](/payments/paymentintents/lifecycle) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://docs.stripe.com/payments/payment-intents)
              - …
            - `payment_method` PaymentMethod — PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
              - …
            - `payment_method_type` string — If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
            - `request_log_url` string — A URL to the request log entry in your dashboard.
            - `setup_intent` SetupIntent — A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
              - …
            - `source` union — The [source object](https://docs.stripe.com/api/sources/object) for errors returned on a request involving a source.
              - …
            - `type` 'api_error' | 'card_error' | 'idempotency_error' | 'invalid_request_error', required — The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
          - `latest_revision` union — The ID of the most recent non-draft revision of this invoice
            - string
            - Invoice — recursive
          - `lines` object, required — The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
            - `data` LineItem[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
          - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
          - `next_payment_attempt` integer, nullable — The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
          - `number` string, nullable — A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
          - `object` 'invoice', required — String representing the object's type. Objects of the same type share the same value.
          - `on_behalf_of` union — 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.
            - string
            - Account — For new integrations, we recommend using the [Accounts v2 API](/api/v2/core/accounts), in place of /v1/accounts and /v1/customers to represent a user. This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, the properties below are always returned. For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, some properties are only returned until you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions) to start Connect Onboarding. Learn about the [differences between accounts](/connect/accounts).
              - …
          - `parent` BillingBillResourceInvoicingParentsInvoiceParent
            - `quote_details` BillingBillResourceInvoicingParentsInvoiceQuoteParent
              - …
            - `subscription_details` BillingBillResourceInvoicingParentsInvoiceSubscriptionParent
              - …
            - `type` 'quote_details' | 'subscription_details', required — The type of parent that generated this invoice
          - `payment_settings` InvoicesPaymentSettings, required
            - `default_mandate` string, nullable — ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
            - `payment_method_options` InvoicesPaymentMethodOptions
              - …
            - `payment_method_types` string[], nullable — The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
          - `payments` object — Payments for this invoice. Use [invoice payment](/api/invoice-payment) to get more details.
            - `data` InvoicePayment[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `period_end` integer, required — The latest timestamp at which invoice items can be associated with this invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
          - `period_start` integer, required — The earliest timestamp at which invoice items can be associated with this invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
          - `post_payment_credit_notes_amount` integer, required — Total amount of all post-payment credit notes issued for this invoice.
          - `pre_payment_credit_notes_amount` integer, required — Total amount of all pre-payment credit notes issued for this invoice.
          - `receipt_number` string, nullable — This is the transaction number that appears on email receipts sent for this invoice.
          - `rendering` InvoicesResourceInvoiceRendering
            - `amount_tax_display` string, nullable — How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
            - `pdf` InvoiceRenderingPdf
              - …
            - `template` string, nullable — ID of the rendering template that the invoice is formatted by.
            - `template_version` integer, nullable — Version of the rendering template that the invoice is using.
          - `shipping_cost` InvoicesResourceShippingCost
            - `amount_subtotal` integer, required — Total shipping cost before any taxes are applied.
            - `amount_tax` integer, required — Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
            - `amount_total` integer, required — Total shipping cost after taxes are applied.
            - `shipping_rate` union — The ID of the ShippingRate for this invoice.
              - …
            - `taxes` LineItemsTaxAmount[] — The taxes applied to the shipping rate.
              - …
          - `shipping_details` Shipping
            - `address` Address
              - …
            - `carrier` string, nullable — The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
            - `name` string — Recipient name.
            - `phone` string, nullable — Recipient phone (including extension).
            - `tracking_number` string, nullable — The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
          - `starting_balance` integer, required — Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
          - `statement_descriptor` string, nullable — Extra information about an invoice for the customer's credit card statement.
          - `status` 'draft' | 'open' | 'paid' | 'uncollectible' | 'void', nullable — The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview)
          - `status_transitions` InvoicesResourceStatusTransitions, required
            - `finalized_at` integer, nullable — The time that the invoice draft was finalized.
            - `marked_uncollectible_at` integer, nullable — The time that the invoice was marked uncollectible.
            - `paid_at` integer, nullable — The time that the invoice was paid.
            - `voided_at` integer, nullable — The time that the invoice was voided.
          - `subtotal` integer, required — Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
          - `subtotal_excluding_tax` integer, nullable — The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
          - `test_clock` union — ID of the test clock this invoice belongs to.
            - string
            - TestHelpersTestClock — 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.
              - …
          - `threshold_reason` InvoiceThresholdReason
            - `amount_gte` integer, nullable — The total invoice amount threshold boundary if it triggered the threshold invoice.
            - `item_reasons` InvoiceItemThresholdReason[], required — Indicates which line items triggered a threshold invoice.
              - …
          - `total` integer, required — Total after discounts and taxes.
          - `total_discount_amounts` DiscountsResourceDiscountAmount[], nullable — The aggregate amounts calculated per discount across all line items.
            - `amount` integer, required — The amount, in cents (or local equivalent), of the discount.
            - `discount` union, required — The discount that was applied to get this discount amount.
              - …
          - `total_excluding_tax` integer, nullable — The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
          - `total_pretax_credit_amounts` InvoicesResourcePretaxCreditAmount[], nullable — Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
            - `amount` integer, required — The amount, in cents (or local equivalent), of the pretax credit amount.
            - `credit_balance_transaction` union — The credit balance transaction that was applied to get this pretax credit amount.
              - …
            - `discount` union — The discount that was applied to get this pretax credit amount.
              - …
            - `type` 'credit_balance_transaction' | 'discount', required — Type of the pretax credit amount referenced.
          - `total_taxes` BillingBillResourceInvoicingTaxesTax[], nullable — The aggregate tax information of all line items.
            - `amount` integer, required — The amount of the tax, in cents (or local equivalent).
            - `tax_behavior` 'exclusive' | 'inclusive', required — Whether this tax is inclusive or exclusive.
            - `tax_rate_details` BillingBillResourceInvoicingTaxesTaxRateDetails
              - …
            - `taxability_reason` 'customer_exempt' | 'not_available' | 'not_collecting' | 'not_subject_to_tax' | 'not_supported' | 'portion_product_exempt' | 'portion_reduced_rated' | 'portion_standard_rated' | 'product_exempt' | 'product_exempt_holiday' | 'proportionally_rated' | 'reduced_rated' | 'reverse_charge' | 'standard_rated' | 'taxable_basis_reduced' | 'zero_rated', required — The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
            - `taxable_amount` integer, nullable — The amount on which tax is calculated, in cents (or local equivalent).
            - `type` 'tax_rate_details', required — The type of tax information.
          - `webhooks_delivered_at` integer, nullable — Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://docs.stripe.com/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
      - `invoice_line_item` string, required — The invoice line item to which the reinstated billing credits were originally applied.
    - `type` 'credits_application_invoice_voided' | 'credits_granted', required — The type of credit transaction.
  - `credit_grant` union, required — The credit grant associated with this credit balance transaction.
    - string
    - BillingCreditGrant — A credit grant is an API resource that documents the allocation of some billing credits to a customer. Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
      - `amount` BillingCreditGrantsResourceAmount, required
        - `monetary` BillingCreditGrantsResourceMonetaryAmount
          - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
          - `value` integer, required — A positive integer representing the amount.
        - `type` 'monetary', required — The type of this amount. We currently only support `monetary` billing credits.
      - `applicability_config` BillingCreditGrantsResourceApplicabilityConfig, required
        - `scope` BillingCreditGrantsResourceScope, required
          - `price_type` 'metered' — The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `prices`.
          - `prices` BillingCreditGrantsResourceApplicablePrice[] — The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `price_type`.
            - `id` string, nullable — Unique identifier for the object.
      - `category` 'paid' | 'promotional', required — The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
      - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
      - `customer` union, required — ID of the customer receiving the billing credits.
        - string
        - Customer — This object represents a customer of your business. Use it to [create recurring charges](https://docs.stripe.com/invoicing/customer), [save payment](https://docs.stripe.com/payments/save-during-payment) and contact information, and track payments that belong to the same customer.
          - `address` Address
            - `city` string, nullable — City, district, suburb, town, or village.
            - `country` string, nullable — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            - `line1` string, nullable — Address line 1, such as the street, PO Box, or company name.
            - `line2` string, nullable — Address line 2, such as the apartment, suite, unit, or building.
            - `postal_code` string, nullable — ZIP or postal code.
            - `state` string, nullable — State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
          - `balance` integer — The current balance, if any, that's stored on the customer in their default currency. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. For multi-currency balances, see [invoice_credit_balance](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance).
          - `business_name` string — The customer's business name.
          - `cash_balance` CashBalance — A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.
            - `available` object, nullable — A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
            - `customer` string, required — The ID of the customer whose cash balance this object represents.
            - `customer_account` string, nullable — The ID of an Account representing a customer whose cash balance this object represents.
            - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
            - `object` 'cash_balance', required — String representing the object's type. Objects of the same type share the same value.
            - `settings` CustomerBalanceCustomerBalanceSettings, required
              - …
          - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
          - `currency` string, nullable — Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes.
          - `customer_account` string, nullable — The ID of an Account representing a customer. You can use this ID with any v1 API that accepts a customer_account parameter.
          - `default_source` union — ID of the default payment source for the customer. If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead.
            - string
            - BankAccount — These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](/payments/bank-debits-transfers)
              - …
            - Card — You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://docs.stripe.com/sources/cards)
              - …
            - Source — `Source` objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://docs.stripe.com/api/sources). We recommend that you adopt the [PaymentMethods API](https://docs.stripe.com/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://docs.stripe.com/sources) and [Sources & Customers](https://docs.stripe.com/sources/customers).
              - …
          - `delinquent` boolean, nullable — Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://docs.stripe.com/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`.
          - `description` string, nullable — An arbitrary string attached to the object. Often useful for displaying to users.
          - `discount` Discount — A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts)
            - `checkout_session` string, nullable — The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Not present for subscription mode.
            - `customer` union — The ID of the customer associated with this discount.
              - …
            - `customer_account` string, nullable — The ID of the account representing the customer associated with this discount.
            - `end` integer, nullable — If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null.
            - `id` string, required — The ID of the discount object. Discounts can't be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.
            - `invoice` string, nullable — The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
            - `invoice_item` string, nullable — The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
            - `object` 'discount', required — String representing the object's type. Objects of the same type share the same value.
            - `promotion_code` union — The promotion code applied to create this discount.
              - …
            - `source` DiscountSource, required
              - …
            - `start` integer, required — Date that the coupon was applied.
            - `subscription` string, nullable — The subscription that this coupon is applied to, if it is applied to a particular subscription.
            - `subscription_item` string, nullable — The subscription item that this coupon is applied to, if it is applied to a particular subscription item.
          - `email` string, nullable — The customer's email address.
          - `id` string, required — Unique identifier for the object.
          - `individual_name` string — The customer's individual name.
          - `invoice_credit_balance` object — The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
          - `invoice_prefix` string, nullable — The prefix for the customer used to generate unique invoice numbers.
          - `invoice_settings` InvoiceSettingCustomerSetting
            - `custom_fields` InvoiceSettingCustomField[], nullable — Default custom fields to be displayed on invoices for this customer.
              - …
            - `default_payment_method` union — ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.
              - …
            - `footer` string, nullable — Default footer to be displayed on invoices for this customer.
            - `rendering_options` InvoiceSettingCustomerRenderingOptions
              - …
          - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
          - `metadata` object — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
          - `name` string, nullable — The customer's full name or business name.
          - `next_invoice_sequence` integer — The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
          - `object` 'customer', required — String representing the object's type. Objects of the same type share the same value.
          - `phone` string, nullable — The customer's phone number.
          - `preferred_locales` string[], nullable — The customer's preferred locales (languages), ordered by preference.
          - `shipping` Shipping
            - `address` Address
              - …
            - `carrier` string, nullable — The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
            - `name` string — Recipient name.
            - `phone` string, nullable — Recipient phone (including extension).
            - `tracking_number` string, nullable — The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
          - `sources` object — The customer's payment sources, if any.
            - `data` union[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `subscriptions` object — The customer's current subscriptions, if any.
            - `data` Subscription[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `tax` CustomerTax
            - `automatic_tax` 'failed' | 'not_collecting' | 'supported' | 'unrecognized_location', required — Surfaces if automatic tax computation is possible given the current customer location information.
            - `ip_address` string, nullable — A recent IP address of the customer used for tax reporting and tax location inference.
            - `location` CustomerTaxLocation
              - …
            - `provider` 'anrok' | 'avalara' | 'sphere' | 'stripe', required — The tax calculation provider used for location resolution. Defaults to `stripe` when not using a [third-party provider](/tax/third-party-apps).
          - `tax_exempt` 'exempt' | 'none' | 'reverse', nullable — Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**.
          - `tax_ids` object — The customer's tax IDs.
            - `data` TaxId[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `test_clock` union — ID of the test clock that this customer belongs to.
            - string
            - TestHelpersTestClock — 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.
              - …
        - DeletedCustomer
          - `deleted` true, required — Always true for a deleted object
          - `id` string, required — Unique identifier for the object.
          - `object` 'customer', required — String representing the object's type. Objects of the same type share the same value.
      - `customer_account` string, nullable — ID of the account representing the customer receiving the billing credits
      - `effective_at` integer, nullable — The time when the billing credits become effective-when they're eligible for use.
      - `expires_at` integer, nullable — The time when the billing credits expire. If not present, the billing credits don't expire.
      - `id` string, required — Unique identifier for the object.
      - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
      - `metadata` object, required — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      - `name` string, nullable — A descriptive name shown in dashboard.
      - `object` 'billing.credit_grant', required — String representing the object's type. Objects of the same type share the same value.
      - `priority` integer, nullable — The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
      - `test_clock` union — ID of the test clock this credit grant belongs to.
        - string
        - TestHelpersTestClock — 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.
          - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
          - `deletes_after` integer, required — Time at which this clock is scheduled to auto delete.
          - `frozen_time` integer, required — Time at which all objects belonging to this clock are frozen.
          - `id` string, required — Unique identifier for the object.
          - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
          - `name` string, nullable — The custom name supplied at creation.
          - `object` 'test_helpers.test_clock', required — String representing the object's type. Objects of the same type share the same value.
          - `status` 'advancing' | 'internal_failure' | 'ready', required — The status of the Test Clock.
          - `status_details` BillingClocksResourceStatusDetailsStatusDetails, required
            - `advancing` BillingClocksResourceStatusDetailsAdvancingStatusDetails
              - …
      - `updated` integer, required — Time at which the object was last updated. Measured in seconds since the Unix epoch.
      - `voided_at` integer, nullable — The time when this credit grant was voided. If not present, the credit grant hasn't been voided.
  - `debit` BillingCreditGrantsResourceBalanceDebit
    - `amount` BillingCreditGrantsResourceAmount, required
      - `monetary` BillingCreditGrantsResourceMonetaryAmount
        - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
        - `value` integer, required — A positive integer representing the amount.
      - `type` 'monetary', required — The type of this amount. We currently only support `monetary` billing credits.
    - `credits_applied` BillingCreditGrantsResourceBalanceCreditsApplied
      - `invoice` union, required — The invoice to which the billing credits were applied.
        - string
        - Invoice — Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, Stripe automatically finalizes your invoice and attempts payment. Note that finalizing the invoice, [when automatic](https://docs.stripe.com/invoicing/integration/automatic-advancement-collection), does not happen immediately as the invoice is created. Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice. If your invoice is configured to be billed by sending an email, then based on your [email settings](https://dashboard.stripe.com/account/billing/automatic), Stripe will email the invoice to your customer and await payment. These emails can contain a link to a hosted page to pay the invoice. Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice. More details on the customer's credit balance are [here](https://docs.stripe.com/billing/customer/balance). Related guide: [Send invoices to customers](https://docs.stripe.com/billing/invoices/sending)
          - `account_country` string, nullable — The country of the business associated with this invoice, most often the business creating the invoice.
          - `account_name` string, nullable — The public name of the business associated with this invoice, most often the business creating the invoice.
          - `account_tax_ids` union[], nullable — The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
            - union
              - …
          - `amount_due` integer, required — Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
          - `amount_overpaid` integer, required — Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
          - `amount_paid` integer, required — The amount, in cents (or local equivalent), that was paid.
          - `amount_paid_off_stripe` integer, required — Amount, in cents (or local equivalent), that was paid on the invoice outside of Stripe.
          - `amount_remaining` integer, required — The difference between amount_due and amount_paid, in cents (or local equivalent).
          - `amount_shipping` integer, required — This is the sum of all the shipping amounts.
          - `application` union — ID of the Connect Application that created the invoice.
            - string
            - Application
              - …
            - DeletedApplication
              - …
          - `attempt_count` integer, required — Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
          - `attempted` boolean, required — Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
          - `auto_advance` boolean, required — Controls whether Stripe performs [automatic collection](https://docs.stripe.com/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
          - `automatic_tax` AutomaticTax, required
            - `disabled_reason` 'finalization_requires_location_inputs' | 'finalization_system_error', nullable — If Stripe disabled automatic tax, this enum describes why.
            - `enabled` boolean, required — Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://docs.stripe.com/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
            - `liability` ConnectAccountReference
              - …
            - `provider` string, nullable — The tax provider powering automatic tax.
            - `status` 'complete' | 'failed' | 'requires_location_inputs', nullable — The status of the most recent automated tax calculation for this invoice.
          - `automatically_finalizes_at` integer, nullable — The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
          - `billing_reason` 'automatic_pending_invoice_item_invoice' | 'manual' | 'quote_accept' | 'subscription' | 'subscription_create' | 'subscription_cycle' | 'subscription_threshold' | 'subscription_update' | 'upcoming', nullable — Indicates the reason why the invoice was created. * `manual`: Unrelated to a subscription, for example, created via the invoice editor. * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for upcoming invoices created through the Create Preview Invoice API or when an `invoice.upcoming` event is generated for an upcoming invoice on a subscription.
          - `collection_method` 'charge_automatically' | 'send_invoice', required — Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
          - `confirmation_secret` InvoicesResourceConfirmationSecret
            - `client_secret` string, required — The client_secret of the payment that Stripe creates for the invoice after finalization.
            - `type` string, required — The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization
          - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
          - `currency` string, currency, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
          - `custom_fields` InvoiceSettingCustomField[], nullable — Custom fields displayed on the invoice.
            - `name` string, required — The name of the custom field.
            - `value` string, required — The value of the custom field.
          - `customer` union, required — The ID of the customer to bill.
            - string
            - Customer — This object represents a customer of your business. Use it to [create recurring charges](https://docs.stripe.com/invoicing/customer), [save payment](https://docs.stripe.com/payments/save-during-payment) and contact information, and track payments that belong to the same customer.
              - …
            - DeletedCustomer
              - …
          - `customer_account` string, nullable — The ID of the account representing the customer to bill.
          - `customer_address` Address
            - `city` string, nullable — City, district, suburb, town, or village.
            - `country` string, nullable — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            - `line1` string, nullable — Address line 1, such as the street, PO Box, or company name.
            - `line2` string, nullable — Address line 2, such as the apartment, suite, unit, or building.
            - `postal_code` string, nullable — ZIP or postal code.
            - `state` string, nullable — State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
          - `customer_email` string, nullable — The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_name` string, nullable — The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_phone` string, nullable — The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_shipping` Shipping
            - `address` Address
              - …
            - `carrier` string, nullable — The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
            - `name` string — Recipient name.
            - `phone` string, nullable — Recipient phone (including extension).
            - `tracking_number` string, nullable — The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
          - `customer_tax_exempt` 'exempt' | 'none' | 'reverse', nullable — The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
          - `customer_tax_ids` InvoicesResourceInvoiceTaxId[], nullable — The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
            - `type` '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' | 'unknown' | 'us_ein' | 'uy_ruc' | 'uz_tin' | 'uz_vat' | 've_rif' | 'vn_tin' | 'za_vat' | 'zm_tin' | 'zw_tin', required — The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown`
            - `value` string, nullable — The value of the tax ID.
          - `default_payment_method` union — ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
            - string
            - PaymentMethod — PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
              - …
          - `default_source` union — ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
            - string
            - BankAccount — These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](/payments/bank-debits-transfers)
              - …
            - Card — You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://docs.stripe.com/sources/cards)
              - …
            - Source — `Source` objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://docs.stripe.com/api/sources). We recommend that you adopt the [PaymentMethods API](https://docs.stripe.com/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://docs.stripe.com/sources) and [Sources & Customers](https://docs.stripe.com/sources/customers).
              - …
          - `default_tax_rates` TaxRate[], required — The tax rates applied to this invoice, if any.
            - `active` boolean, required — Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.
            - `country` string, nullable — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
            - `description` string, nullable — An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
            - `display_name` string, required — The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
            - `effective_percentage` number, nullable — Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction.
            - `flat_amount` TaxRateFlatAmount — The amount of the tax rate when the `rate_type`` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate.
              - …
            - `id` string, required — Unique identifier for the object.
            - `inclusive` boolean, required — This specifies if the tax rate is inclusive or exclusive.
            - `jurisdiction` string, nullable — The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
            - `jurisdiction_level` 'city' | 'country' | 'county' | 'district' | 'multiple' | 'state', nullable — The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates.
            - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
            - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
            - `object` 'tax_rate', required — String representing the object's type. Objects of the same type share the same value.
            - `percentage` number, required — Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions.
            - `rate_type` 'flat_amount' | 'percentage', nullable — Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax.
            - `state` string, nullable — [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States.
            - `tax_type` 'amusement_tax' | 'communications_tax' | 'gst' | 'hst' | 'igst' | 'jct' | 'lease_tax' | 'mass_transit_parking_tax' | 'parking_tax' | 'pst' | 'qst' | 'retail_delivery_fee' | 'rst' | 'sales_tax' | 'service_tax' | 'vat', nullable — The high-level tax type, such as `vat` or `sales_tax`.
          - `description` string, nullable — An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
          - `discounts` union[], required — The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
            - union
              - …
          - `due_date` integer, nullable — The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
          - `effective_at` integer, nullable — The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
          - `ending_balance` integer, nullable — Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
          - `footer` string, nullable — Footer displayed on the invoice.
          - `from_invoice` InvoicesResourceFromInvoice
            - `action` string, required — The relation between this invoice and the cloned invoice
            - `invoice` union, required — The invoice that was cloned.
              - …
          - `hosted_invoice_url` string, nullable — The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
          - `id` string, required — Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
          - `invoice_pdf` string, nullable — The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
          - `issuer` ConnectAccountReference, required
            - `account` union — The connected account being referenced when `type` is `account`.
              - …
            - `type` 'account' | 'self', required — Type of the account referenced.
          - `last_finalization_error` ApiErrors
            - `advice_code` string — For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one.
            - `charge` string — For card errors, the ID of the failed charge.
            - `code` string — For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
            - `decline_code` string — For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
            - `doc_url` string — A URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
            - `message` string — A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
            - `network_advice_code` string — For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
            - `network_decline_code` string — For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
            - `param` string — If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
            - `payment_intent` PaymentIntent — A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](/payments/paymentintents/lifecycle) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://docs.stripe.com/payments/payment-intents)
              - …
            - `payment_method` PaymentMethod — PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
              - …
            - `payment_method_type` string — If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
            - `request_log_url` string — A URL to the request log entry in your dashboard.
            - `setup_intent` SetupIntent — A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
              - …
            - `source` union — The [source object](https://docs.stripe.com/api/sources/object) for errors returned on a request involving a source.
              - …
            - `type` 'api_error' | 'card_error' | 'idempotency_error' | 'invalid_request_error', required — The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
          - `latest_revision` union — The ID of the most recent non-draft revision of this invoice
            - string
            - Invoice — recursive
          - `lines` object, required — The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
            - `data` LineItem[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
          - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
          - `next_payment_attempt` integer, nullable — The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
          - `number` string, nullable — A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
          - `object` 'invoice', required — String representing the object's type. Objects of the same type share the same value.
          - `on_behalf_of` union — 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.
            - string
            - Account — For new integrations, we recommend using the [Accounts v2 API](/api/v2/core/accounts), in place of /v1/accounts and /v1/customers to represent a user. This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, the properties below are always returned. For accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, some properties are only returned until you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions) to start Connect Onboarding. Learn about the [differences between accounts](/connect/accounts).
              - …
          - `parent` BillingBillResourceInvoicingParentsInvoiceParent
            - `quote_details` BillingBillResourceInvoicingParentsInvoiceQuoteParent
              - …
            - `subscription_details` BillingBillResourceInvoicingParentsInvoiceSubscriptionParent
              - …
            - `type` 'quote_details' | 'subscription_details', required — The type of parent that generated this invoice
          - `payment_settings` InvoicesPaymentSettings, required
            - `default_mandate` string, nullable — ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
            - `payment_method_options` InvoicesPaymentMethodOptions
              - …
            - `payment_method_types` string[], nullable — The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
          - `payments` object — Payments for this invoice. Use [invoice payment](/api/invoice-payment) to get more details.
            - `data` InvoicePayment[], required — Details about each object.
              - …
            - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
            - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
            - `url` string, required — The URL where this list can be accessed.
          - `period_end` integer, required — The latest timestamp at which invoice items can be associated with this invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
          - `period_start` integer, required — The earliest timestamp at which invoice items can be associated with this invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
          - `post_payment_credit_notes_amount` integer, required — Total amount of all post-payment credit notes issued for this invoice.
          - `pre_payment_credit_notes_amount` integer, required — Total amount of all pre-payment credit notes issued for this invoice.
          - `receipt_number` string, nullable — This is the transaction number that appears on email receipts sent for this invoice.
          - `rendering` InvoicesResourceInvoiceRendering
            - `amount_tax_display` string, nullable — How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
            - `pdf` InvoiceRenderingPdf
              - …
            - `template` string, nullable — ID of the rendering template that the invoice is formatted by.
            - `template_version` integer, nullable — Version of the rendering template that the invoice is using.
          - `shipping_cost` InvoicesResourceShippingCost
            - `amount_subtotal` integer, required — Total shipping cost before any taxes are applied.
            - `amount_tax` integer, required — Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
            - `amount_total` integer, required — Total shipping cost after taxes are applied.
            - `shipping_rate` union — The ID of the ShippingRate for this invoice.
              - …
            - `taxes` LineItemsTaxAmount[] — The taxes applied to the shipping rate.
              - …
          - `shipping_details` Shipping
            - `address` Address
              - …
            - `carrier` string, nullable — The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
            - `name` string — Recipient name.
            - `phone` string, nullable — Recipient phone (including extension).
            - `tracking_number` string, nullable — The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
          - `starting_balance` integer, required — Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
          - `statement_descriptor` string, nullable — Extra information about an invoice for the customer's credit card statement.
          - `status` 'draft' | 'open' | 'paid' | 'uncollectible' | 'void', nullable — The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview)
          - `status_transitions` InvoicesResourceStatusTransitions, required
            - `finalized_at` integer, nullable — The time that the invoice draft was finalized.
            - `marked_uncollectible_at` integer, nullable — The time that the invoice was marked uncollectible.
            - `paid_at` integer, nullable — The time that the invoice was paid.
            - `voided_at` integer, nullable — The time that the invoice was voided.
          - `subtotal` integer, required — Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
          - `subtotal_excluding_tax` integer, nullable — The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
          - `test_clock` union — ID of the test clock this invoice belongs to.
            - string
            - TestHelpersTestClock — 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.
              - …
          - `threshold_reason` InvoiceThresholdReason
            - `amount_gte` integer, nullable — The total invoice amount threshold boundary if it triggered the threshold invoice.
            - `item_reasons` InvoiceItemThresholdReason[], required — Indicates which line items triggered a threshold invoice.
              - …
          - `total` integer, required — Total after discounts and taxes.
          - `total_discount_amounts` DiscountsResourceDiscountAmount[], nullable — The aggregate amounts calculated per discount across all line items.
            - `amount` integer, required — The amount, in cents (or local equivalent), of the discount.
            - `discount` union, required — The discount that was applied to get this discount amount.
              - …
          - `total_excluding_tax` integer, nullable — The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
          - `total_pretax_credit_amounts` InvoicesResourcePretaxCreditAmount[], nullable — Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
            - `amount` integer, required — The amount, in cents (or local equivalent), of the pretax credit amount.
            - `credit_balance_transaction` union — The credit balance transaction that was applied to get this pretax credit amount.
              - …
            - `discount` union — The discount that was applied to get this pretax credit amount.
              - …
            - `type` 'credit_balance_transaction' | 'discount', required — Type of the pretax credit amount referenced.
          - `total_taxes` BillingBillResourceInvoicingTaxesTax[], nullable — The aggregate tax information of all line items.
            - `amount` integer, required — The amount of the tax, in cents (or local equivalent).
            - `tax_behavior` 'exclusive' | 'inclusive', required — Whether this tax is inclusive or exclusive.
            - `tax_rate_details` BillingBillResourceInvoicingTaxesTaxRateDetails
              - …
            - `taxability_reason` 'customer_exempt' | 'not_available' | 'not_collecting' | 'not_subject_to_tax' | 'not_supported' | 'portion_product_exempt' | 'portion_reduced_rated' | 'portion_standard_rated' | 'product_exempt' | 'product_exempt_holiday' | 'proportionally_rated' | 'reduced_rated' | 'reverse_charge' | 'standard_rated' | 'taxable_basis_reduced' | 'zero_rated', required — The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
            - `taxable_amount` integer, nullable — The amount on which tax is calculated, in cents (or local equivalent).
            - `type` 'tax_rate_details', required — The type of tax information.
          - `webhooks_delivered_at` integer, nullable — Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://docs.stripe.com/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
      - `invoice_line_item` string, required — The invoice line item to which the billing credits were applied.
    - `type` 'credits_applied' | 'credits_expired' | 'credits_voided', required — The type of debit transaction.
  - `effective_at` integer, required — The effective time of this credit balance transaction.
  - `id` string, required — Unique identifier for the object.
  - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
  - `object` 'billing.credit_balance_transaction', required — String representing the object's type. Objects of the same type share the same value.
  - `test_clock` union — ID of the test clock this credit balance transaction belongs to.
    - string
    - TestHelpersTestClock — 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.
      - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
      - `deletes_after` integer, required — Time at which this clock is scheduled to auto delete.
      - `frozen_time` integer, required — Time at which all objects belonging to this clock are frozen.
      - `id` string, required — Unique identifier for the object.
      - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
      - `name` string, nullable — The custom name supplied at creation.
      - `object` 'test_helpers.test_clock', required — String representing the object's type. Objects of the same type share the same value.
      - `status` 'advancing' | 'internal_failure' | 'ready', required — The status of the Test Clock.
      - `status_details` BillingClocksResourceStatusDetailsStatusDetails, required
        - `advancing` BillingClocksResourceStatusDetailsAdvancingStatusDetails
          - `target_frozen_time` integer, required — The `frozen_time` that the Test Clock is advancing towards.
  - `type` 'credit' | 'debit', nullable — The type of credit balance transaction (credit or debit).

## Other responses

- `default` — Error response.

---

[API](https://skmtc.net/stripe/apis/spec3.md) · [All operations](https://skmtc.net/stripe/apis/spec3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stripe/spec3/revisions/3653ad45bbec/schema)
