Getting Purchase Invoice List
Function: purchase_invoice_list_basic()
Purpose
This SDK function retrieves a list of purchase invoices with full details, including invoice status, identifiers, issue and due dates, currency information, financial amounts, and associated account references. It provides visibility into invoice metadata, line items, and KPIs, making it an essential tool for tracking and managing procurement and financial transactions.
Parameters
This function does not require any input parameters.
Use Case
This function is used to review all active purchase invoices for monitoring financial activity and ensuring compliance with billing terms. It supports workflows such as displaying invoice history in applications, generating financial reports, and validating invoice data during audits. By exposing invoice-level and line-level details, the function enables finance and procurement teams to maintain oversight of outstanding payments and supplier transactions.
def purchase_invoice_list_basic():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.list()
print(response)
# ResponseToObj().process(response=response["purchase_invoices"][0])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceListBasic(){
try {
$response = $this->purchaseInvoiceService->readAll('v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response returns a object containing multiple entries. Each invoice includes metadata such as ID, status, currency, totals, tax inclusivity, account linkage, and creation details. Line items provide granular data including subtotals, totals, tax values, accounting codes, item quantities, and warehouse allocations. KPIs summarize payment status, outstanding balances, overdue amounts, and credit application. Pagination metadata is also included, allowing efficient navigation across large sets of invoices. This structure ensures that users can analyze invoice details comprehensively and integrate them into financial or procurement systems.
PurchaseInvoiceListDTO(
purchaseInvoices=[
PurchaseInvoiceDTO(
status="PURCHASE_INVOICE_STATUS",
id="PURCHASE_INVOICE_ID",
customForm=CustomFormsDTO(
uuid="CUSTOM_FORM_UUID",
name="CUSTOM_FORM_NAME"
),
currency=PurchaseInvoiceCurrencyDTO(
id="CURRENCY_ID",
name="CURRENCY_NAME",
link=CurrencyLinkDTO(
rel="LINK_REL",
href="CURRENCY_LINK"
)
),
issueDate="ISSUE_DATE",
alternateIssueDate="ALT_ISSUE_DATE",
dueDate="DUE_DATE",
alternateDueDate="ALT_DUE_DATE",
subtotal="INVOICE_SUBTOTAL",
tax="INVOICE_TAX",
total="INVOICE_TOTAL",
priceTaxInclusive="BOOLEAN",
accountId="ACCOUNT_ID",
purchaseOrderId="PURCHASE_ORDER_ID",
createdBy="CREATED_BY",
createdOn="CREATED_TIMESTAMP",
lastUpdatedBy="LAST_UPDATED_BY",
lastUpdatedOn="LAST_UPDATED_TIMESTAMP",
uuid="INVOICE_UUID",
version="INVOICE_VERSION",
customAttributes="CUSTOM_ATTRIBUTES",
customObjects="CUSTOM_OBJECTS",
lines=[
PurchaseInvoiceLineDataDTO(
subtotal="LINE_SUBTOTAL",
total="LINE_TOTAL",
tax="LINE_TAX",
accountingCode="ACCOUNTING_CODE",
itemUuid="ITEM_UUID",
itemPurchaseOrderQuantity="ITEM_PO_QUANTITY",
itemUom="ITEM_UOM",
itemWarehouse="ITEM_WAREHOUSE",
uuid="LINE_UUID",
version="LINE_VERSION",
itemId="ITEM_ID",
itemName="ITEM_NAME",
itemQuantity="ITEM_QUANTITY",
itemPriceSnapshot="ITEM_PRICE_SNAPSHOT",
itemPriceTax="ITEM_PRICE_TAX",
priceTaxExampt="BOOLEAN"
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding="KPI_OUTSTANDING",
overdue="KPI_OVERDUE",
lastPaymentDate="LAST_PAYMENT_DATE",
paymentApplied="PAYMENT_APPLIED",
creditApplied="CREDIT_APPLIED",
creditIssued="CREDIT_ISSUED",
lastReactivatedOn="LAST_REACTIVATED",
lastCancelledOn="LAST_CANCELLED",
lastAmendedOn="LAST_AMENDED",
voidedOn="VOIDED_ON",
deletedOn="DELETED_ON"
),
externalBankDetails="EXTERNAL_BANK_DETAILS"
)
],
pagination=PaginationDTO(
records="TOTAL_RECORDS",
limit="PAGE_LIMIT",
offset="PAGE_OFFSET",
previousPage="PREVIOUS_PAGE_URL",
nextPage="NEXT_PAGE_URL"
)
)
{
"purchase_invoices": [
{
"status": "PURCHASE_INVOICE_STATUS",
"id": "PURCHASE_INVOICE_ID",
"origin": "PURCHASE_INVOICE_ORIGIN",
"custom_form": {
"uuid": "CUSTOM_FORM_UUID",
"name": "CUSTOM_FORM_NAME"
},
"currency": {
"id": "CURRENCY_ID",
"name": "CURRENCY_NAME",
"link": {
"rel": "LINK_REL",
"href": "CURRENCY_LINK"
}
},
"issue_date": "ISSUE_DATE",
"alternate_issue_date": "ALT_ISSUE_DATE",
"due_date": "DUE_DATE",
"alternate_due_date": "ALT_DUE_DATE",
"subtotal": "INVOICE_SUBTOTAL",
"tax": "INVOICE_TAX",
"total": "INVOICE_TOTAL",
"price_tax_inclusive": "BOOLEAN",
"account_id": "ACCOUNT_ID",
"purchase_order_id": "PURCHASE_ORDER_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_TIMESTAMP",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_TIMESTAMP",
"uuid": "INVOICE_UUID",
"version": "INVOICE_VERSION",
"custom_attributes": "CUSTOM_ATTRIBUTES",
"custom_objects": "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_PO_QUANTITY",
"item_uom": "ITEM_UOM",
"item_warehouse": "ITEM_WAREHOUSE",
"uuid": "LINE_UUID",
"version": "LINE_VERSION"
}
],
"kpis": {
"outstanding": "KPI_OUTSTANDING",
"overdue": "KPI_OVERDUE",
"last_payment_date": "LAST_PAYMENT_DATE",
"payment_applied": "PAYMENT_APPLIED",
"credit_applied": "CREDIT_APPLIED",
"credit_issued": "CREDIT_ISSUED",
"last_reactivated_on": "LAST_REACTIVATED",
"last_cancelled_on": "LAST_CANCELLED",
"last_amended_on": "LAST_AMENDED",
"voided_on": "VOIDED_ON",
"deleted_on": "DELETED_ON"
}
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "PAGE_LIMIT",
"offset": "PAGE_OFFSET",
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
Getting Purchase Invoice Details by ID
Function: purchase_invoice_details()
Purpose
This SDK function retrieves detailed information about a specific purchase invoice using its unique identifier. It provides access to invoice metadata, financial values, currency details, and item-level breakdowns. In the purchase invoice workflow, invoices are created by first selecting a supplier account and then choosing one or more items that have a purchase sale price and available inventory stock. Once created, the invoice begins with a status of unpaid and can later transition to paid when the full amount is settled through the Purchase Payment module. This function ensures visibility into that lifecycle by exposing both header-level and line-level details.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique identifier of the purchase invoice to fetch details for. |
Use Case
The function is used to review or validate the details of a single purchase invoice for reconciliation, auditing, or reporting purposes. It supports workflows such as displaying invoice details in applications, verifying amounts and due dates during financial checks, and analyzing item-level data for procurement oversight. By incorporating the invoice lifecycle rules, this function helps finance and procurement teams track invoices from creation through payment, ensuring accuracy in financial reporting and compliance processes.
def purchase_invoice_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.details(id='PURCHASE_INVOICE_ID')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceDetails()
{
$id = 'PURCHASE_INVOICE_ID';
try {
$response = $this->purchaseInvoiceService->readDetails($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response returns a object containing comprehensive invoice information. This includes identifiers such as invoice ID and UUID, status, issue and due dates, currency details, subtotal, tax, and total amounts. Line items are provided with granular data including subtotals, totals, tax values, accounting codes, item quantities, and warehouse allocations. KPIs summarize payment status, outstanding balances, overdue amounts, and credit application. Metadata such as creator, timestamps, versioning, and custom attributes are also included. Together, these details reflect the purchase invoice lifecycle, from initial creation with an unpaid status to eventual settlement through the payment module.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status="PURCHASE_INVOICE_STATUS",
id="PURCHASE_INVOICE_ID",
customForm=CustomFormsDTO(
uuid="CUSTOM_FORM_UUID",
name="CUSTOM_FORM_NAME"
),
currency=PurchaseInvoiceCurrencyDTO(
id="CURRENCY_ID",
name="CURRENCY_NAME",
link=CurrencyLinkDTO(
rel="LINK_REL",
href="CURRENCY_LINK"
)
),
issueDate="ISSUE_DATE",
alternateIssueDate="ALT_ISSUE_DATE",
dueDate="DUE_DATE",
alternateDueDate="ALT_DUE_DATE",
subtotal="INVOICE_SUBTOTAL",
tax="INVOICE_TAX",
total="INVOICE_TOTAL",
priceTaxInclusive="BOOLEAN",
accountId="ACCOUNT_ID",
purchaseOrderId="PURCHASE_ORDER_ID",
createdBy="CREATED_BY",
createdOn="CREATED_TIMESTAMP",
lastUpdatedBy="LAST_UPDATED_BY",
lastUpdatedOn="LAST_UPDATED_TIMESTAMP",
uuid="INVOICE_UUID",
version="INVOICE_VERSION",
customAttributes="CUSTOM_ATTRIBUTES",
customObjects="CUSTOM_OBJECTS",
lines=[
PurchaseInvoiceLineDataDTO(
subtotal="LINE_SUBTOTAL",
total="LINE_TOTAL",
tax="LINE_TAX",
accountingCode="ACCOUNTING_CODE",
itemUuid="ITEM_UUID",
itemPurchaseOrderQuantity="ITEM_PO_QUANTITY",
itemUom="ITEM_UOM",
itemWarehouse="ITEM_WAREHOUSE",
uuid="LINE_UUID",
version="LINE_VERSION",
itemId="ITEM_ID",
itemName="ITEM_NAME",
itemQuantity="ITEM_QUANTITY",
itemPriceSnapshot="ITEM_PRICE_SNAPSHOT",
itemPriceTax="ITEM_PRICE_TAX",
priceTaxExampt="BOOLEAN"
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding="KPI_OUTSTANDING",
overdue="KPI_OVERDUE",
lastPaymentDate="LAST_PAYMENT_DATE",
paymentApplied="PAYMENT_APPLIED",
creditApplied="CREDIT_APPLIED",
creditIssued="CREDIT_ISSUED",
lastReactivatedOn="LAST_REACTIVATED",
lastCancelledOn="LAST_CANCELLED",
lastAmendedOn="LAST_AMENDED",
voidedOn="VOIDED_ON",
deletedOn="DELETED_ON"
),
externalBankDetails="EXTERNAL_BANK_DETAILS"
),
pagination="PAGINATION"
)
{
"purchase_invoice": {
"status": "PURCHASE_INVOICE_STATUS",
"id": "PURCHASE_INVOICE_ID",
"custom_form": "CUSTOM_FORM",
"currency": {
"id": "CURRENCY_ID",
"name": "CURRENCY_NAME",
"link": {
"rel": "LINK_REL",
"href": "CURRENCY_LINK"
}
},
"issue_date": "ISSUE_DATE",
"alternate_issue_date": "ALT_ISSUE_DATE",
"due_date": "DUE_DATE",
"alternate_due_date": "ALT_DUE_DATE",
"subtotal": "INVOICE_SUBTOTAL",
"tax": "INVOICE_TAX",
"total": "INVOICE_TOTAL",
"price_tax_inclusive": "BOOLEAN",
"account_id": "ACCOUNT_ID",
"purchase_order_id": "PURCHASE_ORDER_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_TIMESTAMP",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_TIMESTAMP",
"uuid": "INVOICE_UUID",
"version": "INVOICE_VERSION",
"custom_attributes": "CUSTOM_ATTRIBUTES",
"custom_objects": "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_PO_QUANTITY",
"item_uom": "ITEM_UOM",
"item_warehouse": "ITEM_WAREHOUSE",
"uuid": "LINE_UUID",
"version": "LINE_VERSION"
}
],
"kpis": {
"outstanding": "KPI_OUTSTANDING",
"overdue": "KPI_OVERDUE",
"last_payment_date": "LAST_PAYMENT_DATE",
"payment_applied": "PAYMENT_APPLIED",
"credit_applied": "CREDIT_APPLIED",
"credit_issued": "CREDIT_ISSUED",
"last_reactivated_on": "LAST_REACTIVATED",
"last_cancelled_on": "LAST_CANCELLED",
"last_amended_on": "LAST_AMENDED",
"voided_on": "VOIDED_ON",
"deleted_on": "DELETED_ON"
}
}
}
Getting Purchase Invoice Line Details
Function: purchase_invoice_line_details()
Purpose
The function retrieves detailed information about a specific line item within a purchase invoice. It enables accurate tracking of individual invoice components, ensuring seamless financial and inventory management.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PURCHASE_INVOICE_ID | String | The unique identifier of the purchase invoice. |
| LINES_UUID | String | The unique identifier of the invoice line item. |
Use Case
This function can be used for businesses managing invoices with multiple line items. For instance, an accounting system can utilize this function to review specific purchase invoice details, track inventory movements, and validate tax calculations. This helps maintain financial accuracy and enhances reporting efficiency.
def purchase_invoice_line_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.line_details(id='PUCHASE_INVOICE_ID', uuid='LINE_UUID')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceLineDetails()
{
$id = 'PUCHASE_INVOICE_ID';
$lineUUID='LINE_UUID';
try {
$response = $this->purchaseInvoiceService->readLinesDetails($id,$lineUUID,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a structured response containing purchase invoice line details. On success, it includes information such as the subtotal, tax, item UUID, warehouse location, and accounting codes. If the operation fails, it provides an error message with relevant debugging information.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status="INVOICE_STATUS",
id="INVOICE_ID",
customForm=CustomFormsDTO(
uuid="FORM_UUID",
name="FORM_NAME"
),
currency="CURRENCY",
issueDate="ISSUE_DATE",
alternateIssueDate="ALTERNATE_ISSUE_DATE",
dueDate="DUE_DATE",
alternateDueDate="ALTERNATE_DUE_DATE",
subtotal="SUBTOTAL_AMOUNT",
tax="TAX_AMOUNT",
total="TOTAL_AMOUNT",
priceTaxInclusive="PRICE_TAX_INCLUSIVE",
accountId="ACCOUNT_ID",
purchaseOrderId="PURCHASE_ORDER_ID",
createdBy="USER_ID",
createdOn="CREATED_DATE",
lastUpdatedBy="USER_ID",
lastUpdatedOn="LAST_UPDATED_DATE",
uuid="INVOICE_UUID",
version="INVOICE_VERSION",
customAttributes=[
CustomAttributesDTO(
name="ATTRIBUTE_NAME",
value="ATTRIBUTE_VALUE"
)
],
customObjects=[],
lines=[
PurchaseInvoiceLineDTO(
subtotal="LINE-SUBTOTAL",
total="LINE-TOTAL",
tax="LINE-TAX",
accountingCode="ACCOUNTING-CODE",
itemUuid="ITEM-UUID",
itemPurchaseOrderQuantity="ITEM-PURCHASE-ORDER-QUANTITY",
itemUom="ITEM-UOM",
itemWarehouse="ITEM-WAREHOUSE",
uuid="LINE-UUID",
version="LINE-VERSION"
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding="OUTSTANDING_AMOUNT",
overdue="OVERDUE_AMOUNT",
lastPaymentDate="LAST_PAYMENT_DATE",
paymentApplied="PAYMENT_APPLIED_AMOUNT",
creditApplied="CREDIT_APPLIED_AMOUNT",
creditIssued="CREDIT_ISSUED_AMOUNT",
lastReactivatedOn="LAST_REACTIVATED_DATE",
lastCancelledOn="LAST_CANCELLED_DATE",
lastAmendedOn="LAST_AMENDED_DATE",
voidedOn="VOIDED_DATE",
deletedOn="DELETED_DATE"
)
)
)
{
"purchase_invoice": {
"status": null,
"id": null,
"custom_form": {},
"subtotal": "",
"tax": "",
"created_by": "",
"last_updated_by": "",
"custom_attributes": [],
"custom_objects": [],
"line": {
"subtotal": "50.000000",
"total": "50.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "8a83dc00-1976-4b51-923f-1ec8837c242c",
"item_purchase_order_quantity": "1.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"version": "0"
},
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
"autobillCredential": {
"apiUrl": "https:\/\/dev-api.exsited.com\/api\/v3\/purchase-invoices\/PI-DQLP9B-0001\/lines\/26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"appUrl": null,
"ClientId": "DTgOBjoFCTsCCDU3DAY5OWUCBwsKNgIJOgs6Ag0KDgcCCjg3CTkLBwYKBzo3Ag4FBwwCBQwKBjg=",
"ClientSecret": "NmE3L2MuMmQrL2YyYWJgMjErNDViYysyMjU3K2BiNTcrMWI3YDEvZF81NzEzKzcuMDUrYTY3M2E=",
"file_path": "C:\\Users\\saeedullah\\Desktop\\PROJECTS\\exsited\\php-sdk\\exsited-app-sdk-php\/token.json"
}
}
Getting Purchase Invoice List of a Specific Account
Function: purchase_invoice_account_details()
Purpose
The function retrieves detailed information about all purchase invoices associated with a specific account. It helps businesses track all purchase-related financial data for a given account, including invoice totals, statuses, and payment details.
Parameters
| Parameter | Type | Description |
|---|---|---|
| ACCOUNT_ID | string | The unique identifier of the account to retrieve purchase invoices for. |
Use Case
This function can be used by businesses to retrieve purchase invoice details related to a specific account. For example, an accounting or finance team can use it to view all active invoices associated with a customer or supplier, monitor payment statuses, and ensure accurate financial records.
def purchase_invoice_account_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.account_details(id='ACCOUNT_ID')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceAccountDetails()
{
$accountId = 'ACCOUNT_ID';
try {
$response = $this->purchaseInvoiceService->readAccountPurchaseInvoices($accountId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a response containing a list of purchase invoices associated with the provided account. The response includes details such as the status, issue date, total amount, custom attributes, and invoice line details. If an error occurs, an exception with error details is returned.
PurchaseInvoiceAccountDetailDTO(
account=PurchaseInvoiceListDTO(
purchaseInvoices=[
PurchaseInvoiceDTO(
status="PURCHASE_INVOICE_STATUS",
id="PURCHASE_INVOICE_ID",
customForm=CustomFormsDTO(
uuid="CUSTOM_FORM_UUID",
name="CUSTOM_FORM_NAME"
),
currency=PurchaseInvoiceCurrencyDTO(
id="CURRENCY_ID",
name="CURRENCY_NAME",
link=CurrencyLinkDTO(
rel="LINK_REL",
href="CURRENCY_LINK"
)
),
issueDate="ISSUE_DATE",
alternateIssueDate="ALT_ISSUE_DATE",
dueDate="DUE_DATE",
alternateDueDate="ALT_DUE_DATE",
subtotal="INVOICE_SUBTOTAL",
tax="INVOICE_TAX",
total="INVOICE_TOTAL",
priceTaxInclusive="BOOLEAN",
accountId="ACCOUNT_ID",
purchaseOrderId="PURCHASE_ORDER_ID",
createdBy="CREATED_BY",
createdOn="CREATED_TIMESTAMP",
lastUpdatedBy="LAST_UPDATED_BY",
lastUpdatedOn="LAST_UPDATED_TIMESTAMP",
uuid="INVOICE_UUID",
version="INVOICE_VERSION",
customAttributes="CUSTOM_ATTRIBUTES",
customObjects="CUSTOM_OBJECTS",
lines=[
PurchaseInvoiceLineDataDTO(
subtotal="LINE_SUBTOTAL",
total="LINE_TOTAL",
tax="LINE_TAX",
accountingCode="ACCOUNTING_CODE",
itemUuid="ITEM_UUID",
itemPurchaseOrderQuantity="ITEM_PO_QUANTITY",
itemUom="ITEM_UOM",
itemWarehouse="ITEM_WAREHOUSE",
uuid="LINE_UUID",
version="LINE_VERSION",
itemId="ITEM_ID",
itemName="ITEM_NAME",
itemQuantity="ITEM_QUANTITY",
itemPriceSnapshot="ITEM_PRICE_SNAPSHOT",
itemPriceTax="ITEM_PRICE_TAX",
priceTaxExampt="BOOLEAN"
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding="KPI_OUTSTANDING",
overdue="KPI_OVERDUE",
lastPaymentDate="LAST_PAYMENT_DATE",
paymentApplied="PAYMENT_APPLIED",
creditApplied="CREDIT_APPLIED",
creditIssued="CREDIT_ISSUED",
lastReactivatedOn="LAST_REACTIVATED",
lastCancelledOn="LAST_CANCELLED",
lastAmendedOn="LAST_AMENDED",
voidedOn="VOIDED_ON",
deletedOn="DELETED_ON"
),
externalBankDetails="EXTERNAL_BANK_DETAILS"
)
],
pagination=PaginationDTO(
records="TOTAL_RECORDS",
limit="PAGE_LIMIT",
offset="PAGE_OFFSET",
previousPage="PREVIOUS_PAGE_URL",
nextPage="NEXT_PAGE_URL"
)
)
)
{
"account": {
"purchase_invoices": [
{
"status": "PURCHASE_INVOICE_STATUS",
"id": "PURCHASE_INVOICE_ID",
"custom_form": "CUSTOM_FORM",
"currency": {
"id": "CURRENCY_ID",
"name": "CURRENCY_NAME",
"link": {
"rel": "LINK_REL",
"href": "CURRENCY_LINK"
}
},
"issue_date": "ISSUE_DATE",
"alternate_issue_date": "ALT_ISSUE_DATE",
"due_date": "DUE_DATE",
"alternate_due_date": "ALT_DUE_DATE",
"subtotal": "INVOICE_SUBTOTAL",
"tax": "INVOICE_TAX",
"total": "INVOICE_TOTAL",
"price_tax_inclusive": "BOOLEAN",
"account_id": "ACCOUNT_ID",
"purchase_order_id": "PURCHASE_ORDER_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_TIMESTAMP",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_TIMESTAMP",
"uuid": "INVOICE_UUID",
"version": "INVOICE_VERSION",
"custom_attributes": "CUSTOM_ATTRIBUTES",
"custom_objects": "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_PO_QUANTITY",
"item_uom": "ITEM_UOM",
"item_warehouse": "ITEM_WAREHOUSE",
"uuid": "LINE_UUID",
"version": "LINE_VERSION"
}
],
"kpis": {
"outstanding": "KPI_OUTSTANDING",
"overdue": "KPI_OVERDUE",
"last_payment_date": "LAST_PAYMENT_DATE",
"payment_applied": "PAYMENT_APPLIED",
"credit_applied": "CREDIT_APPLIED",
"credit_issued": "CREDIT_ISSUED",
"last_reactivated_on": "LAST_REACTIVATED",
"last_cancelled_on": "LAST_CANCELLED",
"last_amended_on": "LAST_AMENDED",
"voided_on": "VOIDED_ON",
"deleted_on": "DELETED_ON"
}
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "PAGE_LIMIT",
"offset": "PAGE_OFFSET",
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
}
Getting All Notes of a Purchase Invoice
Function: purchase_invoice_notes()
Purpose
This SDK method retrieves all notes associated with a specific purchase invoice. Each note may contain rich-text content, attached files, audit trail metadata (who created/updated and when), and optional custom attributes. The method also provides pagination details to handle large sets of notes. This is essential for maintaining visibility over purchase invoice histories, approvals, and attachments, ensuring auditability and compliance.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice whose notes need to be retrieved. |
Use Case
This method is typically used in financial workflows where purchase invoices need to be validated, audited, or tracked. For example, during vendor payment processing, finance teams may attach receipts, explanations for adjustments, or approvals as notes. Auditors or operations staff can later fetch all notes tied to an invoice to review attached documents, confirm approvals, and track when and by whom actions were taken. By programmatically retrieving invoice notes, businesses can integrate these details into dashboards, reporting tools, or automated workflows to streamline reconciliation, dispute resolution, and compliance processes.
def purchase_invoice_notes():
from exsited_sdk import ExsitedSDK, SDKConfig, FileTokenManager, CommonData
from exsited_sdk.exceptions import ABException
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "TOKEN_FILE_PATH"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_details(
id="PURCHASE_INVOICE_ID"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceNotes()
{
$purchaseInvoiceId = 'PURCHASE_INVOICE_ID';
try {
$response = $this->notesService->readPurchaseInvoiceAllNotes(
$purchaseInvoiceId,
'v3'
);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the method returns a purchase_invoice object containing an array of notes and a pagination object. Each note includes its unique identifier (uuid), versioning information, HTML content, optional list of attached files (with their UUID, filename, and version), and audit metadata such as who created the note and when. If the note was updated, the metadata reflects the latest changes. custom_attributes provides a placeholder for extending the note with additional structured metadata. The pagination object helps navigate through large sets of notes by specifying total records, current offset, and navigation links.
PurchaseInvoiceDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteDataDTO(
notes=[
NoteDataDTO(
uuid="NOTE_UUID",
version="NOTE_VERSION",
content="NOTE_CONTENT",
files=[
FileDTO(
uuid="FILE_UUID",
name="FILE_NAME",
version="FILE_VERSION"
)
],
createdBy="CREATED_BY",
createdOn="CREATED_ON",
lastUpdatedBy="LAST_UPDATED_BY",
lastUpdatedOn="LAST_UPDATED_ON"
)
],
pagination=PaginationDTO(
records="TOTAL_RECORDS",
limit="LIMIT",
offset="OFFSET",
previousPage="PREVIOUS_PAGE",
nextPage="NEXT_PAGE"
)
)
)
{
"purchase_invoice": {
"notes": [
{
"uuid": "NOTE_UUID",
"version": "NOTE_VERSION",
"content": "NOTE_CONTENT",
"files": [
{
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "FILE_VERSION"
}
],
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"custom_attributes": []
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "LIMIT",
"offset": "OFFSET",
"previous_page": "PREVIOUS_PAGE",
"next_page": "NEXT_PAGE"
}
}
}
Getting Specific Purchase Invoice Note
Function: purchase_invoice_note_details()
Purpose
This SDK method retrieves the details of a specific note associated with a purchase invoice, identified by its unique UUID. The method returns all details of the note, including rich-text content, attached files, audit metadata (creator, timestamps, last updated info), and any additional custom attributes. This is useful for accessing precise note-level information for validation, auditing, and review purposes.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice containing the note. |
| note_uuid | string | Unique identifier (UUID) of the note to be retrieved. |
Use Case
This method is most commonly used in scenarios where a user needs to review or validate a single note tied to a purchase invoice. For instance, an auditor or finance officer may want to check who created the note, what files were attached, and whether any updates were made. Instead of fetching all notes and searching manually, this method allows direct access to a specific note using its UUID. It is especially helpful in workflows where notes are used for approvals, dispute handling, or attaching supporting evidence for invoice verification. By integrating this call into applications, businesses can ensure targeted note retrieval for faster auditing and operational clarity.
def purchase_invoice_note_details():
from exsited_sdk import ExsitedSDK, SDKConfig, FileTokenManager, CommonData
from exsited_sdk.exceptions import ABException
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "TOKEN_FILE_PATH"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_details(
id="PURCHASE_INVOICE_ID",
uuid="NOTE_UUID"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceNoteDetails()
{
$purchaseInvoiceId = 'PURCHASE_INVOICE_ID';
$noteUuid = 'NOTE_UUID';
try {
$response = $this->notesService->readPurchaseInvoiceNotesDetails(
$purchaseInvoiceId,
$noteUuid,
'v3'
);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the method returns a purchase_invoice object containing a single note object. The note includes its unique identifier (uuid), version, HTML-formatted content, and an optional list of attached files with metadata (UUID, file name, version). It also contains audit details such as who created the note and when, plus optional update metadata if changes were made. The custom_attributes field provides flexibility for extending note data with organization-specific attributes. This structure ensures that every note is traceable, auditable, and properly contextualized for financial operations and compliance.
PurchaseInvoiceNoteUuidDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteUuidDataDTO(
note=NoteDataDTO(
uuid="NOTE_UUID",
version="NOTE_VERSION",
content="NOTE_CONTENT",
files=[
FileDTO(
uuid="FILE_UUID",
name="FILE_NAME",
version="FILE_VERSION"
)
],
createdBy="CREATED_BY",
createdOn="CREATED_ON",
lastUpdatedBy="LAST_UPDATED_BY",
lastUpdatedOn="LAST_UPDATED_ON"
)
)
)
{
"purchase_invoice": {
"note": {
"uuid": "NOTE_UUID",
"version": "NOTE_VERSION",
"content": "NOTE_CONTENT",
"files": [
{
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "FILE_VERSION"
}
],
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"custom_attributes": []
}
}
}
Getting All Files for a Purchase Invoice Note
Function: purchase_invoice_note_files()
Purpose
This SDK method retrieves all files attached to a specific note within a purchase invoice. It returns a list of files with metadata such as UUID, file name, and version. This functionality is essential for accessing supporting documents (e.g., scanned receipts, invoices, approval forms) linked to notes for auditing, dispute resolution, or compliance checks.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice containing the note. |
| note_uuid | string | Unique identifier (UUID) of the note whose files need to be retrieved. |
Use Case
This method is typically used when an application or user needs to review all documents attached to a purchase invoice note. For example, during a financial audit, an auditor may want to see supporting evidence attached to a specific note that describes adjustments or justifications for an invoice. Instead of downloading files one by one manually, this method provides a structured response with all file metadata, making it easier to fetch, validate, or download the associated files programmatically. By using this method, businesses can improve operational efficiency, ensure transparency, and maintain accurate financial records.
def purchase_invoice_note_files():
from exsited_sdk import ExsitedSDK, SDKConfig, FileTokenManager, CommonData
from exsited_sdk.exceptions import ABException
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "TOKEN_FILE_PATH"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_files_details(
id="PURCHASE_INVOICE_ID",
uuid="NOTE_UUID"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceNoteFiles()
{
$purchaseInvoiceId = '{{PURCHASE_INVOICE_ID}}';
$noteUuid = 'NOTE_UUID';
try {
$response = $this->notesService->readPurchaseInvoiceNoteAllFiles(
$purchaseInvoiceId,
$noteUuid,
'v3'
);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the method returns a purchase_invoice object containing the target note, which includes a list of files. Each file is represented by its uuid, name, and version. This allows applications to retrieve precise file metadata before downloading or processing. The presence of the custom_attributes array ensures extensibility, allowing organizations to attach additional metadata to files if needed. This structured response ensures that file retrieval is consistent, auditable, and programmatically manageable.
PurchaseInvoiceUuidFileDetailsDTO(
purchaseInvoice=PurchaseInvoiceUuidFileDataDTO(
note=NoteFileDataDTO(
files=[
FileDTO(
uuid="FILE_UUID",
name="FILE_NAME",
version="FILE_VERSION"
)
],
customAttributes=[]
)
)
)
{
"purchase_invoice": {
"note": {
"files": [
{
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "FILE_VERSION"
}
],
"custom_attributes": []
}
}
}
Getting Specific File for a Purchase Invoice Note
Function: purchase_invoice_note_file_details()
Purpose
This SDK method retrieves the details of a single file attached to a specific note within a purchase invoice. It returns metadata such as file UUID, name, and version, which are useful for identifying and managing the file. This fybctuib is particularly valuable when the application needs to validate or fetch metadata of a specific document (e.g., a scanned invoice copy, contract, or supporting attachment) associated with a financial record.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice containing the note. |
| note_uuid | string | Unique identifier (UUID) of the note whose file details are requested. |
| file_uuid | string | Unique identifier (UUID) of the file for which details are being retrieved. |
Use Case
This method is most commonly used when an application needs to verify the metadata of a single attached file in a purchase invoice note. For example, during approval workflows, a manager may want to ensure that a specific file (such as a contract or receipt) is the correct version before proceeding with further steps. Instead of returning all files for the note, this function provides focused details about the specific file, ensuring accuracy, traceability, and efficiency in financial and compliance processes.
def purchase_invoice_note_file_details():
from exsited_sdk import ExsitedSDK, SDKConfig, FileTokenManager, CommonData
from exsited_sdk.exceptions import ABException
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "TOKEN_FILE_PATH"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_files_uuid_details(
id="PURCHASE_INVOICE_ID",
uuid="NOTE_UUID",
file_uuid="FILE_UUID"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function purchaseInvoiceNoteFileDetails()
{
$purchaseInvoiceId = 'PURCHASE_INVOICE_ID';
$noteUuid = 'NOTE_UUID';
$fileUuid = 'FILE_UUID';
try {
$response = $this->notesService->readPurchaseInvoiceNoteFileDetails(
$purchaseInvoiceId,
$noteUuid,
$fileUuid,
'v3'
);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the method returns a purchase_invoice object containing the target note, which holds a single file object. The file includes details such as the unique identifier (uuid), the original name of the uploaded file, and its version. This enables the application to confirm the correct file and ensure version control, which is especially important in financial audits, approval workflows, or document compliance checks. The custom_attributes array provides flexibility for extending metadata if organizations require additional tagging or classification.
PurchaseInvoiceNoteUuidFileUuidDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteUuidFileUuidDataDTO(
note=NoteFileUuidDataDTO(
file=FileDTO(
uuid="FILE_UUID",
name="FILE_NAME",
version="FILE_VERSION"
),
customAttributes=[]
)
)
)
{
"purchase_invoice": {
"note": {
"file": {
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "FILE_VERSION"
},
"custom_attributes": []
}
}
}
Creating Purchase Invoice Note
Function: create_purchase_invoice_note()
Purpose
This SDK function allows you to add notes to a specific purchase invoice. Notes may include plain text or rich-text content, along with optional file attachments such as receipts, invoices, or supporting documents. It helps businesses keep detailed records of purchase invoice activities and ensures that all team members can collaborate effectively with contextual documentation.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | string | Unique identifier of the purchase invoice to which the note will be added. |
| datas | string | The note content. This may contain plain text or formatted text. |
| file_urls | array | List of file paths to be attached with the note (local system files). |
Use Case
Organizations often need to attach contextual notes or documentation directly to purchase invoices for better financial management and auditing. For example, when processing a supplier invoice, the finance team may attach a scanned copy of the supplier bill or add notes about discrepancies, approvals, or special terms. Using the SDK methods, developers can automate this process by enabling the creation of purchase invoice notes programmatically. The Python SDK provides the method purchase_invoice_add_notes for adding notes, while the PHP SDK offers the method createPurchaseInvoiceNotes. Both abstract away authentication and raw API complexities, making integration seamless.
def create_purchase_invoice_note():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
datas = "This is a sample note content."
file_urls = [
"C:\\Users\\USER_NAME\\Downloads\\FILE_NAME.png"
]
response = exsited_sdk.notes.purchase_invoice_add_notes(
file_urls=file_urls,
datas=datas,
purchase_invoice_id="{{PURCHASE_INVOICE_ID}}"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function createPurchaseInvoiceNote()
{
$purchaseInvoiceId = "{{PURCHASE_INVOICE_ID}}";
$filePath = 'C:\\Users\\USER_NAME\\Downloads\\FILE_NAM.png';
$note = 'This is a sample note content.';
try {
$response = $this->notesService->createPurchaseInvoiceNotes(
$filePath,
$note,
$purchaseInvoiceId,
'v3'
);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On successful execution, the function returns a purchase-invoice object containing a notes object. The notes object includes a unique identifier (uuid) of the newly created note. This UUID can later be used for retrieving, updating, or deleting the note if needed. The Python SDK maps this response to a DTO object (PurchaseInvoiceNoteResponseDetailsDTO), while the PHP SDK provides a structured JSON response with additional credential metadata. Both responses are consistent in representing the created note identifier.
PurchaseInvoiceNoteResponseDetailsDTO(
purchaseInvoice=None
)
{
"purchase-invoice": {
"notes": {
"uuid": "NOTE_UUID"
}
},
"autobillCredential": {
"apiUrl": "https://domain/api/v3/purchase-invoices/PURCHASE_INVOICE_ID/notes",
"appUrl": null,
"ClientId": "CLIENT_ID",
"ClientSecret": "CLIENT_SECRET",
"accessToken": "ACCESS_TOKEN",
"refreshToken": "REFRESH_TOKEN",
"file_path": "C:\\Users\\USER_NAME\\Desktop\\PROJECTS\\exsited\\php-sdk\\token.json"
}
}
Deleting Purchase Invoice
Function: purchase_invoice_delete()
Purpose
The function allows users to delete a specific purchase invoice by providing its unique identifier. This is useful for removing invalid or redundant invoices from the system.
Parameter
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique identifier of the purchase invoice. |
Use Case
This function can be used when a business needs to remove an incorrectly created or unnecessary purchase invoice. It helps maintain accurate records by allowing users to delete outdated or duplicate invoices.
def purchase_invoice_delete():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.purchase_invoice.delete(id='PURCHASE_INVOICE_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function deletePurchaseInvoice()
{
$id = 'PURCHASE_INVOICE_ID';
try {
$response = $this->purchaseInvoiceService->delete($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a success response with status code 204, indicating that the purchase invoice has been successfully deleted. If an error occurs, an exception is raised with the corresponding error details.
{
"success": True,
"status_code": 204
}
null
Cancelling Purchase Invoice
Function: purchase_invoice_cancel()
Purpose
This function allows users to cancel an existing purchase invoice by providing its unique invoice identifier along with a required effective date. This operation is used when reversing or invalidating a previously issued purchase invoice due to corrections, supplier changes, internal adjustments, or accounting updates. Cancelling a purchase invoice ensures financial accuracy and maintains proper audit tracking within the system.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique identifier of the purchase invoice to be cancelled. Must refer to an existing purchase invoice. |
Use Case
This function is typically used when a purchase invoice was created incorrectly or needs to be reversed because of a supplier update, pricing correction, duplicated submission, or internal validation error. When cancelling the invoice, the system requires the effective date to properly record the event in accounting records and maintain accurate payable balances. Both Python and PHP SDKs enable passing the invoice ID and cancellation details in a structured request object. The SDK handles the API call and returns a response containing the cancellation event's UUID, confirming that the operation has been successfully recorded.
def purchase_invoice_cancel():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceCancelDataDTO(effectiveDate="{{EFFECTIVE_DATE}}")
response = exsited_sdk.purchase_invoice.cancel(
id="{{PURCHASE_INVOICE_ID}}",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The response confirms that the purchase invoice has been successfully cancelled by returning an event UUID, which serves as a unique identifier for the cancellation action stored in the system. This event UUID can later be used for auditing, reconciliation, or integration with accounting systems. No additional invoice details are returned, as the purpose of this response is strictly to acknowledge the cancellation event.
PurchaseInvoiceCancelResponseDTO(
eventUuid='{{EVENT_UUID}}'
)
Reactivating Purchase Invoice
Function: purchase_invoice_reactivate()
Purpose
This function allows users to reactivate a previously cancelled purchase invoice by providing its unique invoice identifier and a required effective date. Reactivating a purchase invoice is necessary when an invoice was cancelled mistakenly or when the original transaction becomes valid again based on updated supplier information, internal corrections, or restored business conditions. This operation ensures continuity in accounting records and reinstates the invoice into the financial workflow.
Parameters
| Parameter | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique identifier of the purchase invoice to be reactivated. Must refer to an existing purchase invoice. |
Use Case
This function is commonly used when a purchase invoice that was cancelled earlier needs to be reinstated, usually due to corrections in supplier documentation, reversal of cancellation decisions, or internal administrative adjustments. Reactivating the invoice ensures that payable balances and accounting timelines remain accurate. The SDK simplifies the process by allowing you to pass the invoice ID and effective date through a structured request object, after which the system records the reactivation event.
def purchase_invoice_reactivate():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceReactiveDataDTO(effectiveDate="{{EFFECTIVE_DATE}}")
response = exsited_sdk.purchase_invoice.reactive(
id="{{PURCHASE_INVOICE_ID}}",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The response confirms that the purchase invoice has been successfully reactivated. The system returns a unique event UUID, which identifies the reactivation action and allows for future auditing, reconciliation, or external system syncing. The response does not include invoice details, as its main purpose is to acknowledge that the reactivation event has been recorded.
PurchaseInvoiceReactiveResponseDTO(
eventUuid='{{EVENT_UUID}}'
)
Getting Purchase Invoice Note by UUID
Function: purchase_invoice_note_uuid_details()
Purpose
This API retrieves a single note from a purchase invoice using the invoice ID and the note's UUID. The response contains the full detail of that specific note, including its content (HTML-supported), noteGroup classification, noteUser author details (name, displayName, emailAddress), optional file attachments (each with uuid, name, version), and audit fields such as createdBy, createdOn, lastUpdatedBy, and lastUpdatedOn. The watcherList and customAttributes fields provide notification management and client-defined metadata. This is useful when a specific note needs to be displayed, verified, or audited in isolation, without loading the full list of notes on the invoice.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice. |
| uuid | String | The unique UUID of the specific note to be retrieved. |
Use Case
In accounts payable operations, teams often need to review a specific note rather than scrolling through the entire note history. For example, during a payment dispute, a finance officer may need to retrieve a particular note containing the supplier's response or a pricing clarification. An auditor may need to access a specific approval note by its UUID to verify that proper authorization was recorded before payment was released. Support teams may also need to look up a specific note to understand the context behind a billing adjustment. This endpoint allows direct retrieval of a single note with all its metadata, content, and file attachments, supporting targeted lookups and reducing the overhead of loading the entire note collection.
def test_purchase_invoice_note_uuid_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_details(
id="PI-JGR955-0006",
uuid='2942ea6a-490b-40e4-8d58-49f4c763e3ed'
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing a single note. This note includes its uuid, version, content (HTML-supported), a noteGroup object (uuid, status, name, displayName), a noteUser object (uuid, name, displayName, emailAddress), optional file attachments (each with its own uuid, name, and version), and audit fields such as createdBy, createdOn, lastUpdatedBy, and lastUpdatedOn. The customAttributes field is provided for client-defined metadata. This makes it easy to track note ownership, review attached files, and maintain compliance/audit records for the purchase invoice.
PurchaseInvoiceNoteUuidDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteUuidDataDTO(
note=NoteDataDTO(
uuid='NOTE_UUID',
version='NOTE_VERSION',
content='NOTE_CONTENT',
noteGroup=NoteGroupDTO(
uuid='GROUP_UUID',
status='GROUP_STATUS',
name='GROUP_NAME',
displayName='GROUP_DISPLAY_NAME'
),
noteUser=NoteUserDTO(
uuid='USER_UUID',
name='USER_NAME',
displayName='USER_DISPLAY_NAME',
emailAddress='USER_EMAIL'
),
files=[
FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='FILE_VERSION'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON'
)
)
)
Getting Purchase Invoice Note Files
Function: purchase_invoice_note_uuid_files_details()
Purpose
This API retrieves all files attached to a specific note on a purchase invoice, identified by the invoice ID and note UUID. The response contains a files array where each file entry includes its uuid, name, and version. This is useful when an application needs to enumerate the attachments on a note before initiating downloads, display a file listing to the user, or verify that expected documents (such as supplier invoices, credit memos, or payment receipts) have been uploaded. The file UUIDs returned can be used with the file-by-UUID endpoint for individual file retrieval.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice. |
| uuid | String | The unique UUID of the note whose files are to be retrieved. |
Use Case
In accounts payable workflows, invoice notes frequently include file attachments such as supplier invoices (PDF or scanned copies), credit memos, payment confirmation receipts, dispute correspondence, or compliance documentation. When building user interfaces or integrating with document management systems, applications need to list all files on a note to display download links, verify that required documents have been uploaded, or synchronize attachments to external archives. For example, a payment dashboard might show a note's content alongside a list of its attached files, allowing finance staff to click through to individual documents before approving a payment. This endpoint provides the file metadata needed for these scenarios without downloading the actual file content.
def test_purchase_invoice_note_uuid_files_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_files_details(
id="PI-JGR955-0006",
uuid='2942ea6a-490b-40e4-8d58-49f4c763e3ed'
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the file list for the specified note. The response wraps a note object that holds a files array, where each file entry includes its uuid, name, and version. This makes it easy to enumerate all attachments on a note, display file names to the user, and use the file UUIDs for subsequent download or detail retrieval operations.
PurchaseInvoiceUuidFileDetailsDTO(
purchaseInvoice=PurchaseInvoiceUuidFileDataDTO(
note=NoteFileDataDTO(
files=[
FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='FILE_VERSION'
)
]
)
)
)
Getting Purchase Invoice Note File by UUID
Function: purchase_invoice_note_uuid_files_uuid_details()
Purpose
This API retrieves the metadata for a specific file attached to a note on a purchase invoice, identified by the invoice ID, note UUID, and file UUID. The response contains the file's uuid, name, and version. This is useful when an application needs to verify a specific file's details, check whether it has been updated (via the version field), or prepare download parameters for a single attachment. The three-level identifier (invoice → note → file) ensures precise targeting of the exact file within the note's attachment collection.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice. |
| uuid | String | The unique UUID of the note. |
| file_uuid | String | The unique UUID of the file to be retrieved. |
Use Case
In document management and compliance scenarios, there is often a need to access a specific file rather than listing all attachments. For example, during a tax audit, an auditor may request a particular supplier invoice PDF attached to an invoice note — the application can retrieve that exact file using its UUID without loading other unrelated attachments. Similarly, when integrating with accounts payable automation tools or external archival systems, individual file metadata retrieval allows precise synchronization of specific documents. This endpoint provides a targeted, lightweight way to access a single file's details, supporting both user-facing download workflows and system-to-system integration scenarios.
def test_purchase_invoice_note_uuid_files_uuid_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.purchase_invoice_note_uuid_files_uuid_details(
id="PI-JGR955-0006",
uuid='2942ea6a-490b-40e4-8d58-49f4c763e3ed',
file_uuid='0b2ee1b0-beae-4295-877c-97218f03c193'
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing a single file's metadata. The response wraps a note object that holds a file object with the file's uuid, name, and version. This makes it easy to verify a specific file's identity, check its version for updates, and use the metadata for download or display operations.
PurchaseInvoiceNoteUuidFileUuidDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteUuidFileUuidDataDTO(
note=NoteFileUuidDataDTO(
file=FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='FILE_VERSION'
)
)
)
)
Getting Purchase Invoice Credit Note Applications
Function: invoice_application_list()
Purpose
This API retrieves a paginated list of purchase credit note applications linked to a specific purchase invoice. Each credit note application represents a credit that has been applied against the invoice, reducing the outstanding balance. The response includes details for each application such as the date the credit was applied, the amount credited, the originating credit note ID, the associated payment ID, and audit fields (createdBy, createdOn, uuid, version). The endpoint also returns pagination information to handle invoices with multiple credit applications. This is essential for accounts payable reconciliation, where finance teams need to track how much credit has been applied to an invoice, which credit notes were used, and how the outstanding balance was reduced over time.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice whose credit note applications are to be retrieved. |
| limit | int | Maximum number of records to return. |
| offset | int | Number of records to skip for pagination. |
| direction | String | Sort direction (e.g., "asc" or "desc"). |
| order_by | String | Field to order results by. |
Use Case
In accounts payable workflows, suppliers may issue credit notes for various reasons — returned goods, pricing adjustments, volume discounts, or billing corrections. When a credit note is issued, it is applied against one or more outstanding purchase invoices to reduce the amount owed. Finance teams need to track these credit applications to reconcile invoice balances, ensure that credits are applied to the correct invoices, and verify that the remaining outstanding amount is accurate. During audits, this endpoint provides a clear record of every credit applied to an invoice, including when it was applied, by whom, and which credit note it originated from. This supports three-way reconciliation between invoices, credit notes, and payments, ensuring complete financial transparency.
def test_invoice_purchase_credit_note_application_list():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_credit_notes.invoice_application_list(id='PI-JGR955-0006')
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing a paginated list of credit note applications. Each application includes its date (when the credit was applied), amount (the credited value), creditNoteId (the originating credit note reference), paymentId (the associated payment reference), and audit fields such as createdBy, createdOn, uuid, and version. The pagination object provides records, limit, offset, previousPage, and nextPage for navigating large result sets. This makes it easy to see the complete credit history for an invoice, verify applied amounts, and reconcile outstanding balances.
InvoicePurchaseCreditNoteApplicationsListDTO(
purchaseInvoice=PurchaseCreditNoteApplicationsListDTO(
purchaseCreditNoteApplications=[
PurchaseCreditNoteApplicationDTO(
date='APPLICATION_DATE',
amount='APPLICATION_AMOUNT',
creditNoteId='CREDIT_NOTE_ID',
paymentId='PAYMENT_ID',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='APPLICATION_UUID',
version='APPLICATION_VERSION'
)
],
pagination=PaginationDTO(
records=PAGINATION_RECORDS,
limit=PAGINATION_LIMIT,
offset=PAGINATION_OFFSET,
previousPage=PAGINATION_PREVIOUS_PAGE,
nextPage=PAGINATION_NEXT_PAGE
)
)
)
Creating a Purchase Invoice from Purchase Order
Function: create_from_purchase_order()
Purpose
This API creates a new purchase invoice directly from an existing purchase order. The request requires the purchase order ID and the invoice dates (issueDate, dueDate). The system automatically links the invoice to the purchase order, carries over the relevant line items and financial details, and returns the fully populated invoice object with its system-generated id, calculated totals, line items, and audit fields. This is the standard method for converting approved purchase orders into payable invoices, supporting the procurement-to-payment lifecycle where invoices are generated upon goods receipt or at agreed billing milestones.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_order_id | String | The unique ID of the purchase order to invoice. |
| request_data | PurchaseInvoiceDetailDTO | The invoice creation payload containing dates. |
Use Case
In standard procurement workflows, invoices are typically generated after goods or services have been received against a purchase order. A warehouse manager may confirm receipt of a delivery, triggering the finance team to create an invoice for that shipment. In staged delivery scenarios, multiple invoices may be generated against the same purchase order — each representing a portion of the total order. This endpoint automates the invoice creation process by linking directly to the purchase order, inheriting its line items and pricing, and only requiring the invoice dates to be specified. This reduces manual data entry, prevents discrepancies between order and invoice data, and maintains a clear traceability chain from purchase order to invoice for audit purposes.
def test_create_purchase_invoice_from_purchase_order():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
issueDate="2025-05-09",
dueDate="2025-05-19"
)
)
response = exsited_sdk.purchase_invoice.create_from_purchase_order(
purchase_order_id="PO-7475XV-0003",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the newly created invoice linked to the purchase order. The response includes the generated id, status, currency (id, name), dates (issueDate, dueDate), financial totals (subtotal, tax, total), priceTaxInclusive flag, accountId, purchaseOrderId, and audit fields such as createdBy, createdOn, uuid, and version. The lines array contains each line item with its financial totals (subtotal, tax, total), item identifiers (itemId, itemName), itemQuantity, and line-level uuid and version. This makes it easy to confirm the invoice was generated correctly from the purchase order and retrieve the system-generated identifiers for payment processing.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status='INVOICE_STATUS',
id='INVOICE_ID',
currency=PurchaseInvoiceCurrencyDTO(
id='CURRENCY_ID',
name='CURRENCY_NAME'
),
issueDate='ISSUE_DATE',
dueDate='DUE_DATE',
subtotal='SUBTOTAL',
tax='TAX',
total='TOTAL',
priceTaxInclusive='PRICE_TAX_INCLUSIVE',
accountId='ACCOUNT_ID',
purchaseOrderId='PURCHASE_ORDER_ID',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='INVOICE_UUID',
version='INVOICE_VERSION',
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='LINE_SUBTOTAL',
total='LINE_TOTAL',
tax='LINE_TAX',
itemId='ITEM_ID',
itemName='ITEM_NAME',
itemQuantity='ITEM_QUANTITY',
uuid='LINE_UUID',
version='LINE_VERSION'
)
]
)
)
Creating a Standalone Purchase Invoice
Function: create()
Purpose
This API creates a new standalone purchase invoice without requiring a linked purchase order. The request accepts comprehensive invoice details including accountId, currency, priceTaxInclusive flag, dates (issueDate, dueDate), and a lines array where each line specifies the item (itemId, itemName), quantity, tax exemption status, pricing snapshot (price, uom), and tax configuration (uuid, code, rate). The system calculates financial totals and returns the fully populated invoice object with its generated id and audit fields. This is essential for scenarios where purchases occur without a formal purchase order — such as direct service purchases, utility bills, one-off vendor payments, or expense reimbursements that need to be tracked through the accounts payable system.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| request_data | PurchaseInvoiceRequestDTO | The invoice creation payload containing full details. |
Use Case
Not all purchases follow the formal requisition-to-order workflow. Organizations frequently incur costs that need to be recorded as purchase invoices without a preceding purchase order — for example, monthly utility bills, consulting fees, software subscription charges, or emergency purchases made outside the standard procurement process. Finance teams use this endpoint to create invoices with full line-item detail, including item pricing, tax configuration, and quantities, ensuring these costs are captured in the accounts payable system for payment processing and financial reporting. This supports comprehensive spend tracking, accurate tax reporting, and ensures that all vendor obligations are visible regardless of how the purchase was initiated.
def test_create_purchase_invoice():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceRequestDTO(
purchaseInvoice=PurchaseInvoiceCreateDataDTO(
accountId="7475XV",
currency="AUD",
priceTaxInclusive="true",
issueDate="2025-05-09",
dueDate="2025-05-19",
lines=[
PurchaseInvoiceLineDataDTO(
itemId="ITEM-0006",
itemName="Item001",
itemQuantity="2",
priceTaxExampt="false",
itemPriceSnapshot=PurchaseOrderItemPriceSnapshotDTO(
pricingRule=PurchaseOrderPricingRuleDTO(
price="100",
uom="Gigabit per Second"
)
),
itemPriceTax=TaxDTO(
uuid="d166b28c-395b-4692-87b9-7408a01b72c0",
code="GST",
rate="10.00"
)
)
]
)
)
response = exsited_sdk.purchase_invoice.create(request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the newly created standalone invoice. The response includes the generated id, status, currency (id, name), dates (issueDate, dueDate), financial totals (subtotal, tax, total), priceTaxInclusive flag, accountId, and audit fields such as createdBy, createdOn, uuid, and version. The lines array contains each line item with its financial totals, item identifiers (itemId, itemName), itemQuantity, pricing snapshot (price, uom), tax configuration (uuid, code, rate), and line-level uuid and version. This makes it easy to confirm the invoice was created with the correct items and pricing, and retrieve the system-generated identifiers for subsequent payment or reconciliation operations.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status='INVOICE_STATUS',
id='INVOICE_ID',
currency=PurchaseInvoiceCurrencyDTO(
id='CURRENCY_ID',
name='CURRENCY_NAME'
),
issueDate='ISSUE_DATE',
dueDate='DUE_DATE',
subtotal='SUBTOTAL',
tax='TAX',
total='TOTAL',
priceTaxInclusive='PRICE_TAX_INCLUSIVE',
accountId='ACCOUNT_ID',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='INVOICE_UUID',
version='INVOICE_VERSION',
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='LINE_SUBTOTAL',
total='LINE_TOTAL',
tax='LINE_TAX',
itemId='ITEM_ID',
itemName='ITEM_NAME',
itemQuantity='ITEM_QUANTITY',
itemPriceSnapshot=PurchaseOrderItemPriceSnapshotDTO(
pricingRule=PurchaseOrderPricingRuleDTO(
price='PRICE',
uom='UOM'
)
),
itemPriceTax=TaxDTO(
uuid='TAX_UUID',
code='TAX_CODE',
rate='TAX_RATE'
),
uuid='LINE_UUID',
version='LINE_VERSION'
)
]
)
)
Cancelling a Purchase Invoice
Function: cancel()
Purpose
This API cancels an existing purchase invoice, transitioning it to a cancelled state as of the specified effective date. The request requires the invoice ID and an effectiveDate that determines when the cancellation takes effect for accounting and reporting purposes. The system returns an eventUuid that uniquely identifies the cancellation event for audit tracking. This is important in accounts payable workflows where invoices may need to be voided — for example, when an invoice was issued in error, when goods are returned to the supplier, when pricing disputes are unresolved, or when a duplicate invoice is identified after entry.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice to cancel. |
| request_data | PurchaseInvoiceCancelDataDTO | The cancellation payload containing the effective date. |
Use Case
In accounts payable operations, invoice cancellations are a routine part of managing vendor relationships and maintaining financial accuracy. A finance officer may need to cancel an invoice when the supplier agrees to void it after a pricing dispute, or when a goods return has been processed and the associated invoice is no longer valid. Duplicate invoices created through data entry errors also need to be cancelled to prevent double payments. The effective date parameter ensures that the cancellation is recorded correctly for the appropriate accounting period, which is critical for month-end and year-end financial close processes. The returned eventUuid provides a traceable reference for the cancellation event, supporting compliance requirements and audit trails.
def test_purchase_invoice_cancel():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceCancelDataDTO(effectiveDate="2024-08-07")
response = exsited_sdk.purchase_invoice.cancel(
id="JJEX-0000000173",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns an object containing an eventUuid that uniquely identifies the cancellation event. This UUID serves as a confirmation receipt for the cancellation operation and can be used for tracking, auditing, and correlating the cancellation event with other system activities. This makes it easy to verify the cancellation was processed and maintain a record of when and why the invoice was cancelled.
PurchaseInvoiceCancelResponseDTO(
eventUuid='EVENT_UUID'
)
Reactivating a Purchase Invoice
Function: reactive()
Purpose
This API reactivates a previously cancelled purchase invoice, restoring it to an active state as of the specified effective date. The request requires the invoice ID and an effectiveDate that determines when the reactivation takes effect for accounting purposes. The system returns an eventUuid that uniquely identifies the reactivation event for audit tracking. This is important in scenarios where a cancelled invoice needs to be reinstated — for example, when a cancellation was made in error, when a goods return is reversed, or when a previously disputed invoice is resolved in the supplier's favor and needs to be restored for payment processing.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice to reactivate. |
| request_data | PurchaseInvoiceReactiveDataDTO | The reactivation payload containing the effective date. |
Use Case
In real-world accounts payable operations, invoice cancellations are sometimes premature or made in error. A finance officer may cancel an invoice during a dispute, only to find that the supplier provides satisfactory documentation resolving the issue. An invoice may be cancelled as part of a batch error and need to be individually restored. In some cases, business decisions change — for example, a project that was put on hold is resumed, and its associated invoices need to be reactivated for payment processing. This endpoint allows organizations to reinstate invoices without recreating them, preserving the original invoice data, line items, and history. The effective date ensures the reactivation is recorded in the correct accounting period, and the eventUuid provides a traceable audit reference.
def test_purchase_invoice_reactive():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceReactiveDataDTO(effectiveDate="2024-08-07")
response = exsited_sdk.purchase_invoice.reactive(
id="JJEX-0000000173",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns an object containing an eventUuid that uniquely identifies the reactivation event. This UUID serves as a confirmation receipt for the reactivation operation and can be used for tracking, auditing, and correlating the reactivation event with other system activities. This makes it easy to verify the invoice was successfully restored to an active state and maintain a record of the reactivation for compliance purposes.
PurchaseInvoiceReactiveResponseDTO(
eventUuid='EVENT_UUID'
)
Adding a Purchase Invoice Note
Function: purchase_invoice_add_notes()
Purpose
This API adds a new note to a purchase invoice, with optional file attachments uploaded in the same operation. The request accepts a text content string (datas) and an optional list of local file paths (file_urls) to attach. The system creates the note, uploads any specified files, and returns the newly created note object with its system-generated uuid, version, content, noteGroup classification, file attachment details, and audit fields (createdBy, createdOn). This is essential for maintaining a running record of communications, payment discussions, dispute resolutions, and supporting documents throughout the invoice lifecycle, enabling organizations to keep all invoice-related information centralized within the system.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique ID of the purchase invoice to add the note to. |
| datas | String | The text content of the note. |
| file_urls | list | List of local file paths to attach to the note. |
Use Case
In accounts payable workflows, maintaining documented records of all invoice-related communications is critical for compliance, dispute resolution, and operational transparency. Finance officers may add notes to record payment terms negotiations, attach scanned supplier invoices or credit memos, or document the rationale behind payment holds or adjustments. During disputes, both parties' correspondence can be attached as notes with supporting files. Auditors often require evidence that proper review and approval processes were followed before payments were released. Instead of relying on email threads or external document stores, this endpoint allows all notes and attachments to be stored directly on the invoice, creating a single source of truth for the complete invoice communication and documentation history.
def test_purchase_invoice_add_notes():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
datas = "This is a test note."
file_urls = [
"C:\\path\\to\\file1.jpg",
"C:\\path\\to\\file2.jpg"
]
response = exsited_sdk.notes.purchase_invoice_add_notes(
file_urls=file_urls,
datas=datas,
purchase_invoice_id="PI-PGQOZK-0004"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the newly created note. The note includes its system-generated uuid, version, content text, a noteGroup object (uuid, status, name, displayName), and any uploaded file attachments (each with its own uuid, name, and version). Audit fields such as createdBy and createdOn are provided for tracking who created the note and when. This makes it easy to confirm the note was created successfully, retrieve the generated identifiers for the note and its files, and maintain an audit trail of invoice communications.
PurchaseInvoiceNoteResponseDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteResponseDataDTO(
notes=NoteDataDTO(
uuid='NOTE_UUID',
version='NOTE_VERSION',
content='NOTE_CONTENT',
noteGroup=NoteGroupDTO(
uuid='GROUP_UUID',
status='GROUP_STATUS',
name='GROUP_NAME',
displayName='GROUP_DISPLAY_NAME'
),
files=[
FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='FILE_VERSION'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON'
)
)
)
Adding Files to Purchase Invoice Note
Function: purchase_invoice_add_notes_uuid()
Purpose
This API adds file attachments to an existing note on a purchase invoice, identified by the invoice ID and note UUID. The request accepts a list of local file paths (file_urls) to upload and attach to the specified note. The system uploads the files and returns the updated note object with the new file entries included. This is useful for scenarios where additional supporting documents become available after a note has already been created — for example, when a supplier sends a follow-up document, when additional evidence is gathered during a dispute investigation, or when compliance certificates arrive after the initial note was recorded.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique ID of the purchase invoice. |
| note_uuid | String | The unique UUID of the existing note to add files to. |
| file_urls | list | List of local file paths to attach to the note. |
Use Case
In real-world invoice management, documents rarely arrive all at once. A finance officer may create a note documenting a pricing dispute, and the supplier may send supporting documentation days later that needs to be attached to the same note for context. A compliance team may need to append audit certificates to a note that already contains the initial review comments. Rather than creating a new note for each additional document (which fragments the communication history), this endpoint allows files to be added to an existing note, keeping all related documents grouped together. This improves document organization, makes it easier for reviewers to find all materials related to a specific discussion, and maintains a coherent audit trail.
def test_purchase_invoice_add_notes_uuid():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
file_urls = [
"C:\\path\\to\\file1.jpg"
]
response = exsited_sdk.notes.purchase_invoice_add_notes_uuid(
file_urls=file_urls,
purchase_invoice_id="PI-PGQOZK-0004",
note_uuid='baa86509-d2cd-4a76-97ae-a08d0674c6d1'
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the updated note with the newly added files. The note includes its uuid, version, content text, and the updated files array where each file entry contains its own uuid, name, and version. Audit fields such as createdBy and createdOn are provided for tracking. This makes it easy to confirm the files were attached successfully, retrieve the generated file identifiers, and verify the note now contains all expected attachments.
PurchaseInvoiceNoteResponseDetailsDTO(
purchaseInvoice=PurchaseInvoiceNoteResponseDataDTO(
notes=NoteDataDTO(
uuid='NOTE_UUID',
version='NOTE_VERSION',
content='NOTE_CONTENT',
files=[
FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='FILE_VERSION'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON'
)
)
)
Updating Purchase Invoice Information
Function: update_information()
Purpose
This API updates the metadata and information fields of an existing purchase invoice without modifying its line items or financial totals. The updatable fields include customerPurchaseOrderId (a cross-reference to the customer's own PO number), alternate dates (alternateBillingStartDate, alternateBillingEndDate, alternateIssueDate, alternateDueDate), invoiceNote (free-text annotations), and customAttributes (client-defined name-value pairs for extended metadata). The system returns the full invoice object with the updated information fields. This is important for keeping invoice records enriched with supplementary business data, billing period references, and organizational metadata throughout the invoice lifecycle.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique ID of the purchase invoice to update. |
| request_data | PurchaseInvoiceInformationRequestDTO | The update request payload containing information changes. |
Use Case
Throughout the lifecycle of a purchase invoice, various metadata fields need to be maintained as business context evolves. For example, after receiving a supplier invoice, the finance team may record the customer's purchase order reference (customerPurchaseOrderId) for three-way matching. Alternate billing dates may need to be set to reflect the actual service period rather than the invoice issue date, which is important for revenue recognition and accrual accounting. Notes are frequently updated to document payment terms discussions, dispute resolutions, or approval decisions. Custom attributes allow organizations to tag invoices with business-specific data such as department codes, project identifiers, or approval workflow statuses. This endpoint enables all these updates in a single operation without affecting the invoice's line items or financial totals, ensuring supplementary information stays current while preserving data integrity.
def test_purchase_invoice_update_information():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
request_data = PurchaseInvoiceInformationRequestDTO(
invoice=PurchaseInvoiceInformationDataDTO(
customerPurchaseOrderId="SHFNF4",
alternateBillingStartDate="2025-08-10",
alternateBillingEndDate="2025-09-09",
alternateIssueDate="2025-08-10",
alternateDueDate="2025-08-19",
invoiceNote="NOTE12222",
customAttributes=[
CustomAttributesDTO(
name="Category",
value="Garment"
),
CustomAttributesDTO(
name="Material",
value="Cotton"
)
]
)
)
response = exsited_sdk.purchase_invoice.update_information(
purchase_invoice_id="PI-7475XV-0001",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_invoice object containing the updated invoice with the modified information fields. The response includes the updated alternateIssueDate, alternateDueDate, and other date fields, the invoiceNote text, and the customAttributes array with name-value pairs. Standard fields such as status, id, currency (id, name), financial totals (subtotal, tax, total), accountId, and audit fields (uuid, version) are also returned. This makes it easy to confirm that information updates were applied correctly and retrieve the current state of all metadata fields on the invoice.
PurchaseInvoiceInformationResponseDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status='INVOICE_STATUS',
id='INVOICE_ID',
currency=PurchaseInvoiceCurrencyDTO(
id='CURRENCY_ID',
name='CURRENCY_NAME'
),
issueDate='ISSUE_DATE',
alternateIssueDate='ALTERNATE_ISSUE_DATE',
dueDate='DUE_DATE',
alternateDueDate='ALTERNATE_DUE_DATE',
subtotal='SUBTOTAL',
tax='TAX',
total='TOTAL',
accountId='ACCOUNT_ID',
uuid='INVOICE_UUID',
version='INVOICE_VERSION',
customAttributes=[
CustomAttributesDTO(
name='ATTRIBUTE_NAME',
value='ATTRIBUTE_VALUE'
)
]
)
)
Deleting a Purchase Invoice
Function: delete()
Purpose
This API permanently deletes a purchase invoice from the system by its ID. Unlike cancellation (which preserves the record in a cancelled state), deletion removes the invoice entirely. The operation does not return a response body — a successful completion indicates the invoice has been removed. This should be used with caution and is typically reserved for scenarios where the invoice should not exist at all in the system, such as removing test data, cleaning up invoices created in error before any payments were applied, or complying with data management policies that require complete removal rather than soft deletion.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the purchase invoice to be deleted. |
Use Case
In practice, invoice deletion is a controlled operation that should be used sparingly and with appropriate authorization. Common scenarios include removing invoices created during testing or development, cleaning up duplicate entries that were identified before any payments were processed, and complying with data management policies that require certain records to be fully purged. Unlike cancellation, which maintains the invoice record for audit trail purposes, deletion permanently removes all traces of the invoice. Organizations should ensure that proper approval workflows are in place before allowing invoice deletions, and should prefer cancellation over deletion when an audit trail of the invoice's existence is required for compliance purposes.
def test_purchase_invoice_delete():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.delete(id='PI-JGR955-0004')
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
{'SUCCESS': TRUE, 'STATUS_CODE': 204}
