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

# Create standalone invoice

> Create a one-off invoice for a customer without a subscription.



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml post /invoices
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /invoices:
    post:
      tags:
        - Invoices
      summary: Create standalone invoice
      description: Create a one-off invoice for a customer without a subscription.
      operationId: createInvoice
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceCreateInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InvoiceCreateInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/InvoiceCreateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInvoiceResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
components:
  schemas:
    InvoiceCreateInput:
      type: object
      description: Input serializer for POST /api/v2/invoices.
      properties:
        customer_id:
          type: string
          format: uuid
          description: >-
            The unique identifier of the customer to whom the invoice is being
            sent
        due_at:
          type: string
          format: date
          description: The date on which the invoice is due
        issued_at:
          type: string
          format: date
          nullable: true
          description: The date on which this invoice was issued. Defaults to today.
        currency:
          enum:
            - USD
            - EUR
            - GBP
            - AUD
            - CAD
            - INR
          type: string
          x-spec-enum-id: fde863feba7c4cf4
          description: |-
            Optional currency to be used for the subscription. Defaults to USD.

            * `USD` - United States Dollar
            * `EUR` - Euros
            * `GBP` - Great British Pound
            * `AUD` - Australian Dollar
            * `CAD` - Canadian Dollar
            * `INR` - Indian Rupee
        invoice_memo:
          type: string
          description: Optional memo or notes to be included on the invoice
          maxLength: 2000
        purchase_order:
          type: string
          description: Optional purchase order number to be included on the invoice
        line_items:
          type: string
          description: The line items to be included on the invoice
        accounts_payable_emails:
          type: array
          items:
            type: string
            format: email
          description: List of accounts payable contact emails for the invoice
        send_invoice:
          type: boolean
          default: false
          description: Whether to send the invoice to the customer after creating it
        pdf_attachments:
          type: array
          items:
            type: string
            format: uri
          description: PDF files to attach to the invoice
        pdf_attachments_config:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            Configuration for managing attachments. Each item specifies a new
            file to add (by new_file_index) or a terms document to attach (by
            terms_document_id). The order in this array determines the unified
            order of attachments in the PDF. If omitted, pdf_attachments are
            attached in upload order.
        charge_timing:
          enum:
            - ISSUE_DATE
            - DUE_DATE
            - ORDER_FORM_ONLY_DUE_DATE
            - ''
            - null
          type: string
          x-spec-enum-id: 1a657242dec3e169
          nullable: true
          description: >-
            ('Decides wether to charge when this invoice is issued or when it is
            due if auto-pay is enabled. ', 'ISSUE_DATE - Charge when the invoice
            is issued. ', 'DUE_DATE - Charge when the invoice is due if auto-pay
            is enabled.')


            * `ISSUE_DATE` - Charge on issue date

            * `DUE_DATE` - Charge on due date

            * `ORDER_FORM_ONLY_DUE_DATE` - Charge on due date (order form only)
        auto_pay_invoice:
          type: boolean
          default: false
          description: >-
            ('Whether to enable auto pay when the invoice is generated. This
            gives ability to auto-charge the ', "invoice when there's a saved
            payment method to be used. Defaults to False.")
        dunning_auto_retries:
          type: boolean
          nullable: true
          description: >-
            Whether to enable automatic retries for failed payments. When
            enabled, failed invoice payments will be retried using saved payment
            methods. Defaults to False.
        adjustments:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceAdjustment'
          default: []
          description: Optional adjustments to be included on the invoice
        starts_at:
          type: string
          format: date
          nullable: true
          description: >-
            Optional service period start date. Defaults to today's date if not
            provided.
        ends_at:
          type: string
          format: date
          nullable: true
          description: >-
            Optional service period end date. Defaults to today's date + 1 month
            if not provided.
      required:
        - accounts_payable_emails
        - currency
        - customer_id
        - due_at
        - line_items
    CreateInvoiceResponse:
      type: object
      description: Response serializer for POST /api/v2/invoices.
      properties:
        invoice_id:
          type: string
          format: uuid
          description: The unique identifier of the created invoice
        invoice_number:
          type: string
          description: Short form identifier for the invoice.
        amount:
          type: integer
          description: The total amount to be charged for this invoice.
        currency:
          type: string
          description: The currency in which the invoice is denominated (e.g., USD, EUR).
        status:
          type: string
          description: >
            Current status of the invoice. One of:


            - `MUTED` — Invoice will not be sent. Muted invoices come from
            migration cut-overs or from muting invoices in the product settings.

            - `SCHEDULED` — Scheduled to be issued on a future date.

            - `OUTSTANDING` — Issued and awaiting payment.

            - `DUE` — Payment is due.

            - `PAST_DUE` — Payment is past its due date.

            - `PAID` — Fully paid.

            - `PARTIALLY_PAID` — Partially paid, with a remaining balance.

            - `ADJUSTED` — Adjusted after issuance.

            - `CREDITED` — Settled by applying credit.

            - `UNPAID` — Unpaid.

            - `PAUSED` — Collection is paused.

            - `VOIDED` — Voided and no longer collectible.
        due_at:
          type: string
          format: date-time
          description: The date on which this invoice is expected to be paid by.
      required:
        - amount
        - currency
        - due_at
        - invoice_id
        - invoice_number
        - status
    ErrorResponse:
      type: object
      description: >-
        Standardizes API error responses with a consistent structure containing
        error code and message.
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    InvoiceAdjustment:
      type: object
      properties:
        adjustment:
          type: integer
          minimum: 1
          description: The adjustment credits amount
        memo:
          type: string
          nullable: true
          description: The reason for the adjustment
      required:
        - adjustment
    Error:
      type: object
      description: >-
        Represents individual error details with a standardized code and
        descriptive message.
      properties:
        code:
          enum:
            - ERR_NOT_FOUND
            - ERR_BAD_REQUEST
            - ERR_SERVER_ERROR
          type: string
          x-spec-enum-id: dc5a5d6feae1b697
          description: >-
            Error code indicating the type of error: NOT_FOUND for missing
            resources, BAD_REQUEST for invalid input, SERVER_ERROR for internal
            server issues


            * `ERR_NOT_FOUND` - ERR_NOT_FOUND

            * `ERR_BAD_REQUEST` - ERR_BAD_REQUEST

            * `ERR_SERVER_ERROR` - ERR_SERVER_ERROR
        message:
          type: string
        error_id:
          type: string
          format: uuid
          description: >-
            Correlation handle for SERVER_ERROR responses — quote this when
            contacting support; it joins to the structured server log line for
            the failure. Not present on 4xx responses.
      required:
        - code
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [One-Off Invoices](/documentation/one-off-invoices.md)
- [Creating a Plan](/quickstart-guide/products-plans-bricks/creating-a-plan.md)
- [Adding Team Members](/quickstart-guide/adding-team-members.md)
