# Sales Invoices

Operations related to Sales Invoice entity from the Property Management System (PMS), including retrieval, creation, updating, and deletion of sales invoices. This API provides endpoints to manage sales invoices, which are essential for tracking sales transactions, generating financial reports, and ensuring accurate billing. The operations include retrieving a list of all sales invoices, fetching details of a specific invoice, creating new invoices, updating existing invoices, and marking invoices as posted or exported to external finance systems. These functionalities help in maintaining the financial integrity and operational efficiency of the PMS.

## Retrieve a list of all invoices

 - [GET /api/v3/salesInvoices](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/findsalesinvoices.md): Fetch a list of all sales invoices within the Property Management System (PMS). This endpoint is useful for retrieving detailed information about sales transactions, including invoice dates, associated organizations, and statuses. The response includes paginated results of sales invoices, which can be filtered by date range, organization ID, and status. If no invoices match the specified criteria, an empty list will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Create a single invoice

 - [POST /api/v3/salesInvoices](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/createsalesinvoice.md): Create a new sales invoice within the Property Management System (PMS). This endpoint allows you to create a new sales invoice by providing the necessary invoice details in the request body. The invoice will be created with a 'DRAFT' status by default and can be updated or posted later. This operation requires authentication and will associate the created invoice with the authenticated user. The request body should include invoice details such as organization ID, invoice date, line items, and other relevant information. Upon successful creation, the response will contain the complete invoice details including the assigned invoice ID. In case of an unexpected system error during creation, a 500 Internal Server Error will be triggered.

## Retrieve a single invoice item

 - [GET /api/v3/salesInvoices/salesInvoiceItems/{id}](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/findinvoiceitem.md): Fetch detailed information about a specific sales invoice item within the Property Management System (PMS) using its unique ID. Sales invoice items are essential for tracking individual components of sales transactions, including item descriptions, quantities, and prices. This endpoint is useful for retrieving item-specific data for reporting, auditing, and financial analysis. If the specified sales invoice item ID does not exist, a 404 Not Found error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Retrieve a single invoice

 - [GET /api/v3/salesInvoices/{id}](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/findinvoice.md): Fetch detailed information about a specific sales invoice within the Property Management System (PMS) using its unique ID. Sales invoices are essential for tracking sales transactions, generating financial reports, and ensuring accurate billing. This endpoint is useful for retrieving invoice-specific data for reporting, auditing, and financial analysis. The response includes details about the sales invoice, including its date, associated organization, status, and line items. If the specified sales invoice ID does not exist, a 404 Not Found error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Get custom fields for a sales invoices

 - [GET /api/v3/salesInvoices/{id}/customFields](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/getcustomfieldsforsalesinvoice.md): Retrieve all custom fields associated with a specific sales invoice record in the finance module of the PMS. The response includes a list of custom fields, each containing details such as field name, type, and value. This endpoint is useful for accessing additional information stored in custom fields that are not part of the standard sales invoice attributes.

## Retrieve a Invoice PDF for a single invoice

 - [GET /api/v3/salesInvoices/{id}/download](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/extractinvoicedocument.md): Fetch a PDF for the Invoice for a sales invoice. The request will specify the invoice id to extract PDF required

## Update an invoice to a given status in relation to an external finance system

 - [PATCH /api/v3/salesInvoices/{id}/exportStatus](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/updatesalesinvoiceexportstatus.md): Update the external identifier record linked to a specific sales invoice; the updateable fields are export status, external ID and exported date time. This operation is essential for synchronizing the invoice export status with external financial systems, ensuring that the invoice export status is maintained in line with the integrated external system. The request body should include the external ID, export status and the exported date. Note: if the export status is already EXPORTED, then no update will be performed, instead, an exception will be thrown. If the specified sales invoice ID does not exist, a 404 Not Found error will be returned. If the invoice is not in the 'POSTED' status, a 400 Bad Request error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Update an invoice as Exported to an external finance system

 - [PATCH /api/v3/salesInvoices/{id}/exported](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/markasexported.md): Mark a specific sales invoice as exported to an external finance system using its unique ID. This operation is essential for synchronizing the invoice status with external financial systems, ensuring that the invoice is recognized as exported. The request body should include the external ID and the exported date. If the specified sales invoice ID does not exist, a 404 Not Found error will be returned. If the invoice is not in the 'POSTED' status, a 400 Bad Request error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Post invoice to ledgers

 - [POST /api/v3/salesInvoices/{id}/post](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/marksalesinvoiceposted.md): Mark a specific sales invoice as posted using its unique ID. This operation is essential for updating the invoice status to 'POSTED', indicating that the invoice has been finalized and is ready for further processing. If the specified sales invoice ID does not exist, a 404 Not Found error will be returned. If the invoice is already in the 'POSTED' status, a 400 Bad Request error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

## Retrieve all sales invoice items for a specific invoice

 - [GET /api/v3/salesInvoices/{id}/salesInvoiceItems](https://apidocs.resharmonics.com/apis/resharmonics-pms/sales-invoices/findinvoiceitems.md): Fetch all sales invoice items associated with a specific sales invoice using its unique ID. This endpoint is useful for retrieving detailed information about the items within a sales invoice, including item descriptions, quantities, and prices. If the specified sales invoice ID does not exist, a 404 Not Found error will be returned. In case of an unexpected system error, a 500 Internal Server Error will be triggered.

