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

# Create a draft invoice

> Creates a new invoice in draft status for a customer.



## OpenAPI

````yaml post /v1/invoices
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/invoices:
    post:
      tags:
        - Invoices
      summary: Create a draft invoice
      description: Creates a new invoice in draft status for a customer.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customerId:
                  type: string
                  minLength: 1
                currency:
                  type: string
                  minLength: 3
                  maxLength: 3
                  default: USD
                dueDate:
                  type: string
                  format: date-time
                idempotencyKey:
                  type: string
              required:
                - customerId
      responses:
        '201':
          description: Draft invoice created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  success:
                    type: boolean
                required:
                  - id
                  - success
        '400':
          description: Validation error

````