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

# Batch create invoices

> Create multiple invoices in a single request. Supports an optional `allow_partial_success` mode that commits each invoice independently, returning `207 Multi-Status` when results are mixed.

## Modes

This endpoint supports two modes of operation controlled by the `allow_partial_success` query parameter.

### All-or-nothing (default)

When `allow_partial_success` is omitted or `false`, the request behaves as a single atomic operation. If any invoice fails validation or creation, the entire batch is rolled back and a `4xx` error is returned. No invoices are persisted.

This is equivalent to the [`/bulk` endpoint](/api-reference/v1/bulk-create-invoices), but always returns the `BatchCreateInvoicesResponse` envelope (with an empty `failed_invoices` map on success).

### Partial success

When `allow_partial_success=true`, each invoice is created in its own independent transaction. A failure on one invoice does not roll back invoices that have already succeeded.

* `successful_invoices` — invoices that were committed.
* `failed_invoices` — a map from a failure key to a failure object with a `message` and optional machine-readable `code` for invoices that did not persist.

HTTP `207 Multi-Status` is returned when at least one invoice fails and at least one succeeds. `200 OK` is returned when all invoices succeed (even in partial-success mode).

## Failure keys

Each entry in `failed_invoices` is keyed by a human-readable identifier derived in this order:

1. The invoice's `external_id`
2. The invoice's `reference_number`
3. `unknown-N` (zero-based counter) if neither is set

If two failed invoices share the same base key, subsequent entries are suffixed with `#1`, `#2`, etc. (e.g. `ref-2`, `ref-2#1`).

## Rate Limiting

This endpoint has a custom rate limit policy.

**Rate Limit Details:**

| Environment | Limit       | Refill Period | Initial Size |
| ----------- | ----------- | ------------- | ------------ |
| Sandbox     | 20 requests | 1 second      | 40 requests  |
| Production  | 20 requests | 1 second      | 40 requests  |

**Response Headers:**

All responses include the following rate limit headers:

* **X-RateLimit-Limit**: The rate limit bucket capacity
* **X-RateLimit-Remaining**: The number of tokens remaining in the bucket
* **X-RateLimit-Reset**: UTC timestamp (in seconds) when the bucket will be refilled

For more details on rate limiting, see [Rate Limiting](/api-details/rate-limiting).


## OpenAPI

````yaml post /v1/businesses/{businessId}/invoices/batch
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/invoices/batch:
    post:
      tags: []
      summary: Batch create invoices
      description: >-
        Create multiple invoices in a single request. Supports an optional
        `allow_partial_success` mode that commits each invoice independently,
        returning `207 Multi-Status` when results are mixed.
      operationId: business.invoices.batch.post
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to create invoices for.
          required: true
          schema:
            type: string
        - name: allow_partial_success
          in: query
          description: >-
            When `true`, invoices are committed individually so that a failure
            on one invoice does not roll back the others. Defaults to `false`
            (all-or-nothing).
          required: false
          schema:
            type: boolean
            default: false
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/NewInvoicePostParams'
      responses:
        '200':
          description: All invoices were created successfully.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateInvoicesResponse'
        '207':
          description: >-
            Partial success. At least one invoice succeeded and at least one
            failed. Only returned when `allow_partial_success=true`. Check
            `failed_invoices` for details on which invoices did not persist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCreateInvoicesResponse'
        '400':
          description: >-
            Bad request. This is returned when the payload contains duplicate
            `external_id` values, or (when `allow_partial_success=false`) when
            an invoice conflicts with an existing entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            Business not found, or (when `allow_partial_success=false`) a ledger
            account specified by a line item does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    NewInvoicePostParams:
      type: object
      properties:
        external_id:
          type: string
          description: >-
            External ID for the invoice within your platform. **Idempotency
            key**.
          example: '019234'
        sent_at:
          type: string
          format: date-time
          description: When the invoice was sent by the business to the recipient.
        due_at:
          type: string
          format: date-time
          description: When the invoice is due.
        voided_at:
          type: string
          format: date-time
          description: >-
            When the invoice was voided. Voiding excludes the invoice entirely
            from accounting.
        customer_id:
          type: string
          format: uuid
          description: >-
            ID of the customer to associate with the invoice. Either
            `customer_id` or `customer_external_id` must be provided.
        customer_external_id:
          type: string
          description: >-
            External ID of the customer to associate with the invoice. Either
            `customer_id` or `customer_external_id` must be provided. If the
            customer does not already exist, Layer will create it using this
            external ID.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/NewInvoiceLineItem'
          description: Line items making up the invoice.
        additional_sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/CreateTaxLineItem'
          description: >-
            List of additional sales tax obligations on the invoice outside
            individual line items.
        additional_discount:
          type: integer
          description: >-
            Additional discount applied to the whole invoice in addition to
            individual line items.
        tips:
          type: integer
          description: Tips included by the buyer, in cents.
        tips_account:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            The Account Identifier for a tips account. If not specified, Layer
            uses the chart's default tips account, which is typically a
            liability account. Specify a different account if tips should be
            tracked as revenue.
        payments:
          type: array
          items:
            $ref: '#/components/schemas/CreateImmediatePaymentInput'
          description: >-
            Payments that have been made towards the balance of the invoice.
            Include these to create an immediately paid or partially paid
            invoice in the same API call.
        dedicated_refunds:
          type: array
          items:
            $ref: '#/components/schemas/CreateDedicatedRefundParams'
          description: Dedicated refunds to associate with this invoice.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the invoice (for
            example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice. Can be used to filter when listing invoices.
    BatchCreateInvoicesResponse:
      type: object
      description: >-
        Response from the batch invoice creation endpoint, containing both
        successful and failed invoices.
      properties:
        successful_invoices:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoice'
          description: Invoices that were successfully created.
        failed_invoices:
          type: object
          description: >-
            Map of failed invoices keyed by an identifier derived from the
            invoice's `external_id`, `reference_number`, or `unknown-N` if
            neither is present. When two failed invoices share the same base
            key, subsequent entries are suffixed with `#1`, `#2`, etc.
          additionalProperties:
            $ref: '#/components/schemas/BatchCreateInvoiceFailure'
      required:
        - successful_invoices
        - failed_invoices
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    NewInvoiceLineItem:
      type: object
      properties:
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            Account identifier for the line item. If specified, the line item is
            attributed to that specific account. If omitted, Layer maps the
            product name to an account using the business or industry accounting
            configuration.
        prepayment_account_identifier:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: >-
            Ledger account for the line item used for accrual reporting. Should
            only be specified when this line item is a pre-payment.
        external_id:
          type: string
          nullable: true
          description: The external ID of the invoice line item in your system.
        description:
          type: string
          nullable: true
          description: Description for the new invoice line item.
          example: Line item description
        product:
          type: string
          description: Name of the product the line item is for.
          example: Widgets
        unit_price:
          type: integer
          format: int64
        quantity:
          type: number
          format: bigdecimal
          nullable: true
        discount_amount:
          type: integer
          format: int64
          nullable: true
        sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/CreateTaxLineItem'
          nullable: true
          description: Sales tax obligations for this line item.
        dedicated_refunds:
          type: array
          items:
            $ref: '#/components/schemas/CreateDedicatedRefundParams'
          description: Dedicated refunds to associate with this invoice line item.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: List of tags to associate with the invoice line item.
        time_entry_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            UUID of a time entry to link to this invoice line item. The time
            entry is automatically unlinked when the line item is deleted or
            updated to remove it.
    CreateTaxLineItem:
      type: object
      required:
        - amount
      properties:
        tax_account:
          $ref: '#/components/schemas/TaxAccountIdentifier'
          description: >-
            Tax identifier for this line item. Use a `Tax_Name` object to have
            Layer create or reuse a tax account by name, or use an `AccountId`
            or `StableName` account identifier when you want to target a
            specific ledger account.
        amount:
          type: integer
          format: int64
          description: Amount, in cents, of tax owed.
    AccountIdentifier:
      oneOf:
        - $ref: '#/components/schemas/AccountId'
          description: ID of the account.
          title: Account ID
        - $ref: '#/components/schemas/AccountStableName'
          description: Stable name associated with the account.
          title: Account Stable Name
    CreateImmediatePaymentInput:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
          description: >-
            External ID for the payment within your platform. **Idempotency
            key**.
          example: '12345'
        method:
          $ref: '#/components/schemas/PaymentMethod'
          description: Method used to make the payment.
        fee:
          type: integer
          format: int64
          nullable: true
          description: >-
            Fee associated with processing a payment, e.g. credit card
            processing fees, in cents.
        amount:
          type: integer
          format: int64
          description: >-
            Value of the payment, in cents. If omitted, Layer assumes the
            payment amount is the full remaining invoice total.
        processor:
          type: string
          nullable: true
          description: >-
            Processor used to make the payment, if any. Any processor name can
            be provided and will be tracked.
          example: STRIPE
        payment_clearing_account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            The the ledger account to use for the payment (overrides the default
            determined by the payment method).
        dedicated_refunds:
          type: array
          items:
            $ref: '#/components/schemas/CreateDedicatedRefundParams'
          description: Dedicated refunds to associate with this invoice payment.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the invoice
            payment (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice payment. Can be used to filter when listing invoice
            payments.
    CreateDedicatedRefundParams:
      type: object
      properties:
        external_id:
          type: string
          description: >-
            Unique ID of the refund in your system for linking purposes.
            **Idempotency key**.
          example: '31415926535'
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          nullable: true
          description: >-
            Optional account identifier to override what ledger account the
            dedicated refund comes out of.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/CreateCustomerRefundAllocationLineItemParams'
          nullable: true
          description: >-
            Detailed line items for the refund allocation. Use this for itemized
            refunds where you need to specify the exact amounts and accounts.
        completed_at:
          type: string
          format: date-time
          description: When the dedicated refund was given and paid.
        refund_processing_fee:
          type: integer
          format: int64
          description: Fee charged to the business for processing the refund.
        method:
          $ref: '#/components/schemas/PaymentMethod'
        processor:
          type: string
          nullable: true
        refunded_payment_fees:
          type: array
          items:
            $ref: '#/components/schemas/RefundedPaymentFeeInput'
          description: >-
            List of fees associated with the payment for this dedicated refund.
            These are refunded from the payment processor rather than the
            business.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: List of tags associated with this dedicated refund.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the refund (for
            example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the refund. Can be used to filter when listing refunds.
        payment_clearing_account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          nullable: true
          description: >-
            Optional account identifier to specify the clearing account for
            inferred refund payments. Only used when the system automatically
            generates a payment for the dedicated refund.
    TagKeyValue:
      type: object
      description: >-
        A TagKeyValue holds key=value data related to a tag. This is used when
        creating or updating taggable entities (transactions, invoices, etc.).
      properties:
        key:
          type: string
          description: The tag dimension key (e.g., "department", "project", "location").
          example: department
        dimension_display_name:
          type: string
          nullable: true
          description: >-
            If the TagDimension doesn't exist, providing this value specifies
            the display name upon database insertion. Otherwise, it is left as
            null on the TagDimension.
          example: Department
        value:
          type: string
          description: The tag value (e.g., "sales", "marketing", "engineering").
          example: sales
        value_display_name:
          type: string
          nullable: true
          description: >-
            If the TagValueDefinition doesn't exist, providing this value
            specifies the display name upon database insertion. Otherwise, it is
            left as null on the TagValueDefinition.
          example: Sales Department
      required:
        - key
        - value
    PlatformDefinedJson:
      type: object
      description: Arbitrary JSON data defined by the caller, with a 1KB size constraint.
      additionalProperties: true
      example:
        custom_field: value
        any valid json: below 1kb
        nested:
          meaning of life: 42
          array: []
    ApiInvoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the invoice.
        type:
          type: string
          description: Resource type. Value will be 'Invoice'.
          example: Invoice
        business_id:
          type: string
          format: uuid
          description: ID of the Business that generated the invoice.
        external_id:
          type: string
          description: Unique ID of the invoice in your system for linking purposes.
          example: '1'
        status:
          $ref: '#/components/schemas/InvoiceStatus'
          description: Status of the invoice.
        sent_at:
          type: string
          format: date-time
          description: When the invoice was sent by the business to the recipient.
        due_at:
          type: string
          format: date-time
          description: When the invoice is due.
        paid_at:
          type: string
          format: date-time
          description: When the invoice was paid.
        voided_at:
          type: string
          format: date-time
          description: >-
            When the invoice was voided. Voiding excludes the invoice from
            accounting.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceLineItem'
          description: Line items making up the invoice.
        subtotal:
          type: integer
          description: Subtotal of all invoice line items in cents.
        additional_discount:
          type: integer
          description: >-
            Additional discount applied to the whole invoice in addition to
            individual line items.
        additional_sales_taxes_total:
          type: integer
          description: >-
            Sum of all taxes across the invoice line items and any additional
            taxes in cents.
        additional_sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceTaxLineItem'
          description: List of additional sales tax line items.
        tips:
          type: integer
          description: Tips included by the buyer, in cents.
        total_amount:
          type: integer
          description: Total amount of the invoice in cents.
        outstanding_balance:
          type: integer
          description: >-
            The remaining balance on the invoice after factoring in all previous
            invoice payments and write-offs.
        memo:
          type: string
          description: >-
            Memo for any text you would like to associate with the Invoice (for
            example, to display to end users).
        payment_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoicePaymentAllocation'
          description: >-
            Payments made by a customer are allocated toward one or many
            invoices. This list shows which payments have been been allocated
            towards this invoice. The most common case is that there is a 1:1
            relationship between a payment and an invoice, in which case the
            allocation’s `amount` will match the payment’s `amount`.
          example: []
        refund_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiRefundAllocation'
          description: >-
            Refunds made by a customer are allocated toward one or many
            invoices. This list shows which refunds have been been allocated
            towards this invoice.
          example: []
        imported_at:
          type: string
          format: date-time
          description: >-
            Time when the invoice was first imported into Layer. **Eligible sort
            key**.
        updated_at:
          type: string
          format: date-time
          description: >-
            Time when the invoice was first updated in Layer. **Eligible sort
            key**.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: Tags on the transactions associated with the invoice.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice. Can be used to filter when listing invoices.
    BatchCreateInvoiceFailure:
      type: object
      description: >-
        Details about a single invoice that failed to be created in a batch
        request.
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code for the failure. Uses the same values as
            the `error_enum` field in standard error responses (e.g.
            `SpecifiedIdNotFound`, `SpecifiedBadRequest`). Null for unexpected
            internal errors.
          nullable: true
        message:
          type: string
          description: Human-readable description of why this invoice failed.
      required:
        - message
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
    SingleApiChartAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AccountIdentifier'
        name:
          type: string
          description: Name of the account.
          example: Current Assets
        account_number:
          type: string
          nullable: true
          description: Account number if configured.
          example: '4000'
        stable_name:
          $ref: '#/components/schemas/AccountStableName'
        normality:
          $ref: '#/components/schemas/BankTransactionDirection'
        account_type:
          $ref: '#/components/schemas/ApiLedgerAccountType'
        account_subtype:
          $ref: '#/components/schemas/ApiLedgerAccountSubtype'
      description: A single ledger account without nested children.
    TaxAccountIdentifier:
      type: object
      oneOf:
        - $ref: '#/components/schemas/TaxName'
          title: Tax Name
        - $ref: '#/components/schemas/AccountId'
          title: Ledger Account ID
        - $ref: '#/components/schemas/AccountStableName'
          title: Ledger Account Stable Name
      discriminator:
        propertyName: type
        mapping:
          AccountId:
            $ref: '#/components/schemas/AccountId'
          StableName:
            $ref: '#/components/schemas/AccountStableName'
          Tax_Name:
            $ref: '#/components/schemas/TaxName'
    AccountId:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - AccountId
          description: Resource type. Value will be `AccountId`.
          example: AccountId
        id:
          type: string
          format: uuid
          description: ID of the account.
    AccountStableName:
      type: object
      required:
        - type
        - stable_name
      properties:
        type:
          type: string
          enum:
            - StableName
          description: Resource type. Value will be `StableName`.
          example: StableName
        stable_name:
          type: string
          example: CURRENT_ASSETS
          description: Stable name of the account.
    PaymentMethod:
      type: string
      enum:
        - CASH
        - CHECK
        - CREDIT_CARD
        - ACH
        - CREDIT_BALANCE
        - OTHER
    CreateCustomerRefundAllocationLineItemParams:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
          description: An external identifier for the line item.
        amount:
          type: integer
          format: int64
          description: The amount of this line item in cents.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          nullable: true
          description: Identifier of the ledger account for this line item.
        prepayment_account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          nullable: true
          description: Identifier of the prepayment ledger account for this line item.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: Tags to associate with the line item.
        memo:
          type: string
          nullable: true
          description: Memo for any text you would like to associate with the line item.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the refund allocation line item.
      required:
        - amount
      description: Parameters for creating a refund allocation line item.
    RefundedPaymentFeeInput:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/AccountIdentifier'
          description: Account to which the fee should be allocated.
        description:
          type: string
          nullable: true
          description: Description of the fee.
        fee_amount:
          type: integer
          format: int64
          description: Amount of the fee in cents.
      required:
        - account
        - fee_amount
      description: Input parameters for a refunded payment fee.
    InvoiceStatus:
      type: string
      enum:
        - SENT
        - PARTIALLY_PAID
        - PAID
        - VOIDED
        - PARTIALLY_WRITTEN_OFF
        - WRITTEN_OFF
        - REFUNDED
    ApiInvoiceLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the invoice line item.
        external_id:
          type: string
          nullable: true
          description: The external ID of the invoice line item in your system.
        invoice_id:
          type: string
          format: uuid
          description: ID of the parent invoice.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: Identifier for the account.
        ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for the line item.
        prepayment_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: >-
            Ledger account for the line item used for accrual reporting. Should
            only be specified when this line item is a pre-payment.
        description:
          type: string
          nullable: true
          description: Description for the invoice line item.
          example: Widget sale
        product:
          type: string
          description: Name of the product the invoice line item is for.
          example: Widget
        unit_price:
          $ref: '#/components/schemas/SignedAmount'
          description: The amount in cents of each unit.
        quantity:
          type: number
          format: bigdecimal
          description: Number of units sold.
        subtotal:
          type: integer
          format: int64
          description: Subtotal for the invoice line item in cents.
        discount_amount:
          type: integer
          format: int64
          description: Total discount given to this line item, in cents.
        sales_taxes_total:
          type: integer
          format: int64
          description: Sum of amounts for all sales taxes for the line item.
        sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceTaxLineItem'
          description: List of sales taxes line items.
          nullable: true
        total_amount:
          type: integer
          format: int64
          description: Total amount on the line item.
        refund_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiRefundAllocation'
          description: Refund allocations associated with this invoice line item.
          example: []
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: >-
            List of tags on the transaction associated with the invoice line
            item.
    ApiInvoiceTaxLineItem:
      type: object
      properties:
        tax_account:
          $ref: '#/components/schemas/TaxAccountIdentifier'
          description: >-
            Tax account name or identifier. If not set, account defaults to top
            level sales tax payable liability account.
        tax_ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for the tax line item.
          example:
            id: c4007474-f604-4d57-9690-b7f40f7a1cee
            name: 'Sales tax: CALIFORNIA'
            stable_name: SALES_TAXES_PAYABLE:CALIFORNIA
            normality: CREDIT
            account_type:
              value: LIABILITY
              display_name: Liabilities
            account_subtype:
              value: SALES_TAXES_PAYABLE
              display_name: Sales Taxes Payable
        amount:
          type: integer
          format: int64
          description: Amount, in cents, of tax owed.
    ApiInvoicePaymentAllocation:
      type: object
      properties:
        invoice_id:
          type: string
          format: uuid
          description: ID of the invoice.
        payment_id:
          type: string
          format: uuid
          description: ID of the payment.
        amount:
          type: integer
          format: int64
          description: >-
            Amount of the payment allocated towards this invoice. If this amount
            is the full payment amount, this payment was fully allocated towards
            this invoice. The amount cannot exceed the invoice total.
        amount_net_of_refunds:
          type: integer
          format: int64
          description: Amount allocated after applying any refunds, in cents.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: >-
            List of tags on the transaction associated with the payment
            allocation.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the invoice
            payment allocation (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice payment allocation.
    ApiRefundAllocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the refund allocation.
        invoice_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the invoice this allocation is associated with.
        amount:
          type: integer
          format: int64
          description: Amount of the allocation in cents.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            Identifier of the ledger account for the refund allocation to apply
            to.
          nullable: true
        invoice_external_id:
          type: string
          nullable: true
          description: External ID of the invoice this allocation is associated with.
        invoice_line_item_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            ID of the invoice line item this allocation is associated with. If
            specified, must not refer to a different invoice `invoice_external`
            or `invoice_id`.
        invoice_line_item_external_id:
          type: string
          nullable: true
          description: >-
            The external ID of the invoice line item to refund. If specified
            alongside `invoice_line_item_id`, they must refer to the same
            invoice line item.
        invoice_payment_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the invoice payment this allocation is associated with.
        invoice_payment_external_id:
          type: string
          nullable: true
          description: >-
            External ID of the invoice payment this allocation is associated
            with.
        customer:
          $ref: '#/components/schemas/ApiCustomerData'
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the refund
            allocation (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the refund allocation.
    ApiTag:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID for the tag.
        key:
          type: string
          description: Key for the tag.
          example: ExampleTagKey
        dimension_display_name:
          type: string
          nullable: true
          description: Display name for the tag dimension.
        value:
          type: string
          description: Value for the tag.
          example: ExampleTagValue
        value_display_name:
          type: string
          nullable: true
          description: Display name for the tag value definition.
        dimension_id:
          type: string
          format: uuid
          description: ID of the tag dimension this tag belongs to.
        definition_id:
          type: string
          format: uuid
          description: ID of the tag value definition.
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: When the tag was archived.
      required:
        - id
        - key
        - value
        - dimension_id
        - definition_id
    BankTransactionDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
    ApiLedgerAccountType:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountType'
          description: Type of the account.
        display_name:
          type: string
          description: Display name of the account type.
          example: Asset
    ApiLedgerAccountSubtype:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountSubtype'
        display_name:
          type: string
          description: Display name of the account subtype.
          example: Current Assets
    TaxName:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'Tax_Name'.
          example: Tax_Name
        name:
          type: string
          description: Name of the ledger account.
          example: CALIFORNIA_VAT
      required:
        - name
    SignedAmount:
      type: integer
      format: int64
    ApiCustomerData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the customer.
        external_id:
          type: string
          description: >-
            Unique ID of the customer in your system for linking purposes.
            **Idempotency key**.
          example: '31415926535'
        individual_name:
          type: string
          nullable: true
          description: >-
            Full name of the individual customer or contact at a corporate
            customer.
        company_name:
          type: string
          nullable: true
          description: Name of the company customer.
        email:
          type: string
          nullable: true
          description: Email address of the customer.
        mobile_phone:
          type: string
          nullable: true
          description: Mobile phone number of the customer.
        office_phone:
          type: string
          nullable: true
          description: Office phone number of the customer.
        address_string:
          type: string
          nullable: true
          description: Address of the customer.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the customer (for
            example, to display to end users).
        status:
          type: string
          description: 'Status of the customer. Possible values: `ACTIVE`, `ARCHIVED`.'
          example: ACTIVE
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
    LedgerAccountType:
      type: string
      enum:
        - ASSET
        - LIABILITY
        - EQUITY
        - REVENUE
        - EXPENSE
    LedgerAccountSubtype:
      type: string
      enum:
        - BANK_ACCOUNTS
        - ACCOUNTS_RECEIVABLE
        - INVENTORY
        - PAYMENT_PROCESSOR_CLEARING_ACCOUNT
        - FIXED_ASSET
        - ACCUMULATED_DEPRECIATION
        - CASH
        - UNDEPOSITED_FUNDS
        - CURRENT_ASSET
        - NON_CURRENT_ASSET
        - PREPAID_EXPENSES
        - DEVELOPMENT_COSTS
        - LOANS_RECEIVABLE
        - INTANGIBLE_ASSET
        - ACCOUNTS_PAYABLE
        - CREDIT_CARD
        - TAXES_PAYABLE
        - INCOME_TAXES_PAYABLE
        - SALES_TAXES_PAYABLE
        - OTHER_TAXES_PAYABLE
        - PAYROLL_TAXES_PAYABLE
        - UNEARNED_REVENUE
        - PAYROLL_LIABILITY
        - PAYROLL_CLEARING
        - LINE_OF_CREDIT
        - TIPS
        - REFUND_LIABILITIES
        - UNDEPOSITED_OUTFLOWS
        - OUTGOING_PAYMENT_CLEARING_ACCOUNT
        - OTHER_CURRENT_LIABILITY
        - LOANS_PAYABLE
        - NOTES_PAYABLE
        - SHAREHOLDER_LOAN
        - NON_CURRENT_LIABILITY
        - CONTRIBUTIONS
        - DISTRIBUTIONS
        - COMMON_STOCK
        - PREFERRED_STOCK
        - ADDITIONAL_PAID_IN_CAPITAL
        - RETAINED_EARNINGS
        - ACCUMULATED_ADJUSTMENTS
        - OPENING_BALANCE_EQUITY
        - OTHER_EQUITY
        - SALES
        - UNCATEGORIZED_REVENUE
        - RETURNS_ALLOWANCES
        - DIVIDEND_INCOME
        - INTEREST_INCOME
        - OTHER_INCOME
        - COGS
        - OPERATING_EXPENSES
        - PAYROLL
        - TAXES_LICENSES
        - UNCATEGORIZED_EXPENSE
        - CHARITABLE_CONTRIBUTIONS
        - LOAN_EXPENSES
        - FINANCE_COSTS
        - INTEREST_EXPENSES
        - DEPRECIATION
        - AMORTIZATION
        - BAD_DEBT
        - OTHER_EXPENSES
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````