» 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'
        )
    )
)

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
}