> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create invoice

> Create an invoice for a customer. The invoice can be charged automatically using a stored payment method, or sent to the customer for manual payment.

Required permissions:
 - `invoice:create`



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/whopsdk/openapi.documented.yml post /invoices
openapi: 3.1.0
info:
  title: Whop API
  description: >-
    The Whop REST API. Please see
    https://docs.whop.com/developer/api/getting-started for more details.
  termsOfService: https://whop.com/tos-developer-api/
  version: 1.0.0
servers:
  - url: https://api.whop.com/api/v1
    description: Production Whop API
security: []
tags:
  - name: Products
    description: Products
  - name: Plans
    description: Plans
  - name: Payments
    description: Payments
  - name: Refunds
    description: Refunds
  - name: Disputes
    description: Disputes
  - name: Dispute alerts
    description: Dispute alerts
  - name: Resolution center cases
    description: Resolution center cases
  - name: Checkout configurations
    description: Checkout configurations
  - name: Setup intents
    description: Setup intents
  - name: Payment methods
    description: Payment methods
  - name: Invoices
    description: Invoices
  - name: Promo codes
    description: Promo codes
  - name: Card transactions
    description: Card transactions
  - name: Ledger accounts
    description: Ledger accounts
  - name: Transfers
    description: Transfers
  - name: Withdrawals
    description: Withdrawals
  - name: Payout methods
    description: Payout methods
  - name: Verifications
    description: Verifications
  - name: Payout accounts
    description: Payout accounts
  - name: Topups
    description: Topups
  - name: Users
    description: Users
  - name: Companies
    description: Companies
  - name: Authorized users
    description: Authorized users
  - name: Fee markups
    description: Fee markups
  - name: Members
    description: Members
  - name: Memberships
    description: Memberships
  - name: Leads
    description: Leads
  - name: Entries
    description: Entries
  - name: Shipments
    description: Shipments
  - name: Reviews
    description: Reviews
  - name: Company token transactions
    description: Company token transactions
  - name: Affiliates
    description: Affiliates
  - name: Experiences
    description: Experiences
  - name: Forums
    description: Forums
  - name: Forum posts
    description: Forum posts
  - name: Chat channels
    description: Chat channels
  - name: Support channels
    description: Support channels
  - name: Messages
    description: Messages
  - name: Reactions
    description: Reactions
  - name: Dm members
    description: Dm members
  - name: Dm channels
    description: Dm channels
  - name: Notifications
    description: Notifications
  - name: Courses
    description: Courses
  - name: Course chapters
    description: Course chapters
  - name: Course lessons
    description: Course lessons
  - name: Course students
    description: Course students
  - name: Course lesson interactions
    description: Course lesson interactions
  - name: Apps
    description: Apps
  - name: Webhooks
    description: Webhooks
  - name: App builds
    description: App builds
  - name: Access tokens
    description: Access tokens
  - name: Account links
    description: Account links
  - name: Files
    description: Files
  - name: Ai chats
    description: Ai chats
  - name: Bounties
    description: Bounties
  - name: Stats
    description: Stats
  - name: Ad campaigns
    description: Ad campaigns
  - name: Ad groups
    description: Ad groups
  - name: Ads
    description: Ads
  - name: Conversions
    description: Conversions
paths:
  /invoices:
    post:
      tags:
        - Invoices
      summary: Create invoice
      description: >-
        Create an invoice for a customer. The invoice can be charged
        automatically using a stored payment method, or sent to the customer for
        manual payment.


        Required permissions:
         - `invoice:create`
      operationId: createInvoice
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    company_id:
                      type: string
                      description: >-
                        The unique identifier of the company to create this
                        invoice for.
                      example: biz_xxxxxxxxxxxxxx
                    product:
                      type: object
                      properties:
                        product_tax_code_id:
                          type:
                            - string
                            - 'null'
                          description: >-
                            The ID of the product tax code to apply to this
                            product.
                          example: ptc_xxxxxxxxxxxxxx
                        title:
                          type: string
                          description: The title of the product.
                      required:
                        - title
                      description: >-
                        The properties of the product to create for this
                        invoice. Provide this to create a new product inline.
                    customer_name:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The name of the customer. Required when creating an
                        invoice for a customer who is not yet a member of the
                        company.
                    email_address:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The email address of the customer. Required when
                        creating an invoice for a customer who is not yet a
                        member of the company.
                    member_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of an existing member to create
                        this invoice for. If not provided, you must supply an
                        email_address and customer_name.
                      example: mber_xxxxxxxxxxxxx
                    plan:
                      type: object
                      properties:
                        billing_period:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The interval in days at which the plan charges
                            (renewal plans).
                          example: 42
                        custom_fields:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                            properties:
                              field_type:
                                $ref: '#/components/schemas/CustomFieldTypes'
                                description: The type of the custom field.
                              id:
                                type:
                                  - string
                                  - 'null'
                                description: The ID of the custom field (if being updated)
                              name:
                                type: string
                                description: The name of the custom field.
                              order:
                                type:
                                  - integer
                                  - 'null'
                                description: The order of the field.
                                example: 42
                              placeholder:
                                type:
                                  - string
                                  - 'null'
                                description: The placeholder value of the field.
                              required:
                                type:
                                  - boolean
                                  - 'null'
                                description: Whether or not the field is required.
                            required:
                              - field_type
                              - name
                          description: An array of custom field objects.
                        description:
                          type:
                            - string
                            - 'null'
                          description: The description of the plan.
                        expiration_days:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The number of days until the membership expires and
                            revokes access (expiration plans). For example, 365
                            for a one-year access period.
                          example: 42
                        initial_price:
                          type:
                            - number
                            - 'null'
                          description: >-
                            An additional amount charged upon first purchase.
                            Use only if a one time payment OR you want to charge
                            an additional amount on top of the renewal price.
                            Provided as a number in the specified currency. Eg:
                            10.43 for $10.43
                          example: 6.9
                        internal_notes:
                          type:
                            - string
                            - 'null'
                          description: >-
                            A personal description or notes section for the
                            business.
                        legacy_payment_method_controls:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            Whether this plan uses legacy payment method
                            controls
                        payment_method_configuration:
                          type:
                            - object
                            - 'null'
                          properties:
                            disabled:
                              type: array
                              items:
                                $ref: '#/components/schemas/PaymentMethodTypes'
                              description: >-
                                An array of payment method identifiers that are
                                explicitly disabled. Only applies if the
                                include_platform_defaults is true.
                            enabled:
                              type: array
                              items:
                                $ref: '#/components/schemas/PaymentMethodTypes'
                              description: >-
                                An array of payment method identifiers that are
                                explicitly enabled. This means these payment
                                methods will be shown on checkout. Example use
                                case is to only enable a specific payment method
                                like cashapp, or extending the platform defaults
                                with additional methods.
                            include_platform_defaults:
                              type:
                                - boolean
                                - 'null'
                              description: >-
                                Whether Whop's platform default payment method
                                enablement settings are included in this
                                configuration. The full list of default payment
                                methods can be found in the documentation at
                                docs.whop.com/payments.
                          required:
                            - disabled
                            - enabled
                          description: >-
                            The explicit payment method configuration for the
                            plan. If not provided, the platform or company's
                            defaults will apply.
                        plan_type:
                          oneOf:
                            - $ref: '#/components/schemas/PlanTypes'
                            - type: 'null'
                          description: >-
                            Indicates if the plan is a one time payment or
                            recurring.
                        release_method:
                          oneOf:
                            - $ref: '#/components/schemas/ReleaseMethod'
                            - type: 'null'
                          description: >-
                            This is the release method the business uses to sell
                            this plan.
                        renewal_price:
                          type:
                            - number
                            - 'null'
                          description: >-
                            The amount the customer is charged every billing
                            period. Use only if a recurring payment. Provided as
                            a number in the specified currency. Eg: 10.43 for
                            $10.43
                          example: 6.9
                        stock:
                          type:
                            - integer
                            - 'null'
                          description: The number of units available for purchase.
                          example: 42
                        trial_period_days:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The number of free trial days added before a renewal
                            plan.
                          example: 42
                        unlimited_stock:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            When true, the plan has unlimited stock (stock field
                            is ignored). When false, purchases are limited by
                            the stock field.
                        visibility:
                          oneOf:
                            - $ref: '#/components/schemas/Visibility'
                            - type: 'null'
                          description: Shows or hides the plan from public/business view.
                      required: []
                      description: >-
                        The plan attributes defining the price, currency, and
                        billing interval for this invoice.
                    collection_method:
                      $ref: '#/components/schemas/InvoiceCollectionMethods'
                      description: >-
                        How the invoice should be collected. Use
                        charge_automatically to charge a stored payment method,
                        or send_invoice to email the customer.
                    due_date:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date by which the invoice must be paid. Required
                        unless save_as_draft is true.
                      example: '2023-12-01T05:00:00.401Z'
                    automatically_finalizes_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date and time when the invoice will be automatically
                        finalized. For charge_automatically, triggers an
                        automatic charge. For send_invoice, sends the invoice
                        email to the customer at the specified time.
                      example: '2023-12-01T05:00:00.401Z'
                    billing_address:
                      type:
                        - object
                        - 'null'
                      properties:
                        city:
                          type:
                            - string
                            - 'null'
                          description: The city of the address.
                        country:
                          type:
                            - string
                            - 'null'
                          description: The country of the address.
                        line1:
                          type:
                            - string
                            - 'null'
                          description: The line 1 of the address.
                        line2:
                          type:
                            - string
                            - 'null'
                          description: The line 2 of the address.
                        name:
                          type:
                            - string
                            - 'null'
                          description: The name of the customer.
                        phone:
                          type:
                            - string
                            - 'null'
                          description: The phone number of the customer.
                        postal_code:
                          type:
                            - string
                            - 'null'
                          description: The postal code of the address.
                        state:
                          type:
                            - string
                            - 'null'
                          description: The state of the address.
                        tax_id_type:
                          oneOf:
                            - $ref: '#/components/schemas/TaxIdentifierTypes'
                            - type: 'null'
                          description: The type of tax identifier.
                        tax_id_value:
                          type:
                            - string
                            - 'null'
                          description: The value of the tax identifier.
                      required: []
                      description: >-
                        Inline billing address to create a new mailing address
                        for this invoice. Cannot be used together with
                        mailing_address_id.
                    charge_buyer_fee:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Whether to charge the customer a buyer fee on this
                        invoice.
                    line_items:
                      type:
                        - array
                        - 'null'
                      items:
                        type: object
                        properties:
                          label:
                            type: string
                            description: The label or description for this line item.
                          quantity:
                            type:
                              - number
                              - 'null'
                            description: The quantity of this line item. Defaults to 1.
                            example: 6.9
                          unit_price:
                            type: number
                            description: >-
                              The unit price for this line item. Provided as a
                              number in the specified currency. Eg: 10.43 for
                              $10.43
                            example: 6.9
                        required:
                          - label
                          - unit_price
                        description: >-
                          A single line item to include on the invoice, with a
                          label, quantity, and unit price.
                      description: >-
                        Optional line items that break down the invoice total.
                        When provided, the sum of (quantity * unit_price) for
                        all items must equal the plan price.
                    mailing_address_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of an existing mailing address to
                        attach to this invoice. Cannot be used together with
                        billing_address.
                      example: ma_xxxxxxxxxxxxxxx
                    payment_method_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of the payment method to charge.
                        Required when collection_method is charge_automatically.
                      example: pmt_xxxxxxxxxxxxxx
                    payment_token_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The payment token ID to use for this invoice. If using
                        charge_automatically, you must provide a payment_token.
                      example: payt_xxxxxxxxxxxxx
                    save_as_draft:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        When true, creates the invoice as a draft without
                        sending or charging. Relaxes customer and due date
                        requirements.
                    subscription_billing_anchor_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date that defines when the subscription billing
                        cycle should start. When set on a renewal plan invoice,
                        this anchors all future billing periods to this date.
                      example: '2023-12-01T05:00:00.401Z'
                  required:
                    - company_id
                    - plan
                    - collection_method
                    - product
                  description: Autogenerated input type of CreateInvoice
                  title: CreateInvoiceInputWithProduct
                - type: object
                  properties:
                    company_id:
                      type: string
                      description: >-
                        The unique identifier of the company to create this
                        invoice for.
                      example: biz_xxxxxxxxxxxxxx
                    product_id:
                      type: string
                      description: >-
                        The unique identifier of an existing product to create
                        this invoice for.
                      example: prod_xxxxxxxxxxxxx
                    customer_name:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The name of the customer. Required when creating an
                        invoice for a customer who is not yet a member of the
                        company.
                    email_address:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The email address of the customer. Required when
                        creating an invoice for a customer who is not yet a
                        member of the company.
                    member_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of an existing member to create
                        this invoice for. If not provided, you must supply an
                        email_address and customer_name.
                      example: mber_xxxxxxxxxxxxx
                    plan:
                      type: object
                      properties:
                        billing_period:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The interval in days at which the plan charges
                            (renewal plans).
                          example: 42
                        custom_fields:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                            properties:
                              field_type:
                                $ref: '#/components/schemas/CustomFieldTypes'
                                description: The type of the custom field.
                              id:
                                type:
                                  - string
                                  - 'null'
                                description: The ID of the custom field (if being updated)
                              name:
                                type: string
                                description: The name of the custom field.
                              order:
                                type:
                                  - integer
                                  - 'null'
                                description: The order of the field.
                                example: 42
                              placeholder:
                                type:
                                  - string
                                  - 'null'
                                description: The placeholder value of the field.
                              required:
                                type:
                                  - boolean
                                  - 'null'
                                description: Whether or not the field is required.
                            required:
                              - field_type
                              - name
                          description: An array of custom field objects.
                        description:
                          type:
                            - string
                            - 'null'
                          description: The description of the plan.
                        expiration_days:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The number of days until the membership expires and
                            revokes access (expiration plans). For example, 365
                            for a one-year access period.
                          example: 42
                        initial_price:
                          type:
                            - number
                            - 'null'
                          description: >-
                            An additional amount charged upon first purchase.
                            Use only if a one time payment OR you want to charge
                            an additional amount on top of the renewal price.
                            Provided as a number in the specified currency. Eg:
                            10.43 for $10.43
                          example: 6.9
                        internal_notes:
                          type:
                            - string
                            - 'null'
                          description: >-
                            A personal description or notes section for the
                            business.
                        legacy_payment_method_controls:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            Whether this plan uses legacy payment method
                            controls
                        payment_method_configuration:
                          type:
                            - object
                            - 'null'
                          properties:
                            disabled:
                              type: array
                              items:
                                $ref: '#/components/schemas/PaymentMethodTypes'
                              description: >-
                                An array of payment method identifiers that are
                                explicitly disabled. Only applies if the
                                include_platform_defaults is true.
                            enabled:
                              type: array
                              items:
                                $ref: '#/components/schemas/PaymentMethodTypes'
                              description: >-
                                An array of payment method identifiers that are
                                explicitly enabled. This means these payment
                                methods will be shown on checkout. Example use
                                case is to only enable a specific payment method
                                like cashapp, or extending the platform defaults
                                with additional methods.
                            include_platform_defaults:
                              type:
                                - boolean
                                - 'null'
                              description: >-
                                Whether Whop's platform default payment method
                                enablement settings are included in this
                                configuration. The full list of default payment
                                methods can be found in the documentation at
                                docs.whop.com/payments.
                          required:
                            - disabled
                            - enabled
                          description: >-
                            The explicit payment method configuration for the
                            plan. If not provided, the platform or company's
                            defaults will apply.
                        plan_type:
                          oneOf:
                            - $ref: '#/components/schemas/PlanTypes'
                            - type: 'null'
                          description: >-
                            Indicates if the plan is a one time payment or
                            recurring.
                        release_method:
                          oneOf:
                            - $ref: '#/components/schemas/ReleaseMethod'
                            - type: 'null'
                          description: >-
                            This is the release method the business uses to sell
                            this plan.
                        renewal_price:
                          type:
                            - number
                            - 'null'
                          description: >-
                            The amount the customer is charged every billing
                            period. Use only if a recurring payment. Provided as
                            a number in the specified currency. Eg: 10.43 for
                            $10.43
                          example: 6.9
                        stock:
                          type:
                            - integer
                            - 'null'
                          description: The number of units available for purchase.
                          example: 42
                        trial_period_days:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            The number of free trial days added before a renewal
                            plan.
                          example: 42
                        unlimited_stock:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            When true, the plan has unlimited stock (stock field
                            is ignored). When false, purchases are limited by
                            the stock field.
                        visibility:
                          oneOf:
                            - $ref: '#/components/schemas/Visibility'
                            - type: 'null'
                          description: Shows or hides the plan from public/business view.
                      required: []
                      description: >-
                        The plan attributes defining the price, currency, and
                        billing interval for this invoice.
                    collection_method:
                      $ref: '#/components/schemas/InvoiceCollectionMethods'
                      description: >-
                        How the invoice should be collected. Use
                        charge_automatically to charge a stored payment method,
                        or send_invoice to email the customer.
                    due_date:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date by which the invoice must be paid. Required
                        unless save_as_draft is true.
                      example: '2023-12-01T05:00:00.401Z'
                    automatically_finalizes_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date and time when the invoice will be automatically
                        finalized. For charge_automatically, triggers an
                        automatic charge. For send_invoice, sends the invoice
                        email to the customer at the specified time.
                      example: '2023-12-01T05:00:00.401Z'
                    billing_address:
                      type:
                        - object
                        - 'null'
                      properties:
                        city:
                          type:
                            - string
                            - 'null'
                          description: The city of the address.
                        country:
                          type:
                            - string
                            - 'null'
                          description: The country of the address.
                        line1:
                          type:
                            - string
                            - 'null'
                          description: The line 1 of the address.
                        line2:
                          type:
                            - string
                            - 'null'
                          description: The line 2 of the address.
                        name:
                          type:
                            - string
                            - 'null'
                          description: The name of the customer.
                        phone:
                          type:
                            - string
                            - 'null'
                          description: The phone number of the customer.
                        postal_code:
                          type:
                            - string
                            - 'null'
                          description: The postal code of the address.
                        state:
                          type:
                            - string
                            - 'null'
                          description: The state of the address.
                        tax_id_type:
                          oneOf:
                            - $ref: '#/components/schemas/TaxIdentifierTypes'
                            - type: 'null'
                          description: The type of tax identifier.
                        tax_id_value:
                          type:
                            - string
                            - 'null'
                          description: The value of the tax identifier.
                      required: []
                      description: >-
                        Inline billing address to create a new mailing address
                        for this invoice. Cannot be used together with
                        mailing_address_id.
                    charge_buyer_fee:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Whether to charge the customer a buyer fee on this
                        invoice.
                    line_items:
                      type:
                        - array
                        - 'null'
                      items:
                        type: object
                        properties:
                          label:
                            type: string
                            description: The label or description for this line item.
                          quantity:
                            type:
                              - number
                              - 'null'
                            description: The quantity of this line item. Defaults to 1.
                            example: 6.9
                          unit_price:
                            type: number
                            description: >-
                              The unit price for this line item. Provided as a
                              number in the specified currency. Eg: 10.43 for
                              $10.43
                            example: 6.9
                        required:
                          - label
                          - unit_price
                        description: >-
                          A single line item to include on the invoice, with a
                          label, quantity, and unit price.
                      description: >-
                        Optional line items that break down the invoice total.
                        When provided, the sum of (quantity * unit_price) for
                        all items must equal the plan price.
                    mailing_address_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of an existing mailing address to
                        attach to this invoice. Cannot be used together with
                        billing_address.
                      example: ma_xxxxxxxxxxxxxxx
                    payment_method_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The unique identifier of the payment method to charge.
                        Required when collection_method is charge_automatically.
                      example: pmt_xxxxxxxxxxxxxx
                    payment_token_id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        The payment token ID to use for this invoice. If using
                        charge_automatically, you must provide a payment_token.
                      example: payt_xxxxxxxxxxxxx
                    save_as_draft:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        When true, creates the invoice as a draft without
                        sending or charging. Relaxes customer and due date
                        requirements.
                    subscription_billing_anchor_at:
                      type:
                        - string
                        - 'null'
                      format: date-time
                      description: >-
                        The date that defines when the subscription billing
                        cycle should start. When set on a renewal plan invoice,
                        this anchors all future billing periods to this date.
                      example: '2023-12-01T05:00:00.401Z'
                  required:
                    - company_id
                    - plan
                    - collection_method
                    - product_id
                  description: Autogenerated input type of CreateInvoice
                  title: CreateInvoiceInputWithProductId
              type: object
              description: Parameters for CreateInvoice
      responses:
        '200':
          description: A successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: invalid_request_error
                  code: parameter_missing
                  message: 'Missing required parameter: amount.'
                  param: amount
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: unauthorized
                  message: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: forbidden
                  message: You do not have permission to access this resource
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: not_found
                  message: Resource not found
        '422':
          description: Verification required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error: null
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: internal_server_error
                  message: An unexpected error occurred
      security:
        - bearerAuth:
            - invoice:create
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Whop from '@whop/sdk';

            const client = new Whop({
              apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
            });

            const invoice = await client.invoices.create({
              collection_method: 'send_invoice',
              company_id: 'biz_xxxxxxxxxxxxxx',
              plan: {},
              product: { title: 'title' },
            });

            console.log(invoice.id);
        - lang: Python
          source: |-
            import os
            from whop_sdk import Whop

            client = Whop(
                api_key=os.environ.get("WHOP_API_KEY"),  # This is the default and can be omitted
            )
            invoice = client.invoices.create(
                collection_method="send_invoice",
                company_id="biz_xxxxxxxxxxxxxx",
                plan={},
                product={
                    "title": "title"
                },
            )
            print(invoice.id)
        - lang: Ruby
          source: |-
            require "whop_sdk"

            whop = WhopSDK::Client.new(api_key: "My API Key")

            invoice = whop.invoices.create(
              body: {collection_method: :send_invoice, company_id: "biz_xxxxxxxxxxxxxx", plan: {}, product: {title: "title"}}
            )

            puts(invoice)
components:
  schemas:
    CustomFieldTypes:
      type: string
      const: text
      description: The type of the custom field.
    PaymentMethodTypes:
      type: string
      enum:
        - acss_debit
        - affirm
        - afterpay_clearpay
        - alipay
        - alma
        - amazon_pay
        - apple
        - apple_pay
        - au_bank_transfer
        - au_becs_debit
        - bacs_debit
        - bancolombia
        - bancontact
        - billie
        - bizum
        - blik
        - boleto
        - bre_b
        - ca_bank_transfer
        - capchase_pay
        - card
        - card_installments_three
        - card_installments_six
        - card_installments_twelve
        - cashapp
        - claritypay
        - coinbase
        - crypto
        - custom
        - customer_balance
        - demo_pay
        - efecty
        - eps
        - eu_bank_transfer
        - fpx
        - gb_bank_transfer
        - giropay
        - google_pay
        - gopay
        - grabpay
        - id_bank_transfer
        - ideal
        - interac
        - kakao_pay
        - klarna
        - klarna_pay_now
        - konbini
        - kr_card
        - kr_market
        - kriya
        - kueski
        - link
        - mb_way
        - m_pesa
        - mercado_pago
        - mobilepay
        - mondu
        - multibanco
        - naver_pay
        - nequi
        - netbanking
        - ng_bank
        - ng_bank_transfer
        - ng_card
        - ng_market
        - ng_ussd
        - ng_wallet
        - nz_bank_account
        - oxxo
        - p24
        - pago_efectivo
        - pse
        - pay_by_bank
        - payco
        - paynow
        - paypal
        - paypay
        - payto
        - pix
        - platform_balance
        - promptpay
        - qris
        - rechnung
        - revolut_pay
        - samsung_pay
        - satispay
        - scalapay
        - sencillito
        - sepa_debit
        - sequra
        - servipag
        - sezzle
        - shop_pay
        - shopeepay
        - sofort
        - south_korea_market
        - spei
        - splitit
        - sunbit
        - swish
        - tamara
        - twint
        - upi
        - us_bank_account
        - us_bank_transfer
        - venmo
        - vipps
        - webpay
        - wechat_pay
        - yape
        - zip
        - coinflow
        - unknown
      description: The different types of payment methods that can be used.
    PlanTypes:
      type: string
      enum:
        - renewal
        - one_time
      description: The type of plan that can be attached to a product
    ReleaseMethod:
      type: string
      enum:
        - buy_now
        - waitlist
      description: The methods of how a plan can be released.
    Visibility:
      type: string
      enum:
        - visible
        - hidden
        - archived
        - quick_link
      description: Visibility of a resource
    InvoiceCollectionMethods:
      type: string
      enum:
        - send_invoice
        - charge_automatically
      description: The method of collection for an invoice.
    TaxIdentifierTypes:
      type: string
      enum:
        - ad_nrt
        - ao_tin
        - ar_cuit
        - am_tin
        - aw_tin
        - au_abn
        - au_arn
        - eu_vat
        - az_tin
        - bs_tin
        - bh_vat
        - bd_bin
        - bb_tin
        - by_tin
        - bj_ifu
        - bo_tin
        - ba_tin
        - br_cnpj
        - br_cpf
        - bg_uic
        - bf_ifu
        - kh_tin
        - cm_niu
        - ca_bn
        - ca_gst_hst
        - ca_pst_bc
        - ca_pst_mb
        - ca_pst_sk
        - ca_qst
        - cv_nif
        - cl_tin
        - cn_tin
        - co_nit
        - cd_nif
        - cr_tin
        - hr_oib
        - do_rcn
        - ec_ruc
        - eg_tin
        - sv_nit
        - et_tin
        - eu_oss_vat
        - ge_vat
        - de_stn
        - gb_vat
        - gn_nif
        - hk_br
        - hu_tin
        - is_vat
        - in_gst
        - id_npwp
        - il_vat
        - jp_cn
        - jp_rn
        - jp_trn
        - kz_bin
        - ke_pin
        - kg_tin
        - la_tin
        - li_uid
        - li_vat
        - my_frp
        - my_itn
        - my_sst
        - mr_nif
        - mx_rfc
        - md_vat
        - me_pib
        - ma_vat
        - np_pan
        - nz_gst
        - ng_tin
        - mk_vat
        - no_vat
        - no_voec
        - om_vat
        - pe_ruc
        - ph_tin
        - pl_nip
        - ro_tin
        - ru_inn
        - ru_kpp
        - sa_vat
        - sn_ninea
        - rs_pib
        - sg_gst
        - sg_uen
        - si_tin
        - za_vat
        - kr_brn
        - es_cif
        - ch_uid
        - ch_vat
        - tw_vat
        - tj_tin
        - tz_vat
        - th_vat
        - tr_tin
        - ug_tin
        - ua_vat
        - ae_trn
        - us_ein
        - uy_ruc
        - uz_tin
        - uz_vat
        - ve_rif
        - vn_tin
        - zm_tin
        - zw_tin
        - sr_fin
        - xi_vat
      description: The type of tax identifier
    Invoice:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the invoice.
          example: inv_xxxxxxxxxxxxxx
        created_at:
          type: string
          format: date-time
          description: The datetime the invoice was created.
          example: '2023-12-01T05:00:00.401Z'
        status:
          $ref: '#/components/schemas/InvoiceStatuses'
          description: >-
            The current payment status of the invoice, such as draft, open,
            paid, or void.
        number:
          type: string
          description: The sequential invoice number for display purposes.
          example: '#0001'
        due_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The deadline by which payment is expected. Null if the invoice is
            collected automatically.
          example: '2023-12-01T05:00:00.401Z'
        email_address:
          type:
            - string
            - 'null'
          description: >-
            The email address of the customer this invoice is addressed to. Null
            if no email is on file.
          example: customer@example.com
        fetch_invoice_token:
          type: string
          description: >-
            A signed token that allows fetching invoice data publicly without
            authentication.
          example: eyJhbGciOiJIUzI1NiJ9...
        current_plan:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier for the plan.
              example: plan_xxxxxxxxxxxxx
            formatted_price:
              type: string
              description: The formatted price (including currency) for the plan.
              example: $10.00
            currency:
              $ref: '#/components/schemas/Currencies'
              description: >-
                The currency used for all prices on this plan (e.g., 'usd',
                'eur'). All monetary amounts on the plan are denominated in this
                currency.
          required:
            - id
            - formatted_price
            - currency
          description: The plan that this invoice charges for.
        user:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              description: The unique identifier for the user.
              example: user_xxxxxxxxxxxxx
            name:
              type:
                - string
                - 'null'
              description: The user's display name shown on their public profile.
              example: John Doe
            username:
              type: string
              description: The user's unique username shown on their public profile.
              example: johndoe42
          required:
            - id
            - name
            - username
          description: >-
            The user this invoice is addressed to. Null if the user account has
            been removed.
      required:
        - id
        - created_at
        - status
        - number
        - due_date
        - email_address
        - fetch_invoice_token
        - current_plan
        - user
      description: >-
        An invoice represents an itemized bill sent by a company to a customer
        for a specific product and plan, tracking the amount owed, due date, and
        payment status.
    InvoiceStatuses:
      type: string
      enum:
        - draft
        - open
        - paid
        - past_due
        - uncollectible
        - void
      description: The different statuses an invoice can be in
    Currencies:
      type: string
      enum:
        - usd
        - sgd
        - inr
        - aud
        - brl
        - cad
        - dkk
        - eur
        - nok
        - gbp
        - sek
        - chf
        - hkd
        - huf
        - jpy
        - mxn
        - myr
        - pln
        - czk
        - nzd
        - aed
        - eth
        - ape
        - cop
        - ron
        - thb
        - bgn
        - idr
        - dop
        - php
        - try
        - krw
        - twd
        - vnd
        - pkr
        - clp
        - uyu
        - ars
        - zar
        - dzd
        - tnd
        - mad
        - kes
        - kwd
        - jod
        - all
        - xcd
        - amd
        - bsd
        - bhd
        - bob
        - bam
        - khr
        - crc
        - xof
        - egp
        - etb
        - gmd
        - ghs
        - gtq
        - gyd
        - ils
        - jmd
        - mop
        - mga
        - mur
        - mdl
        - mnt
        - nad
        - ngn
        - mkd
        - omr
        - pyg
        - pen
        - qar
        - rwf
        - sar
        - rsd
        - lkr
        - tzs
        - ttd
        - uzs
        - rub
        - btc
        - cny
        - usdt
        - kzt
      description: The available currencies on the platform
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        A company API key, company scoped JWT, app API key, or user OAuth token.
        You must prepend your key/token with the word 'Bearer', which will look
        like `Bearer ***************************`
      scheme: bearer
      bearerFormat: auth-scheme

````