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

# Create a new sale invoice.



## OpenAPI

````yaml api-reference/openapi.json post /api/sale-invoices
openapi: 3.0.0
info:
  title: Bigcapital
  description: Financial accounting software
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /api/sale-invoices:
    post:
      tags:
        - Sale Invoices
      summary: Create a new sale invoice.
      operationId: SaleInvoicesController_createSaleInvoice
      parameters:
        - name: Authorization
          in: header
          description: >-
            Value must be 'Bearer <token>' where <token> is an API key prefixed
            with 'bc_' or a JWT token.
          required: true
          schema:
            type: string
            example: Bearer bc_1234567890abcdef
        - name: organization-id
          in: header
          description: >-
            Required if Authorization is a JWT token. The organization ID to
            operate within.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSaleInvoiceDto'
      responses:
        '201':
          description: Sale invoice created successfully
components:
  schemas:
    CreateSaleInvoiceDto:
      type: object
      properties:
        customerId:
          type: number
          description: Customer ID
          example: 1
        invoiceDate:
          format: date-time
          type: string
          description: Invoice date
          example: '2023-01-01T00:00:00Z'
        dueDate:
          format: date-time
          type: string
          description: Due date
          example: '2023-01-15T00:00:00Z'
        invoiceNo:
          type: string
          description: Invoice number
          example: INV-001
        referenceNo:
          type: string
          description: Reference number
          example: REF-001
        delivered:
          type: boolean
          description: Whether the invoice is delivered
          default: false
        invoiceMessage:
          type: string
          description: Invoice message
          example: Thank you for your business
        termsConditions:
          type: string
          description: Terms and conditions
          example: Payment due within 14 days
        exchangeRate:
          type: number
          description: Exchange rate
          minimum: 0
          example: 1
        warehouseId:
          type: number
          description: Warehouse ID
          example: 1
        branchId:
          type: number
          description: Branch ID
          example: 1
        projectId:
          type: number
          description: Project ID
          example: 1
        isInclusiveTax:
          type: boolean
          description: Whether tax is inclusive
          example: false
        entries:
          description: Invoice line items
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/ItemEntryDto'
        pdfTemplateId:
          type: number
          description: PDF template ID
          example: 1
        paymentMethods:
          description: Payment methods
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethodDto'
        discount:
          type: number
          description: Discount value
          example: 10
        discountType:
          type: string
          description: Discount type
          enum:
            - percentage
            - amount
          example: percentage
        adjustment:
          type: number
          description: Adjustment amount
          example: 5
        fromEstimateId:
          type: number
          description: ID of the estimate this invoice is created from
          example: 1
        attachments:
          description: The attachments of the sale receipt
          example:
            - key: '123456'
          type: array
          items:
            type: string
      required:
        - customerId
        - invoiceDate
        - dueDate
        - entries
        - attachments
    ItemEntryDto:
      type: object
      properties:
        index:
          type: number
          description: The index of the item entry
          example: 1
        itemId:
          type: number
          description: The id of the item
          example: 1
        rate:
          type: number
          description: The rate of the item entry
          example: 1
        quantity:
          type: number
          description: The quantity of the item entry
          example: 1
        discount:
          type: number
          description: The discount of the item entry
          example: 1
        discountType:
          type: string
          description: The type of the discount
          example: percentage
        description:
          type: string
          description: The description of the item entry
          example: This is a description
        taxCode:
          type: string
          description: The tax code of the item entry
          example: '123456'
        taxRateId:
          type: number
          description: The tax rate id of the item entry
          example: 1
        warehouseId:
          type: number
          description: The warehouse id of the item entry
          example: 1
        projectId:
          type: number
          description: The project id of the item entry
          example: 1
        projectRefId:
          type: number
          description: The project ref id of the item entry
          example: 1
        projectRefType:
          type: string
          description: The project ref type of the item entry
          example: TASK
        projectRefInvoicedAmount:
          type: number
          description: The project ref invoiced amount of the item entry
          example: 100
        sellAccountId:
          type: number
          description: The sell account id of the item entry
          example: 1020
        costAccountId:
          type: number
          description: The cost account id of the item entry
          example: 1021
      required:
        - index
        - itemId
        - rate
        - quantity
        - discount
        - discountType
        - description
        - taxCode
        - taxRateId
        - warehouseId
        - projectId
        - projectRefId
        - projectRefType
        - projectRefInvoicedAmount
        - sellAccountId
        - costAccountId
    PaymentMethodDto:
      type: object
      properties:
        paymentIntegrationId:
          type: number
          description: The ID of the payment integration
          example: 1
        enable:
          type: boolean
          description: Whether the payment method is enabled
          example: true
      required:
        - paymentIntegrationId
        - enable

````