» Purchase Invoice Module SDK Documentation
» Purchase Invoice Module SDK Documentation

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)

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"
    )
)

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_idString
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)

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"
)

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_UUIDStringThe 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)

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"
        )
    )
)

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

ParameterTypeDescription
ACCOUNT_IDstringThe 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)

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"
        )
    )
)

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)

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"
        )
    )
)

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)

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"
        )
    )
)

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)

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=[]
        )
    )
)

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)

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=[]
        )
    )
)

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)

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
)

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_idString
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)

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
}

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_idString
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_idString
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}}'
)