Create Purchase Invoice for a Purchase Order: /purchase-orders/{purchase_order_id}/purchase-invoices
Purpose
This API creates a new purchase invoice associated with an existing purchase order. It enables businesses to generate invoices for goods or services received, define billing dates, and capture key financial details such as currency, totals, and optional custom attributes. This endpoint ensures that invoices are generated accurately and tied directly to the correct purchase order.
Use Case
This endpoint is used when vendors deliver goods or complete services for a purchase order, and the finance or procurement team needs to create an official purchase invoice linked to that order. It supports workflows such as defining issue and due dates, recording monetary totals, and adding custom attributes like internal notes or vendor-specific metadata. By integrating invoice creation directly with purchase orders, organizations streamline the procurement-to-payment process, ensuring invoices are properly tracked, validated, and aligned with supplier transactions.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_order_id | String | Unique identifier of the purchase order for which the purchase invoice is being created. |
Query Parameters
This endpoint does not have any query parameters.
Request Body
{
"purchase_invoice": {
"issue_date": "invoice_issue_date",
"due_date": "invoice_due_date",
"purchase_order_note": "optional_note",
"custom_attributes": [
{
"name": "attribute_name",
"value": "attribute_value"
}
]
}
}
| Attribute | Type | Description |
|---|---|---|
| purchase_invoice | Object | Root object containing details of the new purchase invoice. |
| issue_date | String | Date the invoice is issued (format: YYYY-MM-DD). |
| due_date | String | Date the invoice is due for payment (format: YYYY-MM-DD). |
| purchase_order_note | String | Optional note or remark associated with the purchase order invoice. |
| custom_attributes | Array | Optional list of custom attributes for additional metadata. |
| name | String | Name of the custom attribute. |
| value | String | Value of the custom attribute. |
Response
Upon successful creation, the API returns a detailed purchase invoice object containing all relevant metadata and financial information. This includes invoice identifiers, status, currency details, issue and due dates, subtotal, tax, total amount, and the associated purchase order ID. Line items are provided with granular details such as subtotals, totals, tax values, accounting codes, item quantities, and warehouse allocations. KPIs summarize financial tracking metrics including outstanding balances, overdue amounts, and payment application. Metadata such as creator, timestamps, versioning, and custom attributes are also included. The response confirms that the invoice has been successfully generated, linked to the original purchase order, and recorded in the accounting system for further processing and payment tracking.
Response Body
{
"purchase_invoice": {
"status": "status",
"id": "invoice_id",
"origin": "",
"custom_form": {
"uuid": "form_uuid",
"name": "form_name"
},
"currency": {
"id": "currency_id",
"name": "currency_name",
"link": {
"rel": "self",
"href": "currency_api_link"
}
},
"issue_date": "issue_date",
"alternate_issue_date": "alternate_issue_date",
"due_date": "due_date",
"alternate_due_date": "alternate_due_date",
"subtotal": "subtotal_amount",
"tax": "tax_amount",
"total": "total_amount",
"price_tax_inclusive": "true_or_false",
"account_id": "account_id",
"purchase_order_id": "purchase_order_id",
"created_by": "creator_name",
"created_on": "creation_timestamp",
"last_updated_by": "last_updated_by",
"last_updated_on": "last_updated_on",
"uuid": "invoice_uuid",
"version": "version_number",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "line_subtotal",
"total": "line_total",
"tax": "line_tax",
"accounting_code": "accounting_code",
"item_uuid": "item_uuid",
"item_purchase_order_quantity": "item_quantity",
"item_uom": "unit_of_measure",
"item_warehouse": "warehouse_name",
"uuid": "line_uuid",
"version": "line_version"
}
],
"kpis": {
"outstanding": "outstanding_amount",
"overdue": "overdue_amount",
"last_payment_date": "last_payment_date",
"payment_applied": "applied_payment_amount",
"credit_applied": "applied_credit_amount",
"credit_issued": "issued_credit_amount",
"last_reactivated_on": "last_reactivated_timestamp",
"last_cancelled_on": "last_cancelled_timestamp",
"last_amended_on": "last_amended_timestamp",
"voided_on": "voided_timestamp",
"deleted_on": "deleted_timestamp"
}
}
}
| Attribute | Type | Description |
|---|---|---|
| purchase_invoice | Object | Root object containing full details of the created purchase invoice. |
| status | String | Current status of the purchase invoice (example: ACTIVE). |
| id | String | Unique system-generated purchase invoice ID. |
| origin | String | Indicates the source or origin of the purchase invoice, if applicable. |
| custom_form | Object | Contains metadata about the custom form used for this invoice. |
| uuid | String | UUID of the form associated with the purchase invoice. |
| name | String | Name of the associated custom form. |
| currency | Object | Information about the currency used in the invoice. |
| id | String | Unique ID of the currency. |
| name | String | Name of the currency (example: AUD). |
| link | Object | API link to currency details. |
| issue_date | String | Date when the invoice was issued. |
| alternate_issue_date | String | Alternate issue date for billing alignment. |
| due_date | String | Date when payment for the invoice is due. |
| alternate_due_date | String | Alternate due date, if applicable. |
| subtotal | String | Subtotal amount before taxes. |
| tax | String | Tax amount applied to the invoice. |
| total | String | Total invoice amount after taxes. |
| price_tax_inclusive | Boolean | Indicates whether prices include tax (true or false). |
| account_id | String | Identifier of the account associated with this invoice. |
| purchase_order_id | String | Identifier of the linked purchase order. |
| created_by | String | User who created the purchase invoice. |
| created_on | String | Timestamp when the invoice was created. |
| last_updated_by | String | Name of the user who last updated the invoice. |
| last_updated_on | String | Timestamp of the last invoice update. |
| uuid | String | Unique system UUID for the purchase invoice. |
| version | String | Version number of the purchase invoice record. |
| lines | Array | List of line items associated with the purchase invoice. |
| subtotal | String | Subtotal for the line item. |
| total | String | Total for the line item after taxes. |
| tax | String | Tax amount for the line item. |
| accounting_code | String | Accounting code used for the item. |
| item_uuid | String | UUID of the purchased item. |
| item_purchase_order_quantity | String | Quantity of the item in the purchase order. |
| item_uom | String | Unit of measurement for the item. |
| item_warehouse | String | Name of the warehouse associated with the item. |
| uuid | String | Unique identifier for the line record. |
| version | String | Version of the line record. |
| kpis | Object | Key performance indicators related to the purchase invoice. |
| outstanding | Number | Outstanding payment amount. |
| overdue | Number | Amount overdue for payment. |
| last_payment_date | String | Date of the last payment. |
| payment_applied | Number | Amount of payment applied to this invoice. |
| credit_applied | Number | Credit amount applied to this invoice. |
| credit_issued | String | Total credit issued. |
| last_reactivated_on | String | Timestamp when the invoice was last reactivated. |
| last_cancelled_on | String | Timestamp when the invoice was last cancelled. |
| last_amended_on | String | Timestamp when the invoice was last amended. |
| voided_on | String | Timestamp when the invoice was voided. |
| deleted_on | String | Timestamp when the invoice was deleted. |
Create Purchase Invoice Note: /purchase-invoices/{purchase_invoice_id}/notes
Purpose
This API is used to create a new note for a specific purchase invoice. Notes can include textual content and optionally one or more attached files (such as documents, images, or receipts). This allows for richer record-keeping, collaboration, and audit tracking against purchase invoices.
Use Case
- Attach internal comments, remarks, or explanations to a purchase invoice.
- Add supporting documents (e.g., scanned receipts, invoices, or approvals).
- Maintain a chronological audit trail of discussions and actions tied to the invoice.
- Enable collaboration between finance, procurement, and auditing teams.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice to which the note will be added. |
Query Parameters
No query parameters required for this endpoint.
Request Body
Format: multipart/form-data
| Attribute | Type | Description |
|---|---|---|
| note | string | Content of the note. |
| file | file | File to attach with the note. Accepts common document and image formats. Optional if only text is required |
Response
On success, the API returns a JSON object containing the purchase-invoice object with a notes property. The notes object provides the UUID of the newly created note, which can later be used to retrieve, update, or delete that note. This ensures each note is uniquely identifiable for tracking and reference.
Response Body
{
"purchase-invoice": {
"notes": {
"uuid": "NOTE_UUID"
}
}
}
| Attribute | Type | Description |
|---|---|---|
| purchase-invoice | object | Root object representing the purchase invoice. |
| notes | object | Container for the note metadata. |
| uuid | string (UUID) | Unique identifier of the newly created note. |
Cancel Purchase Invoice: /purchase-invoices/{purchase_invoice_id}/cancel
Purpose
This API is used to cancel an existing purchase invoice within the system. It allows users to mark an invoice as canceled when it is no longer valid due to a change in transaction, duplicate entry, or correction of billing errors. Once canceled, the purchase invoice will not be processed further for payment or reporting but will remain in the system for audit and record-keeping purposes.
Use Case
A finance or accounts payable officer can use this API to cancel a purchase invoice when a supplier withdraws an issued invoice, an incorrect invoice was generated, or goods or services associated with the invoice have been returned. This helps maintain accurate financial records and prevents payment of invalid or duplicate invoices.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | Unique identifier of the purchase invoice to be canceled. |
Query Parameters
This endpoint does not have any query parameters.
Request Body
{
"purchase-invoice": {
"effective_date": "effective_date"
}
}
| Attribute | Type | Description |
|---|---|---|
| purchase-invoice | Object | Root object containing cancellation details of the purchase invoice. |
| effective_date | String | The effective date on which the purchase invoice cancellation should take place (format: YYYY-MM-DD). |
Response
If the request is successful, the API returns a 202 Accepted response, indicating that the purchase invoice cancellation request has been received and is being processed asynchronously. The response body includes a unique event UUID, which can be used to track the progress or status of the cancellation event. This ensures that users can verify that the invoice cancellation was properly initiated within the system and completed through background processing.
Response Body
{
"event_uuid": "event_uuid"
}
| Attribute | Type | Description |
|---|---|---|
| event_uuid | String | Unique identifier of the event triggered for the purchase invoice cancellation process. |
Reactivate Purchase Invoice: /purchase-invoices/{purchase_invoice_id}/reactivate
Purpose
This API is used to reactivate a previously canceled or inactive purchase invoice. It allows users to restore an invoice to an active state when the cancellation was made in error or when the invoice becomes valid again due to a change in business circumstances. Reactivating a purchase invoice ensures that it can once again participate in payment processing, reporting, and accounting operations.
Use Case
A finance or accounts payable officer can use this API to reactivate a purchase invoice if a cancellation request was issued incorrectly or if the supplier has revalidated the invoice after dispute resolution. This action restores the invoice’s lifecycle, enabling it to be paid, amended, or used in financial reconciliations.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | Unique identifier of the purchase invoice to be canceled. |
Query Parameters
This endpoint does not have any query parameters.
Request Body
{
"purchase-invoice": {
"effective_date": "effective_date"
}
}
| Attribute | Type | Description |
|---|---|---|
| purchase-invoice | Object | Root object containing details required to reactivate the purchase invoice. |
| effective_date | String | The effective date on which the reactivation of the purchase invoice takes place (format: YYYY-MM-DD). |
Response
If the request is successful, the API returns a 202 Accepted response, confirming that the purchase invoice reactivation request has been received and is being processed asynchronously. The response body includes a unique event UUID, which can be used to track the progress or completion of the reactivation event. This ensures that the invoice’s active status can be verified through subsequent event or status queries in the system.
Response Body
{
"event_uuid": "event_uuid"
}
| Attribute | Type | Description |
|---|---|---|
| event_uuid | String | Unique identifier of the event triggered for the purchase invoice reactivation process. |
Upload Files to a Purchase Invoice Note: /purchase-invoices/{id}/notes/{uuid}/files
Purpose
Upload one or more files to an existing note on a purchase invoice, with the ability to update the note content simultaneously. This endpoint accepts multipart form-data, allowing consumers to attach multiple files in a single request by repeating the file field. The optional note field can be used to update the text content of the note at the same time as the file upload, eliminating the need for a separate PATCH call. This is particularly useful for workflows where supporting documentation and contextual annotations need to be added together as part of an invoice processing step.
Use Case
This endpoint allows you to attach supporting documents such as invoices, receipts, and contracts to an invoice note. It supports uploading multiple files in a single request to an existing note, and can also update the note content while attaching new files. Common use cases include attaching scanned copies of physical invoices, delivery confirmation documents, or approval sign-off records as part of the accounts payable workflow. Collaboration teams use this endpoint to consolidate evidence and documentation onto a single note, creating a centralized reference point for all stakeholders reviewing the invoice. It also supports automated document collection scenarios where an integration system gathers files from multiple sources and uploads them in bulk to the appropriate invoice note for audit readiness.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique ID of the purchase invoice (e.g., PI-5Q22OS-0032) |
| note_uuid | String (UUID) | The UUID of the note to upload files to |
Query Parameters
No query parameters required.
Request Body (form-data)
| Field | Type | Description |
|---|---|---|
| note | String | Updated note content text |
| file | File | File to upload (multiple files supported) |
Request Attributes
| Attribute | Type | Description |
|---|---|---|
| note | String | The text content to set or update on the note |
| file | Binary | The file(s) to attach. Multiple files can be uploaded by repeating the file field |
Response
Returns the updated note object with the newly attached files and refreshed metadata. The response includes the note's UUID, updated content (reflecting any changes passed in the note field), and the complete files array containing both previously existing and newly uploaded files, each with their UUID, name, and version. The last_updated_by and last_updated_on fields are updated to reflect the user who performed the upload and the timestamp of the operation, while created_by and created_on retain the original note creation details. The version field is incremented to reflect the modification, supporting optimistic concurrency control for subsequent updates to the same note.
Response Body
{
"uuid": "NOTE_UUID",
"content": "NOTE_CONTENT",
"files": [
{
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "FILE_VERSION"
}
],
"created_by": "CREATED_BY_USER",
"created_on": "CREATED_ON_DATETIME",
"last_updated_by": "LAST_UPDATED_BY_USER",
"last_updated_on": "LAST_UPDATED_ON_DATETIME",
"version": "NOTE_VERSION",
"watcherList": {
"internal_watchers": [],
"external_watchers": []
},
"custom_attributes": []
}
| Attribute | Type | Description |
|---|---|---|
| uuid | String (UUID) | UUID of the note |
| content | String | Updated note content |
| files | Array | List of files now attached to the note |
| files[].uuid | String (UUID) | UUID of the attached file |
| files[].name | String | Name/identifier of the attached file |
| files[].version | String | Version number of the file |
| created_by | String | Username of the original note creator |
| created_on | String (ISO 8601) | Timestamp when the note was originally created |
| last_updated_by | String | Username of the user who uploaded the files |
| last_updated_on | String (ISO 8601) | Timestamp of the file upload |
| version | String | Updated version number of the note |
| watcherList | Object | Internal and external watchers for the note |
| custom_attributes | Array | Custom attributes for the note |
Create a Purchase Invoice: /purchase-invoices
Purpose
Create a new purchase invoice in the system. A purchase invoice represents a bill received from a supplier for goods or services, and serves as the basis for tracking payables, managing payment schedules, and reconciling supplier accounts. This endpoint accepts the full invoice payload including header-level fields such as dates, currency, and account reference, as well as one or more line items with pricing, quantity, tax, and accounting code details. Upon successful creation, the system returns the complete invoice object with generated identifiers, computed financial totals, and initialized KPI metrics.
Use Case
This endpoint is used to record a new purchase invoice against a supplier account. It is commonly used in accounts payable workflows to capture incoming supplier bills, either manually entered or imported from external systems. Procurement teams use this endpoint after receiving goods or services to create the corresponding invoice that triggers the payment process. It supports integration scenarios where an ERP or document management system extracts invoice data from scanned documents or electronic invoices and submits them programmatically. The endpoint also supports linking the invoice to an existing purchase order via the purchaseOrderId field, enabling three-way matching between the purchase order, item receipt, and invoice. Finance teams rely on the returned KPI fields to immediately assess the outstanding and overdue status of the newly created invoice within the context of the supplier relationship.
Path Parameters
No path parameters required.
Query Parameters
No query parameters required.
Request Body
{
"purchaseInvoice": {
"currency": "CURRENCY_CODE",
"issueDate": "ISSUE_DATE",
"alternateIssueDate": "ALTERNATE_ISSUE_DATE",
"dueDate": "DUE_DATE",
"alternateDueDate": "ALTERNATE_DUE_DATE",
"priceTaxInclusive": "TAX_INCLUSIVE_FLAG",
"accountId": "ACCOUNT_ID",
"purchaseOrderId": "PURCHASE_ORDER_ID",
"customAttributes": [],
"customObjects": [],
"lines": [
{
"accountingCode": "ACCOUNTING_CODE",
"itemId": "ITEM_ID",
"itemName": "ITEM_NAME",
"itemQuantity": "ITEM_QUANTITY",
"itemUom": "UNIT_OF_MEASURE",
"itemWarehouse": "WAREHOUSE",
"itemPriceSnapshot": {
"pricingRule": {
"priceType": "PRICE_TYPE",
"price": "UNIT_PRICE",
"uom": "UNIT_OF_MEASURE"
}
},
"itemPriceTax": {
"code": "TAX_CODE",
"rate": "TAX_RATE"
},
"priceTaxExampt": "TAX_EXEMPT_FLAG"
}
]
}
}
