# Create an invoice

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/invoices:
    post:
      summary: Create an invoice
      deprecated: false
      description: ''
      tags:
        - API Reference/Invoices
      parameters:
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-apifox-refs:
                01HC51AT87PK5KHQQG1V1GTJ2M: &ref_1
                  $ref: '#/components/schemas/Invoice'
                  x-apifox-overrides:
                    id: null
                    object: null
                    charge: null
                    hosted_invoice_url: null
                    status: null
                    automatic_tax: null
                    account_tax_ids: null
                    amount_shipping: null
                    amount_remaining: null
                    customer_tax_exempt: null
                    customer_tax_ids: null
                    default_tax_rates: null
                    discount: null
                    discounts: null
                    ending_balance: null
                    post_payment_credit_notes_amount: null
                    pre_payment_credit_notes_amount: null
                    quote: null
                    shipping_cost: null
                    shipping_details: null
                    total_discount_amounts: null
                    total_excluding_tax: null
                    total_tax_amounts: null
                    transfer_data: null
                    webhooks_delivered_at: null
                    subtotal_excluding_tax: null
                    subtotal: null
                    subscription_proration_date: null
                    customer_address: null
                    customer_email: null
                    customer_name: null
                    customer_phone: null
                    created: null
                    billing_reason: null
                    customer_shipping: null
                    period_end: null
                    period_start: null
                    threshold_reason: null
                    subscription_details: null
                    status_transitions: null
                    starting_balance: null
                    rendering: null
                    receipt_number: null
                    livemode: null
                    latest_revision: null
                    last_finalization_error: null
                    invoice_pdf: null
                    paid_out_of_band: null
                    paid: null
                    number: null
                    next_payment_attempt: null
                    tax: null
                    test_clock: null
                    attempt_count: null
                    attempted: null
                    default_source: null
                    amount_paid: null
                    amount_due: null
                    account_name: null
                    account_country: null
                    total: null
                    payment_intent: null
                    lines: null
              x-apifox-orders:
                - 01HC51AT87PK5KHQQG1V1GTJ2M
                - days_until_due
                - pending_invoice_items_behavior
                - lines
                - total_amount
                - lines_url
                - number
              properties:
                currency:
                  type: string
                  description: Three-letter ISO currency code
                customer:
                  type: string
                  description: The ID of the customer who will be billed.
                auto_advance:
                  type: boolean
                  description: ' If false, the invoice’s state doesn’t automatically advance without an explicit actio'
                collection_method:
                  type: string
                  description: Either charge_automatically, or send_invoice
                description:
                  type: string
                  description: >-
                    An arbitrary string attached to the object. Often useful for
                    displaying to users.
                metadata:
                  type: object
                  properties: {}
                  x-apifox-orders: []
                  description: >-
                    Set of key-value pairs that you can attach to an object.
                    This can be useful for storing additional information about
                    the object in a structured format.
                  x-apifox-ignore-properties: []
                subscription:
                  type: string
                  description: >-
                    EXPANDABLE. The subscription that this invoice was prepared
                    for, if any.
                amount_precision:
                  type: integer
                  description: >-
                    This field controls the precision of the amount displayed on
                    the invoice. If amount_precision is set to 3, it means the
                    smallest decimal for the amount parameter is 3. This field
                    only affects the display. For actual deductions, please
                    refer to the minimum unit of the supported currency. The
                    default value is the minimum unit of the currency.
                custom_fields:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the custom field.
                      value:
                        type: string
                        description: The value of the custom field.
                    x-apifox-orders:
                      - name
                      - value
                    x-apifox-ignore-properties: []
                  description: >-
                    A list of up to 4 custom fields to be displayed on the
                    invoice.
                default_payment_method:
                  type: string
                  description: >-
                    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
                due_date:
                  type: string
                  description: >-
                    timestamp.The date on which payment for this invoice is due.
                    This value will be null for invoices where
                    collection_method=charge_automatically.
                effective_at:
                  type: string
                  description: >-
                    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.
                footer:
                  type: string
                  description: Footer displayed on the invoice.
                from_invoice:
                  type: object
                  properties:
                    action:
                      type: string
                      description: >-
                        The relation between the new invoice and the original
                        invoice. Currently, only ‘revision’ is permitted
                    invoice:
                      type: string
                      description: The id of the invoice that will be cloned.
                  x-apifox-orders:
                    - action
                    - invoice
                  required:
                    - action
                    - invoice
                  x-apifox-ignore-properties: []
                payment_settings:
                  type: object
                  properties:
                    default_mandate:
                      type: string
                      description: >-
                        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:
                      type: object
                      properties:
                        card:
                          type: object
                          properties:
                            request_three_d_secure:
                              type: string
                              description: '`automatic` or `any`'
                          x-apifox-orders:
                            - request_three_d_secure
                          x-apifox-ignore-properties: []
                      x-apifox-orders:
                        - card
                      description: >-
                        Payment-method-specific configuration to provide to the
                        invoice’s PaymentIntent.
                      x-apifox-ignore-properties: []
                    payment_method_types:
                      type: string
                      description: >-
                        The list of payment method types (e.g. card) to provide
                        to the invoice’s PaymentIntent.
                  x-apifox-orders:
                    - default_mandate
                    - payment_method_options
                    - payment_method_types
                  x-apifox-ignore-properties: []
                statement_descriptor:
                  type: string
                  description: >-
                    Extra information about an invoice for the customer’s credit
                    card statement.
                rounding_rule:
                  type: string
                  enum:
                    - round_up
                    - round_down
                  description: >-
                    If amount_precision is defined, this field is used to
                    control rounding of the amount to the smallest unit
                    supported by the currency.
                  x-apifox-enum:
                    - value: round_up
                      name: ''
                      description: Default
                    - value: round_down
                      name: ''
                      description: ''
                days_until_due:
                  type: string
                  description: >-
                    The number of days from when the invoice is created until it
                    is due. Valid only for invoices where
                    collection_method=send_invoice.
                pending_invoice_items_behavior:
                  type: string
                  description: >-
                    How to handle pending invoice items on invoice creation. One
                    of include or exclude. include will include any pending
                    invoice items, and will create an empty draft invoice if no
                    pending invoice items exist. exclude will always create an
                    empty invoice draft regardless if there are pending invoice
                    items or not. Defaults to exclude if the parameter is
                    omitted.
                lines:
                  type: array
                  items:
                    type: object
                    x-apifox-refs:
                      01J7K8K3E6A754D9M9CY149CJG:
                        $ref: '#/components/schemas/Invoice%20item'
                        x-apifox-overrides:
                          id: null
                          object: null
                          customer: null
                          period: null
                          price: &ref_0
                            type: string
                            description: >-
                              The ID of the price object. One of price or
                              price_data is required.
                          date: null
                          invoice: null
                          livemode: null
                          subscription: null
                          test_clock: null
                          proration: null
                          tax_rates: null
                          discountable: null
                          discounts: null
                          unit_amount_decimal: null
                    x-apifox-orders:
                      - 01J7K8K3E6A754D9M9CY149CJG
                    properties:
                      amount:
                        type: integer
                        description: >-
                          Amount (in the currency specified) of the invoice
                          item. This should always be equal to unit_amount *
                          quantity.
                      currency:
                        type: string
                        description: Three-letter ISO currency code
                      description:
                        type: string
                        description: >-
                          An arbitrary string attached to the object. Often
                          useful for displaying to users.
                      metadata:
                        type: object
                        properties: {}
                        description: >-
                          Set of key-value pairs that you can attach to an
                          object.
                        x-apifox-orders: []
                        x-apifox-ignore-properties: []
                      price: *ref_0
                      quantity:
                        type: integer
                        description: >-
                          The quantity of the subscription, if the line item is
                          a subscription or a proration.
                      unit_amount:
                        type: integer
                        description: >-
                          The integer unit amount in pence of the charge to be
                          applied to the upcoming invoice. This unit_amount will
                          be multiplied by the quantity to get the full amount.
                          Passing in a negative unit_amount will reduce the
                          amount_due on the invoice.
                    x-apifox-ignore-properties:
                      - amount
                      - currency
                      - description
                      - metadata
                      - price
                      - quantity
                      - unit_amount
                  description: >-
                    A list of items to be added to a draft invoice (up to 250
                    items per invoice)
                total_amount:
                  type: integer
                lines_url:
                  type: string
                number:
                  type: string
                  description: >-
                    Set the number for this invoice. If no number is present
                    then a number will be assigned automatically when the
                    invoice is finalized.
              x-apifox-ignore-properties:
                - currency
                - customer
                - auto_advance
                - collection_method
                - description
                - metadata
                - subscription
                - amount_precision
                - custom_fields
                - default_payment_method
                - due_date
                - effective_at
                - footer
                - from_invoice
                - payment_settings
                - statement_descriptor
                - rounding_rule
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01HC77SA1VSVTDDZ6ZWPPFR340: *ref_1
                x-apifox-orders:
                  - 01HC77SA1VSVTDDZ6ZWPPFR340
                properties:
                  id:
                    type: string
                  currency:
                    type: string
                    description: Three-letter ISO currency code
                  customer:
                    type: string
                    description: The ID of the customer who will be billed.
                  object:
                    type: string
                    description: >-
                      String representing the object’s type. Objects of the same
                      type share the same value.
                  auto_advance:
                    type: boolean
                    description: ' If false, the invoice’s state doesn’t automatically advance without an explicit actio'
                  charge:
                    type: string
                    description: >-
                      ID of the latest charge generated for this invoice, if
                      any.
                  collection_method:
                    type: string
                    description: Either charge_automatically, or send_invoice
                  description:
                    type: string
                    description: >-
                      An arbitrary string attached to the object. Often useful
                      for displaying to users.
                  hosted_invoice_url:
                    type: string
                    description: >-
                      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.
                  lines:
                    type: object
                    properties:
                      object:
                        type: string
                        description: value is "list"
                      data:
                        type: array
                        items:
                          type: object
                          x-apifox-refs:
                            01J0Q4GQ9R8FDWTVQH4E863AZJ: &ref_2
                              x-apifox-overrides:
                                proration: null
                                proration_details: null
                                amount_excluding_tax: null
                                tax_amounts: null
                                discounts: null
                                tax_rates: null
                              type: object
                              properties: {}
                          x-apifox-orders:
                            - 01J0Q4GQ9R8FDWTVQH4E863AZJ
                          properties:
                            id:
                              type: string
                              description: Unique identifier for the object.
                            object:
                              type: string
                              description: '"line_item"'
                            amount:
                              type: integer
                              description: The amount, in pence.
                            currency:
                              type: string
                              description: Three-letter ISO currency code
                            description:
                              type: string
                              description: >-
                                An arbitrary string attached to the object.
                                Often useful for displaying to users.
                            metadata:
                              type: object
                              properties: {}
                              description: >-
                                Set of key-value pairs that you can attach to an
                                object.
                              x-apifox-orders: []
                              x-apifox-ignore-properties: []
                            period:
                              type: object
                              properties:
                                end:
                                  type: string
                                  description: >-
                                    timestamp.The end of the period, which must
                                    be greater than or equal to the start. This
                                    value is inclusive.
                                start:
                                  type: string
                                  description: >-
                                    timestamp. The start of the period. This
                                    value is inclusive.
                              x-apifox-orders:
                                - end
                                - start
                              description: >-
                                The period this line_item covers. For
                                subscription line items, this is the
                                subscription period.
                              x-apifox-ignore-properties: []
                            price:
                              type: object
                              x-apifox-refs:
                                01HC6W63CA87BWB46BAWMWWCQC: *ref_2
                              x-apifox-orders:
                                - 01HC6W63CA87BWB46BAWMWWCQC
                              properties:
                                id:
                                  type: string
                                  description: >-
                                    Unique identifier for the object, like
                                    "price_xxxx".
                                object:
                                  type: string
                                  description: '''price'''
                                active:
                                  type: boolean
                                  description: >-
                                    Whether the price can be used for new
                                    purchases.
                                billing_scheme:
                                  type: string
                                  description: >-
                                    Describes how to compute the price per
                                    period. Either per_unit or tiered
                                  enum:
                                    - per_unit
                                    - tiered
                                  x-apifox-enum:
                                    - value: per_unit
                                      name: ''
                                      description: only per_unit is supported now.
                                    - value: tiered
                                      name: ''
                                      description: ''
                                created:
                                  type: integer
                                  description: >-
                                    Time at which the object was created.
                                    Measured in seconds since the Unix epoch.
                                currency:
                                  type: string
                                  description: >-
                                    Three-letter ISO currency code, in
                                    uppercase. 
                                livemode:
                                  type: boolean
                                  description: >-
                                    Has the value true if the object exists in
                                    live mode or the value false if the object
                                    exists in test mode.
                                lookup_key:
                                  type: string
                                  description: >-
                                    A lookup key used to retrieve prices
                                    dynamically from a static string. This may
                                    be up to 200 characters.
                                metadata:
                                  type: object
                                  properties: {}
                                  x-apifox-orders: []
                                  description: >-
                                    Set of key-value pairs that you can attach
                                    to an object. This can be useful for storing
                                    additional information about the object in a
                                    structured format.
                                  x-apifox-ignore-properties: []
                                nickname:
                                  type: string
                                  description: >-
                                    A brief description of the price, hidden
                                    from customers.
                                product:
                                  type: string
                                  description: >-
                                    The ID of the product this price is
                                    associated with.
                                type:
                                  type: string
                                  description: >-
                                    One of one_time or recurring depending on
                                    whether the price is for a one-time purchase
                                    or a recurring (subscription) purchase.
                                  enum:
                                    - one_time
                                    - recurring
                                  x-apifox-enum:
                                    - value: one_time
                                      name: ''
                                      description: only one-time is supported now.
                                    - value: recurring
                                      name: ''
                                      description: ''
                                unit_amount:
                                  type: integer
                                  description: >-
                                    The unit amount in cents to be charged,
                                    represented as a whole integer if possible.
                                    Only set if billing_scheme=per_unit.
                                recurring:
                                  type: object
                                  properties:
                                    interval:
                                      type: string
                                      description: >-
                                        The frequency at which a subscription is
                                        billed. One of day, week, month or year.
                                      enum:
                                        - day
                                        - week
                                        - month
                                        - year
                                      x-apifox-enum:
                                        - value: day
                                          name: ''
                                          description: ''
                                        - value: week
                                          name: ''
                                          description: ''
                                        - value: month
                                          name: ''
                                          description: ''
                                        - value: year
                                          name: ''
                                          description: ''
                                    interval_count:
                                      type: integer
                                      description: >-
                                        The number of intervals (specified in
                                        the interval attribute) between
                                        subscription billings. For example,
                                        interval=month and interval_count=3
                                        bills every 3 months.
                                    usage_type:
                                      type: string
                                      description: >-
                                        Configures how the quantity per period
                                        should be determined.
                                      enum:
                                        - licensed
                                      x-apifox-enum:
                                        - value: licensed
                                          name: ''
                                          description: ''
                                  x-apifox-orders:
                                    - interval
                                    - interval_count
                                    - usage_type
                                  description: The recurring components of a price
                                  required:
                                    - interval
                                  x-apifox-ignore-properties: []
                                tiers:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      up_to:
                                        type: string
                                        description: >-
                                          Specifies the upper bound of this tier.
                                          The lower bound of a tier is the upper
                                          bound of the previous tier adding one.
                                          Use inf to define a fallback tier.
                                      flat_amount:
                                        type: string
                                        description: >-
                                          The flat billing amount for an entire
                                          tier, regardless of the number of units
                                          in the tier.
                                      unit_amount:
                                        type: string
                                        description: >-
                                          The per unit billing amount for each
                                          individual unit for which this tier
                                          applies.
                                    x-apifox-orders:
                                      - up_to
                                      - flat_amount
                                      - unit_amount
                                    x-apifox-ignore-properties: []
                                  description: （未实现）
                              description: The price of the line item.
                              x-apifox-ignore-properties:
                                - id
                                - object
                                - active
                                - billing_scheme
                                - created
                                - currency
                                - livemode
                                - lookup_key
                                - metadata
                                - nickname
                                - product
                                - type
                                - unit_amount
                                - recurring
                                - tiers
                            unit_amount:
                              type: string
                              description: >-
                                Unit amount (in the currency specified) of the
                                invoice item.
                            quantity:
                              type: integer
                              description: >-
                                The quantity of the subscription, if the line
                                item is a subscription or a proration.
                            invoice_item:
                              type: string
                              description: >-
                                The ID of the invoice item associated with this
                                line item if any.
                            type:
                              type: string
                              description: >-
                                A string identifying the type of the source of
                                this line item, either an invoiceitem or a
                                subscription.
                            livemode:
                              type: boolean
                              description: >-
                                Has the value true if the object exists in live
                                mode or the value false if the object exists in
                                test mode.
                            subscription:
                              type: string
                              description: >-
                                The subscription that the invoice item pertains
                                to, if any.
                            subscription_item:
                              type: string
                              description: >-
                                The subscription item that generated this line
                                item. Left empty if the line item is not an
                                explicit result of a subscription.
                            unit_amount_excluding_tax:
                              type: integer
                              description: >-
                                The amount in pence representing the unit amount
                                for this line item, excluding all tax and
                                discounts.
                            discount_amounts:
                              type: array
                              items:
                                type: object
                                properties:
                                  amount:
                                    type: string
                                    description: The amount, in cents, of the discount.
                                  discount:
                                    type: string
                                    description: >-
                                      The discount that was applied to get this
                                      discount amount.
                                x-apifox-orders:
                                  - amount
                                  - discount
                                required:
                                  - amount
                                  - discount
                                description: >-
                                  The amount of discount calculated per discount
                                  for this line item.
                                x-apifox-ignore-properties: []
                              description: >-
                                The amount of discount calculated per discount
                                for this line item
                            discountable:
                              type: boolean
                              description: >-
                                If true, discounts will apply to this line item.
                                Always false for prorations.
                          x-apifox-ignore-properties:
                            - id
                            - object
                            - amount
                            - currency
                            - description
                            - metadata
                            - period
                            - price
                            - unit_amount
                            - quantity
                            - invoice_item
                            - type
                            - livemode
                            - subscription
                            - subscription_item
                            - unit_amount_excluding_tax
                            - discount_amounts
                            - discountable
                        description: 'contains: line_item object. Details about each object.'
                      has_more:
                        type: boolean
                        description: >-
                          True if this list has another page of items after this
                          one that can be fetched
                      url:
                        type: string
                        description: The URL where this list can be accessed.
                    x-apifox-orders:
                      - object
                      - data
                      - has_more
                      - url
                    description: >-
                      list. 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.
                    x-apifox-ignore-properties: []
                  metadata:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    x-apifox-ignore-properties: []
                  payment_intent:
                    type: string
                    description: >-
                      EXPANDABLE. The PaymentIntent associated with this
                      invoice. The PaymentIntent is generated when the invoice
                      is finalized, and can then be used to pay the invoice.
                      Note that voiding an invoice will cancel the
                      PaymentIntent.
                  period_end:
                    type: string
                    description: >-
                      timestamp. End of the usage period during which invoice
                      items were added to this invoice.
                  period_start:
                    type: string
                    description: >-
                      timestamp. Start of the usage period during which invoice
                      items were added to this invoice.
                  status:
                    type: string
                    description: >-
                      The status of the invoice, one of draft, open, paid,
                      uncollectible, or void
                  subscription:
                    type: string
                    description: >-
                      EXPANDABLE. The subscription that this invoice was
                      prepared for, if any.
                  account_country:
                    type: string
                    description: >-
                      The country of the business associated with this invoice,
                      most often the business creating the invoice.
                  account_name:
                    type: string
                    description: >-
                      The public name of the business associated with this
                      invoice, most often the business creating the invoice.
                  amount_due:
                    type: integer
                    description: ' 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_paid:
                    type: integer
                  amount_precision:
                    type: integer
                    description: >-
                      This field controls the precision of the amount displayed
                      on the invoice. If amount_precision is set to 3, it means
                      the smallest decimal for the amount parameter is 3. This
                      field only affects the display. For actual deductions,
                      please refer to the minimum unit of the supported
                      currency. The default value is the minimum unit of the
                      currency.
                  billing_reason:
                    type: string
                    description: >-
                      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 simulated invoices, per
                      the upcoming invoice endpoint.
                    enum:
                      - manual
                      - subscription
                      - subscription_create
                      - subscription_cycle
                      - subscription_threshold
                      - subscription_update
                      - upcoming
                    x-apifox-enum:
                      - value: manual
                        name: ''
                        description: ''
                      - value: subscription
                        name: ''
                        description: ''
                      - value: subscription_create
                        name: ''
                        description: ''
                      - value: subscription_cycle
                        name: ''
                        description: ''
                      - value: subscription_threshold
                        name: ''
                        description: ''
                      - value: subscription_update
                        name: ''
                        description: ''
                      - value: upcoming
                        name: ''
                        description: ''
                  created:
                    type: integer
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  custom_fields:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: The name of the custom field.
                        value:
                          type: string
                          description: The value of the custom field.
                      x-apifox-orders:
                        - name
                        - value
                      x-apifox-ignore-properties: []
                    description: >-
                      A list of up to 4 custom fields to be displayed on the
                      invoice.
                  customer_address: &ref_25
                    description: >-
                      The customer’s address. Until the invoice is finalized,
                      this field will equal customer.address. Once the invoice
                      is finalized, this field will no longer be updated.
                    $ref: '#/components/schemas/Address'
                  customer_email:
                    type: string
                    description: >-
                      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:
                    type: string
                    description: >-
                      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:
                    type: string
                    description: >-
                      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:
                    type: object
                    properties:
                      address:
                        type: object
                        properties:
                          city:
                            type: string
                            description: City, district, suburb, town, or village.
                          country:
                            type: string
                            description: Two-letter country code (ISO 3166-1 alpha-2 ).
                          line1:
                            type: string
                            description: >-
                              Address line 1 (e.g., street, PO Box, or company
                              name).
                          line2:
                            type: string
                            description: >-
                              Address line 2 (e.g., apartment, suite, unit, or
                              building).
                          postal_code:
                            type: string
                            description: ZIP or postal code.
                          state:
                            type: string
                            description: State, county, province, or region.
                        x-apifox-orders:
                          - 01HC4TE8XKX4DW5GYCRP7K02PJ
                        x-apifox-refs:
                          01HC4TE8XKX4DW5GYCRP7K02PJ: *ref_2
                        x-apifox-ignore-properties:
                          - city
                          - country
                          - line1
                          - line2
                          - postal_code
                          - state
                      name:
                        type: string
                      phone:
                        type: string
                    x-apifox-orders:
                      - address
                      - name
                      - phone
                    x-apifox-refs: {}
                    x-apifox-ignore-properties: []
                  default_payment_method:
                    type: string
                    description: >-
                      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
                  due_date:
                    type: string
                    description: >-
                      timestamp.The date on which payment for this invoice is
                      due. This value will be null for invoices where
                      collection_method=charge_automatically.
                  effective_at:
                    type: string
                    description: >-
                      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.
                  footer:
                    type: string
                    description: Footer displayed on the invoice.
                  from_invoice:
                    type: object
                    properties:
                      action:
                        type: string
                        description: >-
                          The relation between the new invoice and the original
                          invoice. Currently, only ‘revision’ is permitted
                      invoice:
                        type: string
                        description: The id of the invoice that will be cloned.
                    x-apifox-orders:
                      - action
                      - invoice
                    required:
                      - action
                      - invoice
                    x-apifox-ignore-properties: []
                  invoice_pdf:
                    type: string
                  last_finalization_error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      param:
                        type: string
                        description: >-
                          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_method_type:
                        type: string
                        description: >-
                          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.
                    description: >-
                      The error encountered during the previous attempt to
                      finalize the invoice. This field is cleared when the
                      invoice is successfully finalized.
                    x-apifox-orders:
                      - type
                      - code
                      - message
                      - param
                      - payment_method_type
                    x-apifox-ignore-properties: []
                  latest_revision:
                    type: string
                    description: >-
                      The ID of the most recent non-draft revision of this
                      invoice
                  livemode:
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  next_payment_attempt:
                    type: string
                    description: >-
                      The time at which payment will next be attempted. This
                      value will be null for invoices where
                      collection_method=send_invoice.
                  number:
                    type: string
                    description: >-
                      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.
                  paid:
                    type: boolean
                    description: >-
                      Whether payment was successfully collected for this
                      invoice.
                  paid_out_of_band:
                    type: boolean
                    description: >-
                      Returns true if the invoice was manually marked paid,
                      returns false if the invoice hasn’t been paid yet or was
                      paid on Wooshpay.
                  payment_settings:
                    type: object
                    properties:
                      default_mandate:
                        type: string
                        description: >-
                          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:
                        type: object
                        properties:
                          card:
                            type: object
                            properties:
                              request_three_d_secure:
                                type: string
                                description: '`automatic` or `any`'
                            x-apifox-orders:
                              - request_three_d_secure
                            x-apifox-ignore-properties: []
                        x-apifox-orders:
                          - card
                        description: >-
                          Payment-method-specific configuration to provide to
                          the invoice’s PaymentIntent.
                        x-apifox-ignore-properties: []
                      payment_method_types:
                        type: string
                        description: >-
                          The list of payment method types (e.g. card) to
                          provide to the invoice’s PaymentIntent.
                    x-apifox-orders:
                      - default_mandate
                      - payment_method_options
                      - payment_method_types
                    x-apifox-ignore-properties: []
                  receipt_number:
                    type: string
                    description: >-
                      This is the transaction number that appears on email
                      receipts sent for this invoice.
                  starting_balance:
                    type: string
                    description: >-
                      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:
                    type: string
                    description: >-
                      Extra information about an invoice for the customer’s
                      credit card statement.
                  status_transitions:
                    type: object
                    properties:
                      finalized_at:
                        type: string
                        description: timestamp
                      marked_uncollectible_at:
                        type: string
                        description: timestamp
                      paid_at:
                        type: string
                        description: timestamp
                      voided_at:
                        type: string
                        description: timestamp
                    x-apifox-orders:
                      - finalized_at
                      - marked_uncollectible_at
                      - paid_at
                      - voided_at
                    description: The timestamps at which the invoice status was updated
                    x-apifox-ignore-properties: []
                  subscription_details:
                    type: object
                    properties:
                      metadata:
                        type: object
                        properties: {}
                        x-apifox-orders: []
                        x-apifox-ignore-properties: []
                    description: Details about the subscription that created this invoice.
                    x-apifox-orders:
                      - metadata
                    x-apifox-ignore-properties: []
                  test_clock:
                    type: string
                    description: ID of the test clock this invoice belongs to.
                  threshold_reason:
                    type: object
                    properties:
                      amount_gte:
                        type: string
                      item_reasons:
                        type: array
                        items:
                          type: object
                          properties:
                            line_item_ids:
                              type: string
                            usage_gte:
                              type: string
                          x-apifox-orders:
                            - line_item_ids
                            - usage_gte
                          x-apifox-ignore-properties: []
                    x-apifox-orders:
                      - amount_gte
                      - item_reasons
                    description: ' If billing_reason is set to subscription_threshold this returns more information on which threshold rules triggered the invoice.'
                    x-apifox-ignore-properties: []
                  total:
                    type: integer
                    description: Total after discounts and taxes.
                  rounding_rule:
                    type: string
                    enum:
                      - round_up
                      - round_down
                    description: >-
                      If amount_precision is defined, this field is used to
                      control rounding of the amount to the smallest unit
                      supported by the currency.
                    x-apifox-enum:
                      - value: round_up
                        name: ''
                        description: Default
                      - value: round_down
                        name: ''
                        description: ''
                x-apifox-ignore-properties:
                  - id
                  - currency
                  - customer
                  - object
                  - auto_advance
                  - charge
                  - collection_method
                  - description
                  - hosted_invoice_url
                  - lines
                  - metadata
                  - payment_intent
                  - period_end
                  - period_start
                  - status
                  - subscription
                  - account_country
                  - account_name
                  - amount_due
                  - amount_paid
                  - amount_precision
                  - billing_reason
                  - created
                  - custom_fields
                  - customer_address
                  - customer_email
                  - customer_name
                  - customer_phone
                  - customer_shipping
                  - default_payment_method
                  - due_date
                  - effective_at
                  - footer
                  - from_invoice
                  - invoice_pdf
                  - last_finalization_error
                  - latest_revision
                  - livemode
                  - next_payment_attempt
                  - number
                  - paid
                  - paid_out_of_band
                  - payment_settings
                  - receipt_number
                  - starting_balance
                  - statement_descriptor
                  - status_transitions
                  - subscription_details
                  - test_clock
                  - threshold_reason
                  - total
                  - rounding_rule
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Invoices
      x-apifox-status: developing
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-114672803-run
components:
  schemas:
    Invoice item:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        object:
          type: string
          description: '"invoiceitem"'
        amount:
          type: integer
          description: >-
            Amount (in the currency specified) of the invoice item. This should
            always be equal to unit_amount * quantity.
        currency:
          type: string
          description: Three-letter ISO currency code
        customer:
          type: string
          description: >-
            The ID of the customer who will be billed when this invoice item is
            billed.
        description:
          type: string
          description: >-
            An arbitrary string attached to the object. Often useful for
            displaying to users.
        metadata:
          type: object
          properties: {}
          description: Set of key-value pairs that you can attach to an object.
          x-apifox-orders: []
          x-apifox-ignore-properties: []
        period:
          type: object
          properties:
            end:
              type: string
              description: >-
                timestamp.The end of the period, which must be greater than or
                equal to the start. This value is inclusive.
            start:
              type: string
              description: timestamp. The start of the period. This value is inclusive.
          x-apifox-orders:
            - end
            - start
          description: >-
            The period associated with this invoice item. When set to different
            values, the period will be rendered on the invoice.
          x-apifox-ignore-properties: []
        price:
          type: object
          x-apifox-refs:
            01HC6W63CA87BWB46BAWMWWCQC: &ref_24
              $ref: '#/components/schemas/Price'
              x-apifox-overrides:
                transform_quantity: null
                tiers_mode: null
                tax_behavior: null
                custom_unit_amount: null
                unit_amount_decimal: null
          x-apifox-orders:
            - 01HC6W63CA87BWB46BAWMWWCQC
          properties:
            id: &ref_3
              type: string
              description: Unique identifier for the object, like "price_xxxx".
            object: &ref_4
              type: string
              description: '''price'''
            active: &ref_5
              type: boolean
              description: Whether the price can be used for new purchases.
            billing_scheme:
              type: string
              description: >-
                Describes how to compute the price per period. Either per_unit
                or tiered
              enum: &ref_6
                - per_unit
                - tiered
              x-apifox-enum:
                - value: per_unit
                  name: ''
                  description: only per_unit is supported now.
                - value: tiered
                  name: ''
                  description: ''
            created: &ref_7
              type: integer
              description: >-
                Time at which the object was created. Measured in seconds since
                the Unix epoch.
            currency: &ref_8
              type: string
              description: 'Three-letter ISO currency code, in uppercase. '
            livemode: &ref_9
              type: boolean
              description: >-
                Has the value true if the object exists in live mode or the
                value false if the object exists in test mode.
            lookup_key: &ref_10
              type: string
              description: >-
                A lookup key used to retrieve prices dynamically from a static
                string. This may be up to 200 characters.
            metadata:
              type: object
              properties: {}
              x-apifox-orders: &ref_11 []
              description: >-
                Set of key-value pairs that you can attach to an object. This
                can be useful for storing additional information about the
                object in a structured format.
              x-apifox-ignore-properties: []
            nickname: &ref_12
              type: string
              description: A brief description of the price, hidden from customers.
            product: &ref_13
              type: string
              description: The ID of the product this price is associated with.
            type:
              type: string
              description: >-
                One of one_time or recurring depending on whether the price is
                for a one-time purchase or a recurring (subscription) purchase.
              enum: &ref_14
                - one_time
                - recurring
              x-apifox-enum:
                - value: one_time
                  name: ''
                  description: only one-time is supported now.
                - value: recurring
                  name: ''
                  description: ''
            unit_amount: &ref_15
              type: integer
              description: >-
                The unit amount in cents to be charged, represented as a whole
                integer if possible. Only set if billing_scheme=per_unit.
            recurring:
              type: object
              properties:
                interval:
                  type: string
                  description: >-
                    The frequency at which a subscription is billed. One of day,
                    week, month or year.
                  enum: &ref_16
                    - day
                    - week
                    - month
                    - year
                  x-apifox-enum:
                    - value: day
                      name: ''
                      description: ''
                    - value: week
                      name: ''
                      description: ''
                    - value: month
                      name: ''
                      description: ''
                    - value: year
                      name: ''
                      description: ''
                interval_count: &ref_17
                  type: integer
                  description: >-
                    The number of intervals (specified in the interval
                    attribute) between subscription billings. For example,
                    interval=month and interval_count=3 bills every 3 months.
                usage_type:
                  type: string
                  description: Configures how the quantity per period should be determined.
                  enum: &ref_18
                    - licensed
                  x-apifox-enum:
                    - value: licensed
                      name: ''
                      description: ''
              x-apifox-orders: &ref_19
                - interval
                - interval_count
                - usage_type
              description: The recurring components of a price
              required:
                - interval
              x-apifox-ignore-properties: []
            tiers:
              type: array
              items:
                type: object
                properties:
                  up_to: &ref_20
                    type: string
                    description: >-
                      Specifies the upper bound of this tier. The lower bound of
                      a tier is the upper bound of the previous tier adding one.
                      Use inf to define a fallback tier.
                  flat_amount: &ref_21
                    type: string
                    description: >-
                      The flat billing amount for an entire tier, regardless of
                      the number of units in the tier.
                  unit_amount: &ref_22
                    type: string
                    description: >-
                      The per unit billing amount for each individual unit for
                      which this tier applies.
                x-apifox-orders: &ref_23
                  - up_to
                  - flat_amount
                  - unit_amount
                x-apifox-ignore-properties: []
              description: （未实现）
          description: The ID of the price object.
          x-apifox-ignore-properties:
            - id
            - object
            - active
            - billing_scheme
            - created
            - currency
            - livemode
            - lookup_key
            - metadata
            - nickname
            - product
            - type
            - unit_amount
            - recurring
            - tiers
        date:
          type: string
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        invoice:
          type: string
          description: >-
            The ID of an existing invoice to add this invoice item to. When left
            blank, the invoice item will be added to the next upcoming scheduled
            invoice. This is useful when adding invoice items in response to an
            invoice.created webhook. You can only add invoice items to draft
            invoices and there is a maximum of 250 items per invoice.
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        quantity:
          type: integer
          description: >-
            The quantity of the subscription, if the line item is a subscription
            or a proration.
        subscription:
          type: string
          description: >-
            The ID of a subscription to add this invoice item to. When left
            blank, the invoice item will be be added to the next upcoming
            scheduled invoice. When set, scheduled invoices for subscriptions
            other than the specified subscription will ignore the invoice item.
            Use this when you want to express that an invoice item has been
            accrued within the context of a particular subscription.
        unit_amount:
          type: integer
          description: >-
            The integer unit amount in pence of the charge to be applied to the
            upcoming invoice. This unit_amount will be multiplied by the
            quantity to get the full amount. Passing in a negative unit_amount
            will reduce the amount_due on the invoice.
        test_clock:
          type: string
          description: ID of the test clock this invoice item belongs to.
        proration:
          type: boolean
          deprecated: true
          description: >-
            Whether the invoice item was created automatically as a proration
            adjustment when the customer switched plans.
        tax_rates:
          type: string
          description: 未完成
          deprecated: true
        discountable:
          type: string
          description: 未完成
          deprecated: true
        discounts:
          type: string
          description: 未完成
          deprecated: true
        unit_amount_decimal:
          type: string
          description: 未完成
          deprecated: true
      x-apifox-refs: {}
      x-apifox-orders:
        - id
        - object
        - amount
        - currency
        - customer
        - description
        - metadata
        - period
        - price
        - date
        - invoice
        - livemode
        - quantity
        - subscription
        - unit_amount
        - test_clock
        - proration
        - tax_rates
        - discountable
        - discounts
        - unit_amount_decimal
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Price:
      type: object
      properties:
        id: *ref_3
        object: *ref_4
        active: *ref_5
        billing_scheme:
          type: string
          description: >-
            Describes how to compute the price per period. Either per_unit or
            tiered
          enum: *ref_6
          x-apifox-enum:
            - value: per_unit
              name: ''
              description: only per_unit is supported now.
            - value: tiered
              name: ''
              description: ''
        created: *ref_7
        currency: *ref_8
        livemode: *ref_9
        lookup_key: *ref_10
        metadata:
          type: object
          properties: {}
          x-apifox-orders: *ref_11
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        nickname: *ref_12
        product: *ref_13
        type:
          type: string
          description: >-
            One of one_time or recurring depending on whether the price is for a
            one-time purchase or a recurring (subscription) purchase.
          enum: *ref_14
          x-apifox-enum:
            - value: one_time
              name: ''
              description: only one-time is supported now.
            - value: recurring
              name: ''
              description: ''
        unit_amount: *ref_15
        custom_unit_amount:
          type: 'null'
          description: （未实现）
        recurring:
          type: object
          properties:
            interval:
              type: string
              description: >-
                The frequency at which a subscription is billed. One of day,
                week, month or year.
              enum: *ref_16
              x-apifox-enum:
                - value: day
                  name: ''
                  description: ''
                - value: week
                  name: ''
                  description: ''
                - value: month
                  name: ''
                  description: ''
                - value: year
                  name: ''
                  description: ''
            interval_count: *ref_17
            usage_type:
              type: string
              description: Configures how the quantity per period should be determined.
              enum: *ref_18
              x-apifox-enum:
                - value: licensed
                  name: ''
                  description: ''
          x-apifox-orders: *ref_19
          description: The recurring components of a price
          required:
            - interval
          x-apifox-ignore-properties: []
        tax_behavior:
          type: string
          description: （未实现）
        tiers_mode:
          type: 'null'
          description: （未实现）
        tiers:
          type: array
          items:
            type: object
            properties:
              up_to: *ref_20
              flat_amount: *ref_21
              unit_amount: *ref_22
            x-apifox-orders: *ref_23
            x-apifox-ignore-properties: []
          description: （未实现）
        transform_quantity:
          type: 'null'
          description: （未实现）
        unit_amount_decimal:
          type: string
          description: （未实现）
      x-apifox-orders:
        - id
        - object
        - active
        - billing_scheme
        - created
        - currency
        - livemode
        - lookup_key
        - metadata
        - nickname
        - product
        - type
        - unit_amount
        - custom_unit_amount
        - recurring
        - tax_behavior
        - tiers_mode
        - tiers
        - transform_quantity
        - unit_amount_decimal
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Invoice:
      type: object
      properties:
        id:
          type: string
        currency:
          type: string
          description: Three-letter ISO currency code
        customer:
          type: string
          description: The ID of the customer who will be billed.
        object:
          type: string
          description: >-
            String representing the object’s type. Objects of the same type
            share the same value.
        auto_advance:
          type: boolean
          description: ' If false, the invoice’s state doesn’t automatically advance without an explicit actio'
        charge:
          type: string
          description: ID of the latest charge generated for this invoice, if any.
        collection_method:
          type: string
          description: Either charge_automatically, or send_invoice
        description:
          type: string
          description: >-
            An arbitrary string attached to the object. Often useful for
            displaying to users.
        hosted_invoice_url:
          type: string
          description: >-
            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.
        lines:
          type: object
          properties:
            object:
              type: string
              description: value is "list"
            data:
              type: array
              items:
                type: object
                x-apifox-refs:
                  01J0Q4GQ9R8FDWTVQH4E863AZJ:
                    $ref: '#/components/schemas/Line%20Item(Invoice)'
                    x-apifox-overrides:
                      proration: null
                      proration_details: null
                      amount_excluding_tax: null
                      tax_amounts: null
                      discounts: null
                      tax_rates: null
                x-apifox-orders:
                  - 01J0Q4GQ9R8FDWTVQH4E863AZJ
                properties:
                  id: &ref_32
                    type: string
                    description: Unique identifier for the object.
                  object: &ref_33
                    type: string
                    description: '"line_item"'
                  amount: &ref_34
                    type: integer
                    description: The amount, in pence.
                  currency: &ref_35
                    type: string
                    description: Three-letter ISO currency code
                  description: &ref_36
                    type: string
                    description: >-
                      An arbitrary string attached to the object. Often useful
                      for displaying to users.
                  metadata:
                    type: object
                    properties: {}
                    description: Set of key-value pairs that you can attach to an object.
                    x-apifox-orders: &ref_37 []
                    x-apifox-ignore-properties: []
                  period:
                    type: object
                    properties:
                      end: &ref_38
                        type: string
                        description: >-
                          timestamp.The end of the period, which must be greater
                          than or equal to the start. This value is inclusive.
                      start: &ref_39
                        type: string
                        description: >-
                          timestamp. The start of the period. This value is
                          inclusive.
                    x-apifox-orders: &ref_40
                      - end
                      - start
                    description: >-
                      The period this line_item covers. For subscription line
                      items, this is the subscription period.
                    x-apifox-ignore-properties: []
                  price:
                    type: object
                    x-apifox-refs: &ref_41
                      01HC6W63CA87BWB46BAWMWWCQC: *ref_24
                    x-apifox-orders: &ref_42
                      - 01HC6W63CA87BWB46BAWMWWCQC
                    properties:
                      id: *ref_3
                      object: *ref_4
                      active: *ref_5
                      billing_scheme:
                        type: string
                        description: >-
                          Describes how to compute the price per period. Either
                          per_unit or tiered
                        enum: *ref_6
                        x-apifox-enum:
                          - value: per_unit
                            name: ''
                            description: only per_unit is supported now.
                          - value: tiered
                            name: ''
                            description: ''
                      created: *ref_7
                      currency: *ref_8
                      livemode: *ref_9
                      lookup_key: *ref_10
                      metadata:
                        type: object
                        properties: {}
                        x-apifox-orders: *ref_11
                        description: >-
                          Set of key-value pairs that you can attach to an
                          object. This can be useful for storing additional
                          information about the object in a structured format.
                        x-apifox-ignore-properties: []
                      nickname: *ref_12
                      product: *ref_13
                      type:
                        type: string
                        description: >-
                          One of one_time or recurring depending on whether the
                          price is for a one-time purchase or a recurring
                          (subscription) purchase.
                        enum: *ref_14
                        x-apifox-enum:
                          - value: one_time
                            name: ''
                            description: only one-time is supported now.
                          - value: recurring
                            name: ''
                            description: ''
                      unit_amount: *ref_15
                      recurring:
                        type: object
                        properties:
                          interval:
                            type: string
                            description: >-
                              The frequency at which a subscription is billed.
                              One of day, week, month or year.
                            enum: *ref_16
                            x-apifox-enum:
                              - value: day
                                name: ''
                                description: ''
                              - value: week
                                name: ''
                                description: ''
                              - value: month
                                name: ''
                                description: ''
                              - value: year
                                name: ''
                                description: ''
                          interval_count: *ref_17
                          usage_type:
                            type: string
                            description: >-
                              Configures how the quantity per period should be
                              determined.
                            enum: *ref_18
                            x-apifox-enum:
                              - value: licensed
                                name: ''
                                description: ''
                        x-apifox-orders: *ref_19
                        description: The recurring components of a price
                        required:
                          - interval
                        x-apifox-ignore-properties: []
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            up_to: *ref_20
                            flat_amount: *ref_21
                            unit_amount: *ref_22
                          x-apifox-orders: *ref_23
                          x-apifox-ignore-properties: []
                        description: （未实现）
                    description: The price of the line item.
                    x-apifox-ignore-properties:
                      - id
                      - object
                      - active
                      - billing_scheme
                      - created
                      - currency
                      - livemode
                      - lookup_key
                      - metadata
                      - nickname
                      - product
                      - type
                      - unit_amount
                      - recurring
                      - tiers
                  unit_amount: &ref_43
                    type: string
                    description: >-
                      Unit amount (in the currency specified) of the invoice
                      item.
                  quantity: &ref_44
                    type: integer
                    description: >-
                      The quantity of the subscription, if the line item is a
                      subscription or a proration.
                  invoice_item: &ref_45
                    type: string
                    description: >-
                      The ID of the invoice item associated with this line item
                      if any.
                  type: &ref_46
                    type: string
                    description: >-
                      A string identifying the type of the source of this line
                      item, either an invoiceitem or a subscription.
                  livemode: &ref_47
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  subscription: &ref_48
                    type: string
                    description: >-
                      The subscription that the invoice item pertains to, if
                      any.
                  subscription_item: &ref_49
                    type: string
                    description: >-
                      The subscription item that generated this line item. Left
                      empty if the line item is not an explicit result of a
                      subscription.
                  unit_amount_excluding_tax: &ref_50
                    type: integer
                    description: >-
                      The amount in pence representing the unit amount for this
                      line item, excluding all tax and discounts.
                  discount_amounts:
                    type: array
                    items:
                      type: object
                      properties:
                        amount: &ref_51
                          type: string
                          description: The amount, in cents, of the discount.
                        discount: &ref_52
                          type: string
                          description: >-
                            The discount that was applied to get this discount
                            amount.
                      x-apifox-orders: &ref_53
                        - amount
                        - discount
                      required:
                        - amount
                        - discount
                      description: >-
                        The amount of discount calculated per discount for this
                        line item.
                      x-apifox-ignore-properties: []
                    description: >-
                      The amount of discount calculated per discount for this
                      line item
                  discountable: &ref_54
                    type: boolean
                    description: >-
                      If true, discounts will apply to this line item. Always
                      false for prorations.
                x-apifox-ignore-properties:
                  - id
                  - object
                  - amount
                  - currency
                  - description
                  - metadata
                  - period
                  - price
                  - unit_amount
                  - quantity
                  - invoice_item
                  - type
                  - livemode
                  - subscription
                  - subscription_item
                  - unit_amount_excluding_tax
                  - discount_amounts
                  - discountable
              description: 'contains: line_item object. Details about each object.'
            has_more:
              type: boolean
              description: >-
                True if this list has another page of items after this one that
                can be fetched
            url:
              type: string
              description: The URL where this list can be accessed.
          x-apifox-orders:
            - object
            - data
            - has_more
            - url
          description: >-
            list. 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.
          x-apifox-ignore-properties: []
        metadata:
          type: object
          properties: {}
          x-apifox-orders: []
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        payment_intent:
          type: string
          description: >-
            EXPANDABLE. The PaymentIntent associated with this invoice. The
            PaymentIntent is generated when the invoice is finalized, and can
            then be used to pay the invoice. Note that voiding an invoice will
            cancel the PaymentIntent.
        period_end:
          type: string
          description: >-
            timestamp. End of the usage period during which invoice items were
            added to this invoice.
        period_start:
          type: string
          description: >-
            timestamp. Start of the usage period during which invoice items were
            added to this invoice.
        status:
          type: string
          description: >-
            The status of the invoice, one of draft, open, paid, uncollectible,
            or void
        subscription:
          type: string
          description: >-
            EXPANDABLE. The subscription that this invoice was prepared for, if
            any.
        account_country:
          type: string
          description: >-
            The country of the business associated with this invoice, most often
            the business creating the invoice.
        account_name:
          type: string
          description: >-
            The public name of the business associated with this invoice, most
            often the business creating the invoice.
        amount_due:
          type: integer
          description: ' 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_paid:
          type: integer
        amount_precision:
          type: integer
          description: >-
            This field controls the precision of the amount displayed on the
            invoice. If amount_precision is set to 3, it means the smallest
            decimal for the amount parameter is 3. This field only affects the
            display. For actual deductions, please refer to the minimum unit of
            the supported currency. The default value is the minimum unit of the
            currency.
        billing_reason:
          type: string
          description: >-
            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 simulated invoices, per the upcoming invoice endpoint.
          enum:
            - manual
            - subscription
            - subscription_create
            - subscription_cycle
            - subscription_threshold
            - subscription_update
            - upcoming
          x-apifox-enum:
            - value: manual
              name: ''
              description: ''
            - value: subscription
              name: ''
              description: ''
            - value: subscription_create
              name: ''
              description: ''
            - value: subscription_cycle
              name: ''
              description: ''
            - value: subscription_threshold
              name: ''
              description: ''
            - value: subscription_update
              name: ''
              description: ''
            - value: upcoming
              name: ''
              description: ''
        created:
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        custom_fields:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: The name of the custom field.
              value:
                type: string
                description: The value of the custom field.
            x-apifox-orders:
              - name
              - value
            x-apifox-ignore-properties: []
          description: A list of up to 4 custom fields to be displayed on the invoice.
        customer_address: *ref_25
        customer_email:
          type: string
          description: >-
            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:
          type: string
          description: >-
            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:
          type: string
          description: >-
            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:
          type: object
          properties:
            address:
              type: object
              properties:
                city: &ref_26
                  type: string
                  description: City, district, suburb, town, or village.
                country: &ref_27
                  type: string
                  description: Two-letter country code (ISO 3166-1 alpha-2 ).
                line1: &ref_28
                  type: string
                  description: Address line 1 (e.g., street, PO Box, or company name).
                line2: &ref_29
                  type: string
                  description: Address line 2 (e.g., apartment, suite, unit, or building).
                postal_code: &ref_30
                  type: string
                  description: ZIP or postal code.
                state: &ref_31
                  type: string
                  description: State, county, province, or region.
              x-apifox-orders:
                - 01HC4TE8XKX4DW5GYCRP7K02PJ
              x-apifox-refs:
                01HC4TE8XKX4DW5GYCRP7K02PJ: *ref_25
              x-apifox-ignore-properties:
                - city
                - country
                - line1
                - line2
                - postal_code
                - state
            name:
              type: string
            phone:
              type: string
          x-apifox-orders:
            - address
            - name
            - phone
          x-apifox-refs: {}
          x-apifox-ignore-properties: []
        default_payment_method:
          type: string
          description: >-
            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
        due_date:
          type: string
          description: >-
            timestamp.The date on which payment for this invoice is due. This
            value will be null for invoices where
            collection_method=charge_automatically.
        effective_at:
          type: string
          description: >-
            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.
        footer:
          type: string
          description: Footer displayed on the invoice.
        from_invoice:
          type: object
          properties:
            action:
              type: string
              description: >-
                The relation between the new invoice and the original invoice.
                Currently, only ‘revision’ is permitted
            invoice:
              type: string
              description: The id of the invoice that will be cloned.
          x-apifox-orders:
            - action
            - invoice
          required:
            - action
            - invoice
          x-apifox-ignore-properties: []
        invoice_pdf:
          type: string
        last_finalization_error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            param:
              type: string
              description: >-
                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_method_type:
              type: string
              description: >-
                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.
          description: >-
            The error encountered during the previous attempt to finalize the
            invoice. This field is cleared when the invoice is successfully
            finalized.
          x-apifox-orders:
            - type
            - code
            - message
            - param
            - payment_method_type
          x-apifox-ignore-properties: []
        latest_revision:
          type: string
          description: The ID of the most recent non-draft revision of this invoice
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        next_payment_attempt:
          type: string
          description: >-
            The time at which payment will next be attempted. This value will be
            null for invoices where collection_method=send_invoice.
        number:
          type: string
          description: >-
            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.
        paid:
          type: boolean
          description: Whether payment was successfully collected for this invoice.
        paid_out_of_band:
          type: boolean
          description: >-
            Returns true if the invoice was manually marked paid, returns false
            if the invoice hasn’t been paid yet or was paid on Wooshpay.
        payment_settings:
          type: object
          properties:
            default_mandate:
              type: string
              description: >-
                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:
              type: object
              properties:
                card:
                  type: object
                  properties:
                    request_three_d_secure:
                      type: string
                      description: '`automatic` or `any`'
                  x-apifox-orders:
                    - request_three_d_secure
                  x-apifox-ignore-properties: []
              x-apifox-orders:
                - card
              description: >-
                Payment-method-specific configuration to provide to the
                invoice’s PaymentIntent.
              x-apifox-ignore-properties: []
            payment_method_types:
              type: string
              description: >-
                The list of payment method types (e.g. card) to provide to the
                invoice’s PaymentIntent.
          x-apifox-orders:
            - default_mandate
            - payment_method_options
            - payment_method_types
          x-apifox-ignore-properties: []
        receipt_number:
          type: string
          description: >-
            This is the transaction number that appears on email receipts sent
            for this invoice.
        starting_balance:
          type: string
          description: >-
            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:
          type: string
          description: >-
            Extra information about an invoice for the customer’s credit card
            statement.
        status_transitions:
          type: object
          properties:
            finalized_at:
              type: string
              description: timestamp
            marked_uncollectible_at:
              type: string
              description: timestamp
            paid_at:
              type: string
              description: timestamp
            voided_at:
              type: string
              description: timestamp
          x-apifox-orders:
            - finalized_at
            - marked_uncollectible_at
            - paid_at
            - voided_at
          description: The timestamps at which the invoice status was updated
          x-apifox-ignore-properties: []
        subscription_details:
          type: object
          properties:
            metadata:
              type: object
              properties: {}
              x-apifox-orders: []
              x-apifox-ignore-properties: []
          description: Details about the subscription that created this invoice.
          x-apifox-orders:
            - metadata
          x-apifox-ignore-properties: []
        test_clock:
          type: string
          description: ID of the test clock this invoice belongs to.
        threshold_reason:
          type: object
          properties:
            amount_gte:
              type: string
            item_reasons:
              type: array
              items:
                type: object
                properties:
                  line_item_ids:
                    type: string
                  usage_gte:
                    type: string
                x-apifox-orders:
                  - line_item_ids
                  - usage_gte
                x-apifox-ignore-properties: []
          x-apifox-orders:
            - amount_gte
            - item_reasons
          description: ' If billing_reason is set to subscription_threshold this returns more information on which threshold rules triggered the invoice.'
          x-apifox-ignore-properties: []
        discount:
          type: string
          description: >-
            Describes the current discount applied to this invoice, if there is
            one. Not populated if there are multiple discounts.
        discounts:
          type: string
          description: >-
            The discounts applied to the invoice. Line item discounts are
            applied before invoice discounts. Use expand[]=discounts to expand
            each discount.
        total:
          type: integer
          description: Total after discounts and taxes.
        total_discount_amounts:
          type: array
          items:
            type: object
            properties:
              amount:
                type: string
              discount:
                type: string
            x-apifox-orders:
              - amount
              - discount
            x-apifox-ignore-properties: []
        subtotal:
          type: integer
          description: >-
            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
        rounding_rule:
          type: string
          enum:
            - round_up
            - round_down
          description: >-
            If amount_precision is defined, this field is used to control
            rounding of the amount to the smallest unit supported by the
            currency.
          x-apifox-enum:
            - value: round_up
              name: ''
              description: Default
            - value: round_down
              name: ''
              description: ''
        attempted:
          type: boolean
          description: >-
            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.
          deprecated: true
        amount_shipping:
          type: string
          deprecated: true
        automatic_tax:
          type: string
          deprecated: true
        attempt_count:
          type: integer
          description: >-
            positive integer or zero. 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.
          deprecated: true
        account_tax_ids:
          type: string
          deprecated: true
        customer_tax_exempt:
          type: string
          deprecated: true
        customer_tax_ids:
          type: string
          deprecated: true
        default_source:
          type: string
          description: >-
            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.
          deprecated: true
        default_tax_rates:
          type: string
          deprecated: true
        ending_balance:
          type: integer
          description: >-
            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.
          deprecated: true
        rendering:
          type: object
          properties:
            amount_tax_display:
              type: string
            pdf:
              type: string
          description: >-
            The rendering-related settings that control how the invoice is
            displayed on customer-facing surfaces such as PDF and Hosted Invoice
            Page
          x-apifox-orders:
            - amount_tax_display
            - pdf
          deprecated: true
          x-apifox-ignore-properties: []
        quote:
          type: string
          description: The quote this invoice was generated from.
          deprecated: true
        amount_remaining:
          type: string
          deprecated: true
        pre_payment_credit_notes_amount:
          type: string
          deprecated: true
        shipping_details:
          type: string
          deprecated: true
        total_excluding_tax:
          type: string
          deprecated: true
        shipping_cost:
          type: string
          deprecated: true
        total_tax_amounts:
          type: string
          deprecated: true
        transfer_data:
          type: string
          deprecated: true
        webhooks_delivered_at:
          type: string
          deprecated: true
        post_payment_credit_notes_amount:
          type: integer
          deprecated: true
        tax:
          type: integer
          deprecated: true
        subtotal_excluding_tax:
          type: integer
          deprecated: true
        subscription_proration_date:
          type: integer
          description: >-
            Only set for upcoming invoices that preview prorations. The time
            used to calculate prorations.
          deprecated: true
      x-apifox-orders:
        - id
        - currency
        - customer
        - object
        - auto_advance
        - charge
        - collection_method
        - description
        - hosted_invoice_url
        - lines
        - metadata
        - payment_intent
        - period_end
        - period_start
        - status
        - subscription
        - account_country
        - account_name
        - amount_due
        - amount_paid
        - amount_precision
        - billing_reason
        - created
        - custom_fields
        - customer_address
        - customer_email
        - customer_name
        - customer_phone
        - customer_shipping
        - default_payment_method
        - due_date
        - effective_at
        - footer
        - from_invoice
        - invoice_pdf
        - last_finalization_error
        - latest_revision
        - livemode
        - next_payment_attempt
        - number
        - paid
        - paid_out_of_band
        - payment_settings
        - receipt_number
        - starting_balance
        - statement_descriptor
        - status_transitions
        - subscription_details
        - test_clock
        - threshold_reason
        - discount
        - discounts
        - total
        - total_discount_amounts
        - subtotal
        - rounding_rule
        - attempted
        - amount_shipping
        - automatic_tax
        - attempt_count
        - account_tax_ids
        - customer_tax_exempt
        - customer_tax_ids
        - default_source
        - default_tax_rates
        - ending_balance
        - rendering
        - quote
        - amount_remaining
        - pre_payment_credit_notes_amount
        - shipping_details
        - total_excluding_tax
        - shipping_cost
        - total_tax_amounts
        - transfer_data
        - webhooks_delivered_at
        - post_payment_credit_notes_amount
        - tax
        - subtotal_excluding_tax
        - subscription_proration_date
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Address:
      type: object
      properties:
        city: *ref_26
        country: *ref_27
        line1: *ref_28
        line2: *ref_29
        postal_code: *ref_30
        state: *ref_31
      x-apifox-orders:
        - city
        - country
        - line1
        - line2
        - postal_code
        - state
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Line Item(Invoice):
      type: object
      properties:
        id: *ref_32
        object: *ref_33
        amount: *ref_34
        currency: *ref_35
        description: *ref_36
        metadata:
          type: object
          properties: {}
          description: Set of key-value pairs that you can attach to an object.
          x-apifox-orders: *ref_37
          x-apifox-ignore-properties: []
        period:
          type: object
          properties:
            end: *ref_38
            start: *ref_39
          x-apifox-orders: *ref_40
          description: >-
            The period this line_item covers. For subscription line items, this
            is the subscription period.
          x-apifox-ignore-properties: []
        price:
          type: object
          x-apifox-refs: *ref_41
          x-apifox-orders: *ref_42
          properties:
            id: *ref_3
            object: *ref_4
            active: *ref_5
            billing_scheme:
              type: string
              description: >-
                Describes how to compute the price per period. Either per_unit
                or tiered
              enum: *ref_6
              x-apifox-enum:
                - value: per_unit
                  name: ''
                  description: only per_unit is supported now.
                - value: tiered
                  name: ''
                  description: ''
            created: *ref_7
            currency: *ref_8
            livemode: *ref_9
            lookup_key: *ref_10
            metadata:
              type: object
              properties: {}
              x-apifox-orders: *ref_11
              description: >-
                Set of key-value pairs that you can attach to an object. This
                can be useful for storing additional information about the
                object in a structured format.
              x-apifox-ignore-properties: []
            nickname: *ref_12
            product: *ref_13
            type:
              type: string
              description: >-
                One of one_time or recurring depending on whether the price is
                for a one-time purchase or a recurring (subscription) purchase.
              enum: *ref_14
              x-apifox-enum:
                - value: one_time
                  name: ''
                  description: only one-time is supported now.
                - value: recurring
                  name: ''
                  description: ''
            unit_amount: *ref_15
            recurring:
              type: object
              properties:
                interval:
                  type: string
                  description: >-
                    The frequency at which a subscription is billed. One of day,
                    week, month or year.
                  enum: *ref_16
                  x-apifox-enum:
                    - value: day
                      name: ''
                      description: ''
                    - value: week
                      name: ''
                      description: ''
                    - value: month
                      name: ''
                      description: ''
                    - value: year
                      name: ''
                      description: ''
                interval_count: *ref_17
                usage_type:
                  type: string
                  description: Configures how the quantity per period should be determined.
                  enum: *ref_18
                  x-apifox-enum:
                    - value: licensed
                      name: ''
                      description: ''
              x-apifox-orders: *ref_19
              description: The recurring components of a price
              required:
                - interval
              x-apifox-ignore-properties: []
            tiers:
              type: array
              items:
                type: object
                properties:
                  up_to: *ref_20
                  flat_amount: *ref_21
                  unit_amount: *ref_22
                x-apifox-orders: *ref_23
                x-apifox-ignore-properties: []
              description: （未实现）
          description: The price of the line item.
          x-apifox-ignore-properties:
            - id
            - object
            - active
            - billing_scheme
            - created
            - currency
            - livemode
            - lookup_key
            - metadata
            - nickname
            - product
            - type
            - unit_amount
            - recurring
            - tiers
        unit_amount: *ref_43
        quantity: *ref_44
        invoice_item: *ref_45
        type: *ref_46
        livemode: *ref_47
        subscription: *ref_48
        subscription_item: *ref_49
        unit_amount_excluding_tax: *ref_50
        discount_amounts:
          type: array
          items:
            type: object
            properties:
              amount: *ref_51
              discount: *ref_52
            x-apifox-orders: *ref_53
            required:
              - amount
              - discount
            description: The amount of discount calculated per discount for this line item.
            x-apifox-ignore-properties: []
          description: The amount of discount calculated per discount for this line item
        discountable: *ref_54
        proration:
          type: boolean
          description: 未实现
          deprecated: true
        proration_details:
          type: string
          description: 未实现
          deprecated: true
        amount_excluding_tax:
          type: integer
          description: 未实现
          deprecated: true
        discounts:
          type: string
          description: 未实现
          deprecated: true
        tax_amounts:
          type: integer
          description: 未实现
          deprecated: true
        tax_rates:
          type: string
          description: 未实现
          deprecated: true
      x-apifox-orders:
        - id
        - object
        - amount
        - currency
        - description
        - metadata
        - period
        - price
        - unit_amount
        - quantity
        - invoice_item
        - type
        - livemode
        - subscription
        - subscription_item
        - unit_amount_excluding_tax
        - discount_amounts
        - discountable
        - proration
        - proration_details
        - amount_excluding_tax
        - discounts
        - tax_amounts
        - tax_rates
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
