» 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, providing comprehensive details such as invoice status, issue dates, amounts, custom attributes, and associated accounts. It is essential for tracking and managing financial transactions and outstanding payments.

Parameters

This function does not require any input parameters.

Use Case

An organization needs to view all active purchase invoices to monitor financial transactions and ensure compliance with billing terms. This function enables quick access to detailed invoice data, facilitating better financial oversight.

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 contains a list of purchase invoices with detailed metadata, including invoice identifiers, financial details, custom attributes, associated lines, and pagination data. It allows users to analyze invoice status and details effectively.

PurchaseInvoiceListDTO(
    purchaseInvoices=[
        PurchaseInvoiceDTO(
            status='ACTIVE',
            id='PI-DQLP9B-0001',
            customForm=CustomFormsDTO(uuid=None, name=None),
            currency=PurchaseInvoiceCurrencyDTO(
                id='1',
                name='AUD',
                link=CurrencyLinkDTO(
                    rel='self',
                    href='https://dev-api.exsited.com/api/v1/currencies/1'
                )
            ),
            issueDate='2025-07-20T00:00:00Z',
            alternateIssueDate='2025-07-20T00:00:00Z',
            dueDate='2025-07-20T00:00:00Z',
            alternateDueDate='2025-07-20T00:00:00Z',
            subtotal='',
            tax='',
            total='50.000000',
            priceTaxInclusive='true',
            accountId='DQLP9B',
            purchaseOrderId='PO-DQLP9B-0001',
            createdBy='Implementer',
            createdOn='2025-07-20T08:50:23Z',
            lastUpdatedBy='',
            lastUpdatedOn='',
            uuid='8499f7e3-b120-4f5c-a17e-21ef83e0ea1d',
            version='1',
            customAttributes=[],
            customObjects=[],
            lines=[
                PurchaseInvoiceLineDataDTO(
                    subtotal='50.000000',
                    total='50.000000',
                    tax='0.000000',
                    accountingCode='Account Receivable',
                    itemUuid='8a83dc00-1976-4b51-923f-1ec8837c242c',
                    itemPurchaseOrderQuantity='1.000000',
                    itemUom='',
                    itemWarehouse='Default Warehouse',
                    uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b',
                    version='0',
                    itemId=None,
                    itemName=None,
                    itemQuantity=None,
                    itemPriceSnapshot=None,
                    itemPriceTax=None,
                    priceTaxExampt=None
                )
            ],
            kpis=PurchaseInvoiceKPIDTO(
                outstanding=0,
                overdue=0,
                lastPaymentDate='',
                paymentApplied=0,
                creditApplied=0,
                creditIssued='',
                lastReactivatedOn='',
                lastCancelledOn='',
                lastAmendedOn='',
                voidedOn='',
                deletedOn=''
            ),
            externalBankDetails=None
        ),
        PurchaseInvoiceDTO(
            status='ACTIVE',
            id='PI-DQLP9B-0002',
            customForm=CustomFormsDTO(uuid=None, name=None),
            currency=PurchaseInvoiceCurrencyDTO(
                id='1',
                name='AUD',
                link=CurrencyLinkDTO(
                    rel='self',
                    href='https://dev-api.exsited.com/api/v1/currencies/1'
                )
            ),
            issueDate='2025-07-20T00:00:00Z',
            alternateIssueDate='2025-07-20T00:00:00Z',
            dueDate='2025-07-20T00:00:00Z',
            alternateDueDate='2025-07-20T00:00:00Z',
            subtotal='',
            tax='',
            total='350.000000',
            priceTaxInclusive='true',
            accountId='DQLP9B',
            purchaseOrderId='',
            createdBy='Implementer',
            createdOn='2025-07-20T10:17:35Z',
            lastUpdatedBy='',
            lastUpdatedOn='',
            uuid='c611b4bf-be32-453f-9dce-1eecd90d3911',
            version='1',
            customAttributes=[],
            customObjects=[],
            lines=[
                PurchaseInvoiceLineDataDTO(
                    subtotal='350.000000',
                    total='350.000000',
                    tax='0.000000',
                    accountingCode='Account Receivable',
                    itemUuid='',
                    itemPurchaseOrderQuantity='5.000000',
                    itemUom='',
                    itemWarehouse='Default Warehouse',
                    uuid='2f5f5d1e-5441-4ecc-a0c8-880089cd1855',
                    version='0',
                    itemId=None,
                    itemName=None,
                    itemQuantity=None,
                    itemPriceSnapshot=None,
                    itemPriceTax=None,
                    priceTaxExampt=None
                )
            ],
            kpis=PurchaseInvoiceKPIDTO(
                outstanding=0,
                overdue=0,
                lastPaymentDate='',
                paymentApplied=0,
                creditApplied=0,
                creditIssued='',
                lastReactivatedOn='',
                lastCancelledOn='',
                lastAmendedOn='',
                voidedOn='',
                deletedOn=''
            ),
            externalBankDetails=None
        ),
        PurchaseInvoiceDTO(
            status='ACTIVE',
            id='PI-DQLP9B-0003',
            customForm=CustomFormsDTO(uuid=None, name=None),
            currency=PurchaseInvoiceCurrencyDTO(
                id='1',
                name='AUD',
                link=CurrencyLinkDTO(
                    rel='self',
                    href='https://dev-api.exsited.com/api/v1/currencies/1'
                )
            ),
            issueDate='2025-07-27T00:00:00Z',
            alternateIssueDate='2025-07-27T00:00:00Z',
            dueDate='2025-07-27T00:00:00Z',
            alternateDueDate='2025-07-27T00:00:00Z',
            subtotal='',
            tax='',
            total='1500.000000',
            priceTaxInclusive='true',
            accountId='DQLP9B',
            purchaseOrderId='',
            createdBy='Implementer',
            createdOn='2025-07-27T05:51:56Z',
            lastUpdatedBy='',
            lastUpdatedOn='',
            uuid='eb361cf8-17d8-41f7-a00f-df57d68db057',
            version='0',
            customAttributes=[],
            customObjects=[],
            lines=[
                PurchaseInvoiceLineDataDTO(
                    subtotal='1500.000000',
                    total='1500.000000',
                    tax='0.000000',
                    accountingCode='Account Receivable',
                    itemUuid='',
                    itemPurchaseOrderQuantity='10.000000',
                    itemUom='',
                    itemWarehouse='Default Warehouse',
                    uuid='365ee374-4f04-4afe-8790-24c61fdca122',
                    version='0',
                    itemId=None,
                    itemName=None,
                    itemQuantity=None,
                    itemPriceSnapshot=None,
                    itemPriceTax=None,
                    priceTaxExampt=None
                )
            ],
            kpis=PurchaseInvoiceKPIDTO(
                outstanding=0,
                overdue=0,
                lastPaymentDate='',
                paymentApplied=0,
                creditApplied=0,
                creditIssued='',
                lastReactivatedOn='',
                lastCancelledOn='',
                lastAmendedOn='',
                voidedOn='',
                deletedOn=''
            ),
            externalBankDetails=None
        ),
        PurchaseInvoiceDTO(
            status='ACTIVE',
            id='PI-7O8DW7-0004',
            customForm=CustomFormsDTO(uuid=None, name=None),
            currency=PurchaseInvoiceCurrencyDTO(
                id='1',
                name='AUD',
                link=CurrencyLinkDTO(
                    rel='self',
                    href='https://dev-api.exsited.com/api/v1/currencies/1'
                )
            ),
            issueDate='2025-07-27T00:00:00Z',
            alternateIssueDate='2025-07-27T00:00:00Z',
            dueDate='2025-07-27T00:00:00Z',
            alternateDueDate='2025-07-27T00:00:00Z',
            subtotal='',
            tax='',
            total='1000.000000',
            priceTaxInclusive='true',
            accountId='7O8DW7',
            purchaseOrderId='',
            createdBy='Implementer',
            createdOn='2025-07-27T08:09:33Z',
            lastUpdatedBy='',
            lastUpdatedOn='',
            uuid='7ce74a23-a760-4b12-9aac-ec750b4e2771',
            version='0',
            customAttributes=[],
            customObjects=[],
            lines=[
                PurchaseInvoiceLineDataDTO(
                    subtotal='1000.000000',
                    total='1000.000000',
                    tax='0.000000',
                    accountingCode='Account Receivable',
                    itemUuid='',
                    itemPurchaseOrderQuantity='20.000000',
                    itemUom='',
                    itemWarehouse='Default Warehouse',
                    uuid='6bf3a78a-94b7-4128-8ffd-a58c778de17c',
                    version='0',
                    itemId=None,
                    itemName=None,
                    itemQuantity=None,
                    itemPriceSnapshot=None,
                    itemPriceTax=None,
                    priceTaxExampt=None
                )
            ],
            kpis=PurchaseInvoiceKPIDTO(
                outstanding=0,
                overdue=0,
                lastPaymentDate='',
                paymentApplied=0,
                creditApplied=0,
                creditIssued='',
                lastReactivatedOn='',
                lastCancelledOn='',
                lastAmendedOn='',
                voidedOn='',
                deletedOn=''
            ),
            externalBankDetails=None
        )
    ],
    pagination=PaginationDTO(
        records=4,
        limit=20,
        offset=0,
        previousPage='',
        nextPage='NULL'
    )
)

Getting Purchase Invoice Details by ID

Function: purchase_invoice_details()

Purpose

This function retrieves detailed information about a specific purchase invoice by its unique identifier. It is essential for obtaining precise financial details, including invoice status, associated currency, amounts, line items, and custom attributes.

Parameters 

Parameter
Type
Description
id
String
The unique identifier of the purchase invoice to fetch details for.

Use Case

A finance team needs to retrieve and review the details of a specific purchase invoice for reconciliation or auditing purposes. This function provides all necessary information, ensuring accuracy in financial reporting.

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='PI-DQLP9B-0001')
        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 contains detailed metadata for the specified purchase invoice, including its status, amounts, associated currency, line items, and additional attributes. This data facilitates financial tracking and invoice analysis.

PurchaseInvoiceDetailDTO(
    purchaseInvoice=PurchaseInvoiceDTO(
        status='ACTIVE',
        id='PI-DQLP9B-0001',
        customForm=CustomFormsDTO(
            uuid=None,
            name=None
        ),
        currency=PurchaseInvoiceCurrencyDTO(
            id='1',
            name='AUD',
            link=CurrencyLinkDTO(
                rel='self',
                href='https://dev-api.exsited.com/api/v1/currencies/1'
            )
        ),
        issueDate='2025-07-20T00:00:00Z',
        alternateIssueDate='2025-07-20T00:00:00Z',
        dueDate='2025-07-20T00:00:00Z',
        alternateDueDate='2025-07-20T00:00:00Z',
        subtotal='',
        tax='',
        total='50.000000',
        priceTaxInclusive='true',
        accountId='DQLP9B',
        purchaseOrderId='PO-DQLP9B-0001',
        createdBy='Implementer',
        createdOn='2025-07-20T08:50:23Z',
        lastUpdatedBy='',
        lastUpdatedOn='',
        uuid='8499f7e3-b120-4f5c-a17e-21ef83e0ea1d',
        version='1',
        customAttributes=[],
        customObjects=[],
        lines=[
            PurchaseInvoiceLineDataDTO(
                subtotal='50.000000',
                total='50.000000',
                tax='0.000000',
                accountingCode='Account Receivable',
                itemUuid='8a83dc00-1976-4b51-923f-1ec8837c242c',
                itemPurchaseOrderQuantity='1.000000',
                itemUom='',
                itemWarehouse='Default Warehouse',
                uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b',
                version='0',
                itemId=None,
                itemName=None,
                itemQuantity=None,
                itemPriceSnapshot=None,
                itemPriceTax=None,
                priceTaxExampt=None
            )
        ],
        kpis=PurchaseInvoiceKPIDTO(
            outstanding=0,
            overdue=0,
            lastPaymentDate='',
            paymentApplied=0,
            creditApplied=0,
            creditIssued='',
            lastReactivatedOn='',
            lastCancelledOn='',
            lastAmendedOn='',
            voidedOn='',
            deletedOn=''
        ),
        externalBankDetails=None
    ),
    pagination=None
)

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='PI-DQLP9B-0001', uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b')
        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='7O8DW7')
        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='ACTIVE',
                id='PI-7O8DW7-0004',
                customForm=CustomFormsDTO(
                    uuid=None,
                    name=None
                ),
                currency=PurchaseInvoiceCurrencyDTO(
                    id='1',
                    name='AUD',
                    link=CurrencyLinkDTO(
                        rel='self',
                        href='https://dev-api.exsited.com/api/v1/currencies/1'
                    )
                ),
                issueDate='2025-07-27T00:00:00Z',
                alternateIssueDate='2025-07-27T00:00:00Z',
                dueDate='2025-07-27T00:00:00Z',
                alternateDueDate='2025-07-27T00:00:00Z',
                subtotal='',
                tax='',
                total='1000.000000',
                priceTaxInclusive='true',
                accountId='7O8DW7',
                purchaseOrderId='',
                createdBy='Implementer',
                createdOn='2025-07-27T08:09:33Z',
                lastUpdatedBy='',
                lastUpdatedOn='',
                uuid='7ce74a23-a760-4b12-9aac-ec750b4e2771',
                version='0',
                customAttributes=[],
                customObjects=[],
                lines=[
                    PurchaseInvoiceLineDataDTO(
                        subtotal='1000.000000',
                        total='1000.000000',
                        tax='0.000000',
                        accountingCode='Account Receivable',
                        itemUuid='',
                        itemPurchaseOrderQuantity='20.000000',
                        itemUom='',
                        itemWarehouse='Default Warehouse',
                        uuid='6bf3a78a-94b7-4128-8ffd-a58c778de17c',
                        version='0',
                        itemId=None,
                        itemName=None,
                        itemQuantity=None,
                        itemPriceSnapshot=None,
                        itemPriceTax=None,
                        priceTaxExampt=None
                    )
                ],
                kpis=PurchaseInvoiceKPIDTO(
                    outstanding=0,
                    overdue=0,
                    lastPaymentDate='',
                    paymentApplied=0,
                    creditApplied=0,
                    creditIssued='',
                    lastReactivatedOn='',
                    lastCancelledOn='',
                    lastAmendedOn='',
                    voidedOn='',
                    deletedOn=''
                ),
                externalBankDetails=None
            )
        ],
        pagination=PaginationDTO(
            records=1,
            limit=20,
            offset=0,
            previousPage='',
            nextPage='NULL'
        )
    )
)

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 endpoint 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 endpoint 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 API endpoint 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 API 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 a Purchase Invoice

Function: deletePurchaseInvoice()

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
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 delete_purchase_invoice():
    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
}