# Invoices

Users can create Invoices in a Kantata OX project.  An Invoice must have at least one line item (a time entry,
expense, fixed fee item, or additional item).  By default, the recipient of an invoice is the primary client
in the project.  Manual formatting options are available to define the format and information that should be displayed on an
invoice.

Invoices can only be created and viewed by participants with financial permission in a project.

## Fetching a list of Invoices

 - [GET /invoices](https://developer.kantata.com/kantata/specification/invoices/get-invoices.md): This endpoint returns structured Invoice objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the invoices top-level JSON key.
Please see our Response Format section for more information.

## Creating a new Invoice

 - [POST /invoices](https://developer.kantata.com/kantata/specification/invoices/create-invoice.md): This endpoint returns structured Invoice objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the invoices top-level JSON key.
Please see our Response Format section for more information.

## Retrieve the next available invoice number.

 - [GET /invoices/next_invoice_number](https://developer.kantata.com/kantata/specification/invoices/get-next-invoice-number.md)

## Fetching a single Invoice

 - [GET /invoices/{id}](https://developer.kantata.com/kantata/specification/invoices/get-invoice.md): This endpoint returns structured Invoice objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the invoices top-level JSON key.
Please see our Response Format section for more information.

## Updating an existing Invoice

 - [PUT /invoices/{id}](https://developer.kantata.com/kantata/specification/invoices/update-invoice.md): This endpoint returns structured Invoice objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the invoices top-level JSON key.
Please see our Response Format section for more information.

## Deleting an existing Invoice

 - [DELETE /invoices/{id}](https://developer.kantata.com/kantata/specification/invoices/delete-invoice.md): You can delete draft invoices with this endpoint. Active invoices cannot be
deleted. They must be cancelled instead.


The response will contain no content and an HTTP 204 status code if the request was
successful, or a standard Kantata OX error message explaining why the object could not be deleted.

## Cancel an existing invoice.

 - [PUT /invoices/{id}/cancel](https://developer.kantata.com/kantata/specification/invoices/cancel-invoice.md): You can cancel active invoices with this endpoint.

This endpoint returns structured Invoice objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the invoices top-level JSON key.
Please see our Response Format section for more information.

