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

# Create an invoice

> Invoices the given charges (all un-invoiced charges when `chargeIds` is omitted), with an optional bill-level discount. Running room meters are billed up to now unless `meterIds` says otherwise.

The admission must be on new billing (`use_new_billing`); otherwise this returns 409. Returns 503 when billing is not configured on the server, and 502 when the billing service fails.



## OpenAPI

````yaml api-reference/doc-tool/ipd-api/ipd-sdk-openapi.json post /ipd/v1/sdk/admissions/{admission_id}/billing/invoices
openapi: 3.1.0
info:
  title: Eka IPD Admission API
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /ipd/v1/sdk/admissions/{admission_id}/billing/invoices:
    post:
      tags:
        - IPD API
      summary: Create an invoice
      description: >-
        Invoices the given charges (all un-invoiced charges when `chargeIds` is
        omitted), with an optional bill-level discount. Running room meters are
        billed up to now unless `meterIds` says otherwise.


        The admission must be on new billing (`use_new_billing`); otherwise this
        returns 409. Returns 503 when billing is not configured on the server,
        and 502 when the billing service fails.
      operationId: IpdSdkCreateAnInvoice
      parameters:
        - name: auth
          in: header
          required: true
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
        - schema:
            minLength: 1
            type: string
          in: path
          name: admission_id
          required: true
          description: Id of the IPD admission.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              properties:
                chargeIds:
                  description: Charges to invoice; omit for every un-invoiced charge.
                  type: array
                  items:
                    type: string
                invoiceDiscount:
                  additionalProperties: false
                  description: Bill-level discount on the whole invoice.
                  type: object
                  required:
                    - type
                    - value
                  properties:
                    type:
                      anyOf:
                        - type: string
                          enum:
                            - amount
                        - type: string
                          enum:
                            - percent
                    value:
                      minimum: 0
                      description: ₹ amount, or percent (0–100).
                      type: number
                    reason:
                      type: string
                policyIds:
                  description: Discount policies to apply.
                  type: array
                  items:
                    type: string
                meterIds:
                  description: >-
                    Running room meters to bill up to now onto this invoice.
                    Omit = all running meters; `[]` = none.
                  type: array
                  items:
                    type: string
                notes:
                  type: string
      responses:
        '201':
          description: >-
            An invoice: `id`, `invoiceNumber`, `status`, `subtotal`,
            `discountTotal`, `taxTotal`, `total`, `amountPaid`, `amountDue`,
            `issuedAt`, …
          content:
            application/json:
              schema:
                additionalProperties: true
                description: >-
                  An invoice: `id`, `invoiceNumber`, `status`, `subtotal`,
                  `discountTotal`, `taxTotal`, `total`, `amountPaid`,
                  `amountDue`, `issuedAt`, …
                example:
                  id: inv-201
                  invoiceNumber: INV-000201
                  status: partly_paid
                  subtotal: '7545.00'
                  discountTotal: '0.00'
                  taxTotal: '0.00'
                  total: '7545.00'
                  amountPaid: '5000.00'
                  amountDue: '2545.00'
                  issuedAt: '2026-10-07T12:00:00.000Z'
                type: object
                properties: {}
        '400':
          description: Bad Request — the request failed validation or was rejected.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: >-
            Not Found — the admission (or the addressed record) does not exist
            in your workspace.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '409':
          description: >-
            Conflict — the admission is not on new billing, or the request
            conflicts with the account's current state.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '502':
          description: Bad Gateway — the billing service failed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '503':
          description: >-
            Service Unavailable — billing or pharmacy notification is not
            configured.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.