---
title: "Creates an invoice"
method: POST
path: "/v2/billing/invoices"
tags: ["Billing"]
---

# Creates an invoice

`POST /v2/billing/invoices`

Creates a new invoice for the specified agreement.

The invoice will be created with status PENDING unless the agreement has auto-approve enabled.
If invoice number settings are enabled, a number will be automatically assigned.

## Response `201`

Invoice successfully created

- object — Representation of a ninja billing invoice.
  - `id` integer — Unique identifier of the invoice.
  - `invoiceNumber` string — Invoice number.
  - `client` object — Client information associated with this invoice
    - `id` integer — Unique identifier for the client
    - `name` string — Name of the client
    - `deleted` boolean, required — Indicates if the client has been deleted
  - `status` 'PENDING' | 'APPROVED' | 'COMPLETE' | 'EXPORTING' | 'FAILED' | 'ARCHIVED' — Invoice status.
  - `billingPeriodStartDate` string — Billing period start date.
  - `billingPeriodEndDate` string — Billing period end date.
  - `invoiceDate` string — Invoice date.
  - `dueDate` string — Due date.
  - `subTotal` number — Subtotal amount before discount.
  - `discount` number — Discount amount.
  - `subTotalWithDiscount` number — Subtotal after discount.
  - `taxRate` number — Tax rate applied.
  - `totalTax` number — Total tax amount.
  - `total` number — Total amount including tax.
  - `currency` string — Currency code.
  - `notes` string[] — Invoice notes.
  - `invoiceNote` string — Invoice note field.
  - `interval` string — Billing interval.
  - `errorDescription` string, nullable — Error description if failed.
  - `createTime` string — Created date.
  - `updateTime` string — Last update date.
  - `invoiceGenerationType` 'AUTOMATIC' | 'MANUAL' — Invoice generation type.
  - `billContent` object — Bill content information for invoice.
    - `issuerName` string — Issuer name.
    - `issuerAddress` string — Issuer address.
    - `issuerWebPage` string — Issuer webpage.
    - `issuerPhone` string — Issuer phone.
    - `billName` string — Bill name.
    - `billAddress` string — Bill address.
    - `billEmail` string — Bill email.
    - `billPhone` string — Bill phone.
  - `appUserName` string — App user name who created/modified the invoice.
  - `agreement` object — Basic agreement information.
    - `id` integer — Agreement ID.
    - `name` string — Agreement name.
  - `externalTax` object — External tax information.
    - `id` string
    - `name` string
  - `failureReason` string, nullable — Failure reason if invoice processing failed.
  - `allowOnlineCreditCardPayments` boolean — Whether online credit card payments are allowed.
  - `allowOnlineAchPayments` boolean — Whether online ACH payments are allowed.
  - `hasActiveIntegrationData` boolean — Whether invoice has active integration data.
  - `products` object[] — Invoice products/line items added directly to the invoice.
    - `id` integer — Unique identifier of the invoice product.
    - `productId` integer — Product ID from catalog.
    - `name` string — Product name.
    - `description` string — Description.
    - `price` number — Unit price.
    - `cost` number — Cost.
    - `quantity` number — Quantity.
    - `subTotal` number — Subtotal before discount.
    - `discount` number — Discount amount.
    - `subTotalWithDiscount` number — Subtotal after discount.
    - `taxRate` number — Tax rate applied.
    - `totalTax` number — Total tax amount.
    - `total` number — Total amount including tax.
    - `taxable` boolean — Whether the product is taxable.
    - `billingPeriodStartDate` string — Billing period start date.
    - `billingPeriodEndDate` string — Billing period end date.
    - `accountId` integer — Account ID.
    - `quantityType` string — Quantity type.
    - `createTime` string — Created date.
    - `updateTime` string — Last update date.
    - `agreementProductId` integer — Agreement product ID.
    - `ticketProductId` integer — Ticket product ID.
    - `integrationSettings` object — Integration settings for invoice product.
      - `inheritTaxRateFromAgreement` boolean — Whether to inherit tax rate from agreement.
      - `taxRate` string — Tax rate id from integration
    - `group` boolean — Whether this is a product group.
    - `productIds` integer[] — Product IDs if this is a group.
    - `tax` object, nullable — Snapshot of the tax configuration at the time it was applied to this invoice product.
      - `name` string — Name of the tax configuration.
      - `taxRates` object[] — List of tax rates applied.
        - `name` string — Name of the tax rate.
        - `rate` number — Tax rate value.
        - `compounded` boolean — Whether this rate is compounded on top of previous rates.
  - `agreementProducts` object[] — Invoice products/line items coming from agreements.
    - `id` integer — Unique identifier of the invoice product.
    - `productId` integer — Product ID from catalog.
    - `name` string — Product name.
    - `description` string — Description.
    - `price` number — Unit price.
    - `cost` number — Cost.
    - `quantity` number — Quantity.
    - `subTotal` number — Subtotal before discount.
    - `discount` number — Discount amount.
    - `subTotalWithDiscount` number — Subtotal after discount.
    - `taxRate` number — Tax rate applied.
    - `totalTax` number — Total tax amount.
    - `total` number — Total amount including tax.
    - `taxable` boolean — Whether the product is taxable.
    - `billingPeriodStartDate` string — Billing period start date.
    - `billingPeriodEndDate` string — Billing period end date.
    - `accountId` integer — Account ID.
    - `quantityType` string — Quantity type.
    - `createTime` string — Created date.
    - `updateTime` string — Last update date.
    - `agreementProductId` integer — Agreement product ID.
    - `ticketProductId` integer — Ticket product ID.
    - `integrationSettings` object — Integration settings for invoice product.
      - `inheritTaxRateFromAgreement` boolean — Whether to inherit tax rate from agreement.
      - `taxRate` string — Tax rate id from integration
    - `group` boolean — Whether this is a product group.
    - `productIds` integer[] — Product IDs if this is a group.
    - `tax` object, nullable — Snapshot of the tax configuration at the time it was applied to this invoice product.
      - `name` string — Name of the tax configuration.
      - `taxRates` object[] — List of tax rates applied.
        - `name` string — Name of the tax rate.
        - `rate` number — Tax rate value.
        - `compounded` boolean — Whether this rate is compounded on top of previous rates.
  - `ticketProducts` object[] — Invoice products/line items coming from tickets.
    - `id` integer — Unique identifier of the invoice product.
    - `productId` integer — Product ID from catalog.
    - `name` string — Product name.
    - `description` string — Description.
    - `price` number — Unit price.
    - `cost` number — Cost.
    - `quantity` number — Quantity.
    - `subTotal` number — Subtotal before discount.
    - `discount` number — Discount amount.
    - `subTotalWithDiscount` number — Subtotal after discount.
    - `taxRate` number — Tax rate applied.
    - `totalTax` number — Total tax amount.
    - `total` number — Total amount including tax.
    - `taxable` boolean — Whether the product is taxable.
    - `billingPeriodStartDate` string — Billing period start date.
    - `billingPeriodEndDate` string — Billing period end date.
    - `accountId` integer — Account ID.
    - `quantityType` string — Quantity type.
    - `createTime` string — Created date.
    - `updateTime` string — Last update date.
    - `agreementProductId` integer — Agreement product ID.
    - `ticketProductId` integer — Ticket product ID.
    - `integrationSettings` object — Integration settings for invoice product.
      - `inheritTaxRateFromAgreement` boolean — Whether to inherit tax rate from agreement.
      - `taxRate` string — Tax rate id from integration
    - `group` boolean — Whether this is a product group.
    - `productIds` integer[] — Product IDs if this is a group.
    - `tax` object, nullable — Snapshot of the tax configuration at the time it was applied to this invoice product.
      - `name` string — Name of the tax configuration.
      - `taxRates` object[] — List of tax rates applied.
        - `name` string — Name of the tax rate.
        - `rate` number — Tax rate value.
        - `compounded` boolean — Whether this rate is compounded on top of previous rates.
  - `tax` object, nullable — Snapshot of the tax configuration at the time it was applied to this invoice product.
    - `name` string — Name of the tax configuration.
    - `taxRates` object[] — List of tax rates applied.
      - `name` string — Name of the tax rate.
      - `rate` number — Tax rate value.
      - `compounded` boolean — Whether this rate is compounded on top of previous rates.
  - `deleted` boolean — Whether the invoice is deleted.

## Other responses

- `204` — No charges were found, so no invoice was generated. Your billing period has been advanced.
- `400` — Bad Request - Validation error
- `403` — Forbidden - Insufficient permissions
- `404` — Not found - Agreement does not exist
- `409` — Conflict - Invoice number already exists (if auto-numbering is enabled)

---

[API](https://skmtc.net/ninjarmm/apis/ninjaone-public-api-2-0.md) · [All operations](https://skmtc.net/ninjarmm/apis/ninjaone-public-api-2-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ninjarmm/ninjaone-public-api-2-0/versions/753f26d46650/schema)
