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

# Create Sales Invoice

> Create a new sales invoice

```text Plain Signature wrap theme={null}
path=/v1/sales-invoices&token=YOUR_TOKEN&email=john@gmail.com&tenant_id=841eaf97-c428-47d1-9f6d-c61cc9df7bee
```


## OpenAPI

````yaml POST /v1/sales-invoices
openapi: 3.1.0
info:
  title: Accounting+ API
  description: >-
    A comprehensive accounting API that provides endpoints for managing bank
    cash flow vouchers and journal transactions
  version: 1.0.0
servers:
  - url: https://staging-openapi.accountingplus.id
    description: Main API Server
    variables:
      url:
        default: https://staging-openapi.accountingplus.id
        description: The API base URL
security:
  - bearerAuth: []
    signatureKey: []
    dataKey: []
tags:
  - name: Vouchers
    description: Bank cash flow voucher management
  - name: Journals
    description: Journal transaction management
  - name: Purchase Invoices
    description: Purchase invoice management
paths:
  /v1/sales-invoices:
    post:
      tags:
        - Sales Invoices
      summary: Create Sales Invoice
      description: Create a new sales invoice
      requestBody:
        description: Sales invoice details
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSalesInvoiceRequest'
      responses:
        '200':
          description: Sales invoice created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSalesInvoiceResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  traceId:
                    type: string
              examples:
                Invalid Request 1:
                  summary: Invalid tax item
                  value:
                    status: ACC03
                    message: tax item not valid
                    traceId: 123e4567-e89b-12d3-a456-426614174000
                Invalid Request 2:
                  summary: Invalid consumption item
                  value:
                    status: ACC03
                    message: consumption items cannot be used in sales invoice
                    traceId: 123e4567-e89b-12d3-a456-426614174000
                Invalid Request 3:
                  summary: Invalid item
                  value:
                    status: ACC03
                    message: item not valid
                    traceId: 123e4567-e89b-12d3-a456-426614174000
components:
  schemas:
    CreateSalesInvoiceRequest:
      type: object
      required:
        - customer_name
        - document_date
        - items
      properties:
        customer_name:
          type: string
          example: Mira Ramadhani
        document_date:
          type: string
          format: date-time
          example: 20/08/2025
        auto_create_payment:
          type: boolean
          example: true
        other_amount:
          type: number
          example: 0
        items:
          type: array
          items:
            type: object
            properties:
              item_code:
                type: string
              item_name:
                type: string
              quantity:
                type: number
              unit_of_measurement:
                type: string
              unit_price:
                type: number
              discount_amount:
                type: number
              tax_code:
                type: string
          example:
            - item_code: ITM00001
              item_name: Product A
              quantity: 2
              unit_of_measurement: pcs
              unit_price: 3000
              discount_amount: 0
              tax_code: ''
            - item_code: ITM00002
              item_name: Product B
              quantity: 5
              unit_of_measurement: pcs
              unit_price: 1500
              discount_amount: 0
              tax_code: ''
    CreateSalesInvoiceResponse:
      type: object
      properties:
        status:
          type: string
          example: '00'
        message:
          type: string
          example: success
        data:
          type: object
          properties:
            auto_create_payment:
              type: boolean
              example: true
            bank_account_code:
              type: string
              example: '002'
            bank_account_name:
              type: string
              example: Bank
            cancel_reason:
              type: string
              example: '-'
            currency_code:
              type: string
              example: IDR
            currency_name:
              type: string
              example: Rupiah Indonesia
            customer_address:
              type: string
              example: Jl. Raya No. 123
            customer_code:
              type: string
              example: '00005'
            customer_name:
              type: string
              example: Mira Ramadhani
            description:
              type: string
              example: From API Integration id 1754626495
            discount_amount:
              type: number
              example: 0
            document_date:
              type: string
              format: date-time
              example: '2029-07-30T00:00:00Z'
            document_number:
              type: string
              example: 00004/FPJ/07/29
            document_status:
              type: string
              example: Final
            due_date:
              type: string
              format: date-time
              nullable: true
            other_amount:
              type: number
              example: 0
            outstanding_amount:
              type: number
              example: 0
            process_status:
              type: string
              example: Dibayarkan Sepenuhnya
            rounding_amount:
              type: number
              example: 0
            sales_order_document_number:
              type: string
              example: ''
            sales_person_code:
              type: string
              example: ''
            sales_person_name:
              type: string
              example: ''
            sub_total_amount:
              type: number
              example: 13500
            tax_included_indicator:
              type: boolean
              example: false
            total_amount:
              type: number
              example: 13500
            total_tax_amount:
              type: number
              example: 0
            items:
              type: array
              items:
                type: object
                properties:
                  detail_number:
                    type: string
                  discount_amount:
                    type: number
                  document_number:
                    type: string
                  item_code:
                    type: string
                  item_name:
                    type: string
                  quantity:
                    type: number
                  sub_total_amount:
                    type: number
                  tax_code:
                    type: string
                  tax_name:
                    type: string
                  tax_rate:
                    type: number
                  total_amount:
                    type: number
                  total_tax_amount:
                    type: number
                  unit_of_measurement_code:
                    type: string
                  unit_of_measurement_name:
                    type: string
                  unit_price:
                    type: number
              example:
                - detail_number: '00001'
                  discount_amount: 0
                  document_number: 00004/FPJ/07/29
                  item_code: ITM00001
                  item_name: Product A
                  quantity: 2
                  sub_total_amount: 6000
                  tax_code: ''
                  tax_name: ''
                  tax_rate: 0
                  total_amount: 6000
                  total_tax_amount: 0
                  unit_of_measurement_code: PCS01
                  unit_of_measurement_name: pcs
                  unit_price: 3000
                - detail_number: '00002'
                  discount_amount: 0
                  document_number: 00004/FPJ/07/29
                  item_code: '0745114900006'
                  item_name: Product B
                  quantity: 5
                  sub_total_amount: 5000
                  tax_code: ''
                  tax_name: ''
                  tax_rate: 0
                  total_amount: 5000
                  total_tax_amount: 0
                  unit_of_measurement_code: PCS01
                  unit_of_measurement_name: pcs
                  unit_price: 1000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Generate a JWT signed with the `client_secret` and include the
        `client_id` as a claim in its payload.
    signatureKey:
      type: apiKey
      in: header
      name: A-Signature
      description: >-
        Generate the signature by creating an `SHA256-HMAC` hash from the plain
        signature above, using the `signature_secret` as the key. Then,
        `Base64-encode` the resulting hash and place the final value in the
        A-Signature header.
    dataKey:
      type: apiKey
      in: header
      name: A-Data
      description: Include the `email` and `tenant_id` in the payload as Base64 encoded.

````