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

# Create expense

> Creates an expense synchronously from a receipt uploaded with `shouldAutoCreateExpense: false` and the given line items. No OCR runs: the fields you send are what is stored. A PDF receipt is kept as-is; JPEG, PNG, HEIC and TIFF receipts are converted to PDF first. The expense is created as a draft for the authenticated user and is included in the next POST /v1/expenses/submit.



## OpenAPI

````yaml /openapi-public.json post /v1/expenses
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/expenses:
    post:
      tags:
        - v1 - Expenses
      summary: Create expense
      description: >-
        Creates an expense synchronously from a receipt uploaded with
        `shouldAutoCreateExpense: false` and the given line items. No OCR runs:
        the fields you send are what is stored. A PDF receipt is kept as-is;
        JPEG, PNG, HEIC and TIFF receipts are converted to PDF first. The
        expense is created as a draft for the authenticated user and is included
        in the next POST /v1/expenses/submit.
      operationId: createExpense
      parameters:
        - name: X-Idempotency-Key
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/ExternalCreateExpenseRequestV1Model'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalExpenseV1Model'
components:
  schemas:
    ExternalCreateExpenseRequestV1Model:
      type: object
      properties:
        receiptDocumentKey:
          type: string
          description: >-
            Key returned by POST /v1/expenses/upload-url called with
            shouldAutoCreateExpense=false, once the file has been uploaded. A
            PDF is attached as-is; JPEG, PNG, HEIC and TIFF files are converted
            to PDF first.
        originalCurrency:
          type: string
          example: USD
        performedDate:
          type: string
          description: >-
            Date the expense was incurred; also the date of the exchange rate
            used when billingAmount is derived
          format: date
        detailedDescription:
          type: string
          description: >-
            Free-text description of the expense as a whole; each line carries
            its own description
          nullable: true
        lineItems:
          type: array
          description: >-
            At least one line. The reimbursement category of a line drives the
            GL account and tax code of the reimbursement.
          items:
            $ref: '#/components/schemas/ExternalCreateExpenseLineItemRequestV1Model'
    ExternalExpenseV1Model:
      type: object
      properties:
        id:
          type: string
          format: uuid
        receiptDocumentKey:
          type: string
        originalCurrency:
          type: string
          example: USD
        billingCurrency:
          type: string
          example: USD
        status:
          type: string
          description: >-
            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          enum:
            - CREATED
            - IN_DRAFT
            - SUBMITTED_FOR_REVIEW
            - CANCELLED
        userId:
          type: string
          format: uuid
        companyId:
          type: string
          format: uuid
        performedDate:
          type: string
          format: date
        detailedDescription:
          type: string
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/ExternalExpenseLineItemV1Model'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ExternalCreateExpenseLineItemRequestV1Model:
      type: object
      properties:
        originalAmount:
          type: integer
          description: Amount in minor units of originalCurrency (e.g. 1250 for 12.50)
          format: int64
        billingAmount:
          type: integer
          description: >-
            Amount in minor units of the user's reimbursement currency.
            Optional: equals originalAmount when the currencies match, otherwise
            derived from the exchange rate of performedDate.
          format: int64
          nullable: true
        description:
          type: string
          description: What the line is for; shown on the expense and on the reimbursement
        reimbursementCategoryId:
          type: string
          description: >-
            Reimbursement category of the line, which decides the GL account and
            tax code on the reimbursement. Must belong to the user's company
            entity.
          format: uuid
      description: >-
        At least one line. The reimbursement category of a line drives the GL
        account and tax code of the reimbursement.
    ExternalExpenseLineItemV1Model:
      type: object
      properties:
        id:
          type: string
          format: uuid
        expenseId:
          type: string
          format: uuid
        originalAmount:
          type: integer
          format: int64
        billingAmount:
          type: integer
          format: int64
        accountId:
          type: string
          format: uuid
        costCenterId:
          type: string
          format: uuid
        description:
          type: string
        reimbursementCategoryId:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Basic authentication header of the form **Basic** **<api_key>**, where
        **<api_key>** is your api key.
      name: Authorization
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````