» Purchase Order Module SDK Documentation
» Purchase Order Module SDK Documentation

Getting Purchase Order List

Function: purchase_order_list()

Purpose

This SDK function retrieves a paginated list of all purchase orders available to the authenticated account. It returns essential header-level purchase order information along with nested details such as currency, supplier invoice linkage, totals, tax details, custom attributes, and item line breakdowns. This operation is commonly used for reporting, auditing, listing purchase order summaries in dashboards, or retrieving identifiers for further API operations.

Parameters 

ParameterTypeDescription
limitintegerOptional. Number of records to return per page.
offsetintegerOptional. Starting point for paginated results.

Use Case

This function is used when a system needs to display, process, or audit a list of purchase orders. For example, an inventory control officer or purchasing department may call this endpoint to retrieve all purchase orders created within a financial period, to review pending orders, or to extract item-level purchasing information for reconciliation. Using the SDK, a developer can quickly list purchase orders without manually constructing HTTP requests.

def purchase_order_list():
    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_order.list()
        print(response)
        # ResponseToObj().process(response=response["purchase_orders"][0])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The function returns a structured list of purchase orders along with pagination metadata. Each purchase order includes identifiers, status, currency information, supplier invoice links, issue and due dates, subtotal, tax, total amounts, notes, custom attributes, and a detailed list of line items including item quantities, tax configuration, accounting codes, and pricing snapshots. The SDK formats this into objects or associative arrays so developers can easily extract values or iterate through multiple purchase order records.

{
    "purchaseOrders": [
        {
            "status": "STATUS_PLACEHOLDER",
            "id": "PURCHASE_ORDER_ID_PLACEHOLDER",
            "currency": {
                "uuid": "CURRENCY_UUID_PLACEHOLDER",
                "name": "CURRENCY_NAME_PLACEHOLDER",
                "link": "CURRENCY_LINK_PLACEHOLDER"
            },
            "supplierInvoiceId": "SUPPLIER_INVOICE_ID_PLACEHOLDER",
            "saleOrderId": "SALE_ORDER_ID_PLACEHOLDER",
            "issueDate": "ISSUE_DATE_PLACEHOLDER",
            "dueDate": "DUE_DATE_PLACEHOLDER",
            "expectedCompletionDate": "EXPECTED_COMPLETION_DATE_PLACEHOLDER",
            "subtotal": "SUBTOTAL_PLACEHOLDER",
            "tax": "TAX_PLACEHOLDER",
            "total": "TOTAL_PLACEHOLDER",
            "priceTaxInclusive": "PRICE_TAX_INCLUSIVE_PLACEHOLDER",
            "purchaseOrderNote": "PURCHASE_ORDER_NOTE_PLACEHOLDER",
            "accountId": "ACCOUNT_ID_PLACEHOLDER",
            "createdBy": "CREATED_BY_PLACEHOLDER",
            "createdOn": "CREATED_ON_PLACEHOLDER",
            "lastUpdatedBy": "LAST_UPDATED_BY_PLACEHOLDER",
            "lastUpdatedOn": "LAST_UPDATED_ON_PLACEHOLDER",
            "uuid": "PURCHASE_ORDER_UUID_PLACEHOLDER",
            "version": "VERSION_PLACEHOLDER",
            "customAttributes": [],
            "customObjects": [],
            "lines": [
                {
                    "subtotal": "LINE_SUBTOTAL_PLACEHOLDER",
                    "total": "LINE_TOTAL_PLACEHOLDER",
                    "tax": "LINE_TAX_PLACEHOLDER",
                    "itemUuid": "ITEM_UUID_PLACEHOLDER",
                    "itemId": "ITEM_ID_PLACEHOLDER",
                    "itemName": "ITEM_NAME_PLACEHOLDER",
                    "itemQuantity": "ITEM_QUANTITY_PLACEHOLDER"
                }
            ]
        }
    ],
    "pagination": {
        "records": RECORDS_PLACEHOLDER,
        "limit": LIMIT_PLACEHOLDER,
        "offset": OFFSET_PLACEHOLDER,
        "previousPage": "PREVIOUS_PAGE_PLACEHOLDER",
        "nextPage": "NEXT_PAGE_PLACEHOLDER"
    }
}

Getting Purchase Order Details

Function: purchase_order_details()

Purpose

This function allows user to retrieve the complete details of a specific purchase order by providing its unique purchase order identifier. It is typically used when validating purchase order data, displaying order information within applications, syncing order data with external systems, or performing accounting and procurement operations. The response returns all relevant attributes, including currency information, dates, line items, pricing snapshots, tax configurations, KPIs, and other metadata associated with the purchase order.

Parameters 

ParameterTypeDescription
purchase_order_idStringThe unique identifier of the purchase order whose details are to be retrieved. This must be a valid purchase order ID that already exists in the system.

Use Case

This function is used when a system or user needs to fetch the full details of a specific purchase order for validation, display, or integration purposes. For example, when building a procurement dashboard, an application may need to load all items, pricing information, tax details, and metadata associated with a purchase order. Similarly, QA testers may use this to validate that the order exists, verify field values, check correct handling of tax-inclusive pricing, and ensure nested structures such as KPIs, custom attributes, and line details are being returned correctly.

def purchase_order_details():
    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:
        response = exsited_sdk.purchase_order.details(id='{{PURCHASE_ORDER_ID}}')
        print(response)
        return response
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a complete purchase order object containing status, currency information, dates, totals, pricing details, line items, tax configurations, metadata, KPIs, and UUID references. Each nested object describes a specific portion of the purchase order such as item-level tax details, pricing snapshots, accounting codes, and custom attributes. This response structure ensures that integrators, developers, and testers have full visibility into every element of a purchase order for validation, automation, or system-to-system synchronization. The exact values shown below are placeholders and should be replaced with the real values returned from your environment.

PurchaseOrderDetailsDTO(
    purchaseOrder=PurchaseOrderDTO(
        status='{{STATUS}}',
        id='{{PURCHASE_ORDER_ID}}',
        currency=PurchaseOrderCurrencyDTO(
            uuid='{{CURRENCY_UUID}}',
            name='{{CURRENCY_NAME}}',
            link='{{CURRENCY_LINK}}'
        ),
        supplierInvoiceId='{{SUPPLIER_INVOICE_ID}}',
        saleOrderId='{{SALE_ORDER_ID}}',
        issueDate='{{ISSUE_DATE}}',
        dueDate='{{DUE_DATE}}',
        expectedCompletionDate='{{EXPECTED_COMPLETION_DATE}}',
        subtotal='{{SUBTOTAL}}',
        tax='{{TAX}}',
        total='{{TOTAL}}',
        priceTaxInclusive='{{PRICE_TAX_INCLUSIVE}}',
        purchaseOrderNote='{{PURCHASE_ORDER_NOTE}}',
        accountId='{{ACCOUNT_ID}}',
        createdBy='{{CREATED_BY}}',
        createdOn='{{CREATED_ON}}',
        lastUpdatedBy='{{LAST_UPDATED_BY}}',
        lastUpdatedOn='{{LAST_UPDATED_ON}}',
        uuid='{{PURCHASE_ORDER_UUID}}',
        version='{{VERSION}}',
        customAttributes=[],
        customObjects=[],
        lines=[
            PurchaseOrderLineDTO(
                subtotal='{{LINE_SUBTOTAL}}',
                total='{{LINE_TOTAL}}',
                tax='{{LINE_TAX}}',
                itemUuid='{{ITEM_UUID}}',
                itemId='{{ITEM_ID}}',
                itemName='{{ITEM_NAME}}',
                itemQuantity='{{ITEM_QUANTITY}}',
                itemOrderQuantity='{{ITEM_ORDER_QUANTITY}}',
                itemPriceSnapshot=PurchaseOrderItemPriceSnapshotDTO(
                    pricingRule=PurchaseOrderPricingRuleDTO(
                        uuid='{{PRICING_RULE_UUID}}',
                        version='{{PRICING_RULE_VERSION}}',
                        priceType='{{PRICE_TYPE}}',
                        price='{{PRICE}}',
                        uom='{{UOM}}',
                        warehouse='{{WAREHOUSE}}',
                        pricingVersion='{{PRICING_VERSION}}',
                        latestUsedPricingVersion='{{LATEST_USED_PRICING_VERSION}}'
                    )
                ),
                itemPurchaseTaxConfiguration=PurchaseOrderItemPurchaseTaxConfigurationDTO(
                    purchasePriceIsTaxInclusive='{{ITEM_TAX_INCLUSIVE}}',
                    taxCode=PurchaseOrderTaxCodeDTO(
                        uuid='{{TAX_CODE_UUID}}',
                        code='{{TAX_CODE}}',
                        rate='{{TAX_RATE}}',
                        link='{{TAX_LINK}}'
                    )
                ),
                itemPriceTaxExempt='{{ITEM_PRICE_TAX_EXEMPT}}',
                itemPriceTax=TaxDTO(
                    uuid='{{TAX_UUID}}',
                    code='{{TAX_CODE}}',
                    rate='{{TAX_RATE}}',
                    link='{{TAX_LINK}}',
                    amount='{{TAX_AMOUNT}}'
                ),
                purchaseOrderNote='{{LINE_NOTE}}',
                itemAccountingCode=PurchaseOrderItemAccountingCodeDTO(
                    costOfGoodsSold='{{COGS}}'
                ),
                op='{{OPERATION}}',
                uuid='{{LINE_UUID}}',
                version='{{LINE_VERSION}}',
                itemSerialOrBatchNumber='{{SERIAL_OR_BATCH}}',
                taxExemptWhenSold='{{TAX_EXEMPT_WHEN_SOLD}}'
            )
        ],
        kpis=KPIDTO(
            totalExpense='{{TOTAL_EXPENSE}}',
            estimatedTotal='{{ESTIMATED_TOTAL}}',
            totalOutstanding='{{TOTAL_OUTSTANDING}}',
            totalOverdue='{{TOTAL_OVERDUE}}',
            lastInvoiceIssueDate='{{LAST_INVOICE_ISSUE_DATE}}',
            lastInvoiceTotal='{{LAST_INVOICE_TOTAL}}',
            totalPurchaseInvoice='{{TOTAL_PURCHASE_INVOICE}}',
            lastReactivatedOn='{{LAST_REACTIVATED_ON}}',
            lastCalcelledOn='{{LAST_CANCELLED_ON}}',
            lastChangedOn='{{LAST_CHANGED_ON}}',
            lastDeletedOn='{{LAST_DELETED_ON}}',
            issueDate='{{KPI_ISSUE_DATE}}'
        )
    )
)

Deleting a Purchase Order

Function: purchase_order_delete()

Purpose

This function deletes a purchase order by its unique ID. It is implemented in both Python and PHP SDKs, allowing developers to seamlessly integrate deletion functionality into their applications. The function ensures that obsolete or incorrect purchase orders can be removed from the system, maintaining clean and accurate procurement records.

Parameters 

Parameter
Type
Description
order_id
String
The unique identifier of the purchase order to delete

Use Case

The function is used to remove a purchase order that is no longer valid, such as test data, duplicate entries, or incorrect records. By specifying the purchase order ID, the system executes a deletion request, ensuring that procurement and financial records remain consistent and up to date. This is particularly useful in workflows where maintaining accurate supplier and order data is critical.

def purchase_order_delete():
    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_order.delete(id='PURCHASE_ORDER_ID')
        print(response)
        return response
        # ResponseToObj().process(response=response["purchase_order"])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a simple object confirming the outcome of the deletion request. A successful deletion is indicated with 204 status code represents a successful operation with no content returned. If the deletion fails, the response will reflect the error state, allowing developers to handle exceptions appropriately.

{'success': True, 'status_code': 204}

Getting Purchase Order Information

Function: purchase_order_information()

Purpose

This function retrieves detailed information about a specific purchase order by its unique ID. It provides access to order metadata, supplier linkage, currency details, financial values, and notes, ensuring that procurement teams can accurately track and manage purchase orders.

Parameters 

Parameter
Type
Description
purchase_id
String
The unique identifier of the purchase order

Use Case

The function is used to review or validate the details of an existing purchase order. By specifying the purchase order ID, organizations can access information such as supplier invoice references, issue and due dates, expected completion dates, and financial metrics like subtotal, tax, and total. This supports procurement workflows, auditing, and compliance by ensuring visibility into the lifecycle of individual purchase orders.

def purchase_order_information():
    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_order.information(id='PURCHASE_ORDER_ID')
        print(response)
        return response
        # ResponseToObj().process(response=response["purchase_order"])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a object containing comprehensive details of the specified purchase order. It includes identifiers such as the purchase order ID and UUID, supplier account linkage, currency information, issue and due dates, and versioning metadata. Financial values such as subtotal, tax, and total are provided, along with flags for tax inclusivity and purchase order notes. Metadata fields like createdBy, createdOn, lastUpdatedBy, and lastUpdatedOn confirm the record’s history. In this case, line items.

PurchaseOrderDetailsDTO(
    purchaseOrder=PurchaseOrderDTO(
        status="PURCHASE_ORDER_STATUS",
        id="PURCHASE_ORDER_ID",
        currency=PurchaseOrderCurrencyDTO(
            uuid="CURRENCY_UUID",
            name="CURRENCY_NAME",
            link="CURRENCY_LINK"
        ),
        supplierInvoiceId="SUPPLIER_INVOICE_ID",
        issueDate="ISSUE_DATE",
        dueDate="DUE_DATE",
        expectedCompletionDate="EXPECTED_COMPLETION_DATE",
        subtotal="PURCHASE_ORDER_SUBTOTAL",
        tax="PURCHASE_ORDER_TAX",
        total="PURCHASE_ORDER_TOTAL",
        priceTaxInclusive="BOOLEAN",
        purchaseOrderNote="PURCHASE_ORDER_NOTE",
        accountId="ACCOUNT_ID",
        createdBy="CREATED_BY",
        createdOn="CREATED_TIMESTAMP",
        lastUpdatedBy="LAST_UPDATED_BY",
        lastUpdatedOn="LAST_UPDATED_TIMESTAMP",
        uuid="PURCHASE_ORDER_UUID",
        version="PURCHASE_ORDER_VERSION",
        customAttributes=[],
        customObjects=[],
        lines="PURCHASE_ORDER_LINES",
        kpis="PURCHASE_ORDER_KPIS"
    )
)

Canceling a Purchase Order

Function: purchase_order_cancel()

Purpose

This function cancels a specific purchase order using its unique identifier. It ensures that active or pending purchase orders can be terminated when no longer required, helping businesses maintain accurate procurement records and avoid processing unnecessary transactions.

Parameters

Parameter Type Description
purchase_order_id string The unique identifier of the purchase order to cancel.

Use Case

The function is used to cancel an existing purchase order that is either active or pending. Typical scenarios include supplier changes, incorrect order creation, or adjustments in procurement plans. By providing the purchase order ID, the system executes a cancellation request, ensuring that procurement workflows remain consistent and free from obsolete records.

def purchase_order_cancel():
    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_order.cancel(id="PURCHASE_ORDER_ID")
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a confirmation object indicating the outcome of the cancellation request. A successful cancellation is represented that the operation was successful and no content is returned. If the cancellation fails, the response will include an error message or status code, allowing developers and QA teams to handle exceptions appropriately.


{'success': True, 'status_code': 204}

Reactivating a Purchase Order

Function: purchase_order_reactivate()

Purpose

This function reactivates a previously canceled purchase order using its unique identifier. It ensures that purchase orders which were terminated can be restored to an active state, allowing businesses to continue processing transactions or managing procurement workflows without needing to recreate the order.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order to reactivate.

Use Case

The function is used to bring a canceled purchase order back into circulation. Typical scenarios include reinstating an order after supplier confirmation, correcting accidental cancellations, or resuming procurement processes that were paused. By specifying the purchase order ID, the system reactivates the order, enabling further updates, invoicing, or fulfillment activities.

def purchase_order_reactivate():
    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_order.reactivate(id="PURCHASE_ORDER_ID")
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns a confirmation object indicating the outcome of the reactivation request. A successful reactivation is represented that the operation was successful and no content is returned. If the reactivation fails, the response will include an error message or status code, allowing developers and QA teams to handle exceptions appropriately.

{'success': True, 'status_code': 204}

Getting Specific Line Details of a Purchase order

Function: purchase_order_line_details()

Purpose

Retrieves detailed information about a specific line item within a purchase order using its unique line UUID. This allows you to review the exact status, pricing, quantities, and related metadata of a particular line in the purchase order.

Parameters

Parameter
Type
Description
purchase_order_id
String
The unique identifier of the purchase order
line_uuid
String
The unique line UUID associated with the order

Use Case

Use this function when you need to inspect or verify the details of a specific line in a purchase order. For example, a retailer might need to confirm pricing, quantity, item specifications, or other key attributes before processing a shipment or updating inventory. This can also help in identifying discrepancies in a complex order where multiple items, custom attributes, or special conditions are involved, ensuring that each line is accurately managed and accounted for in operational workflows.

def purchase_order_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_order.line_uuid(id='PURCHASE_ORDER_ID', uuid='LINE_UUID')
        print(response)
        return response
        # ResponseToObj().process(response=response["purchase_order"])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

A response object containing the detailed information for the specified purchase order line, including item details, pricing, and any associated attributes.

PurchaseOrderLineUuidDetailsDTO(
    purchaseOrder=PurchaseOrderLineUuidDTO(
        line=PurchaseOrderLineDTO(
            subtotal='subtotal',
            total='total',
            tax='tax',
            itemUuid='item_uuid',
            itemId='item_id',
            itemName='item_name',
            itemQuantity='item_quantity',
            itemOrderQuantity='item_order_quantity',
            itemPriceSnapshot=PurchaseOrderItemPriceSnapshotDTO(
                pricingRule=PurchaseOrderPricingRuleDTO(
                    uuid='pricing_rule_uuid',
                    version='pricing_rule_version',
                    priceType='price_type',
                    price='price',
                    uom='unit_of_measure',
                    warehouse='warehouse',
                    pricingVersion='pricing_version',
                    latestUsedPricingVersion='latest_used_pricing_version'
                )
            ),
            itemPurchaseTaxConfiguration=PurchaseOrderItemPurchaseTaxConfigurationDTO(
                purchasePriceIsTaxInclusive='is_tax_inclusive',
                taxCode=PurchaseOrderTaxCodeDTO(
                    uuid='tax_code_uuid',
                    code='tax_code',
                    rate='tax_rate',
                    link='tax_code_link'
                )
            ),
            itemPriceTaxExempt='item_price_tax_exempt',
            itemPriceTax=TaxDTO(
                uuid='tax_uuid',
                code='tax_code',
                rate='tax_rate',
                link='tax_link',
                amount='tax_amount'
            ),
            purchaseOrderNote='purchase_order_note',
            itemAccountingCode=PurchaseOrderItemAccountingCodeDTO(
                costOfGoodsSold='cogs_code'
            ),
            op='operation',
            uuid='purchase_order_line_uuid',
            version='version',
            itemSerialOrBatchNumber='serial_or_batch_number',
            taxExemptWhenSold='tax_exempt_when_sold'
        )
    )
)

Getting Purchase Order Line

Function: purchase_order_line()

Purpose

This function is designed to test the retrieval of detailed information about one or more lines within a purchase order. It allows developers or system integrators to ensure that the SDK or service layer correctly fetches the line-level data associated with a specific purchase order ID. This function is essential for verifying the integration and accurate data retrieval from the backend system for use cases such as validating line items, pricing details, quantities, tax configurations, or any related metadata required for processing or analysis. The function ensures smooth operational workflows by identifying potential discrepancies in purchase orders or their lines before they impact downstream processes like inventory updates, shipment handling, or financial reconciliation.

Parameters

Parameter
Type
Description
purchase_order_id String
The unique identifier of the purchase order

Use Case

Use this function when you need to confirm that the integration for retrieving line-level details of a purchase order is functioning as expected. For example, during a system integration test, developers might use this to verify that line items' pricing, tax configurations, and quantities are accurately retrieved and match expected values in the backend database.

def purchase_order_line():
    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_order.po_line(id='purchase_order_id')
        print(response)
        return response
        # ResponseToObj().process(response=response["purchase_order"])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

A response object containing the detailed information for the specified lines in the purchase order, including item details, pricing, quantities, tax configurations, and other associated metadata.

PurchaseOrderDetailsDTO(
    purchaseOrder=PurchaseOrderDTO(
        status="PURCHASE_ORDER_STATUS",
        id="PURCHASE_ORDER_ID",
        currency="PURCHASE_ORDER_CURRENCY",
        supplierInvoiceId="SUPPLIER_INVOICE_ID",
        issueDate="ISSUE_DATE",
        dueDate="DUE_DATE",
        expectedCompletionDate="EXPECTED_COMPLETION_DATE",
        subtotal="PURCHASE_ORDER_SUBTOTAL",
        tax="PURCHASE_ORDER_TAX",
        total="PURCHASE_ORDER_TOTAL",
        priceTaxInclusive="BOOLEAN",
        purchaseOrderNote="PURCHASE_ORDER_NOTE",
        accountId="ACCOUNT_ID",
        createdBy="CREATED_BY",
        createdOn="CREATED_TIMESTAMP",
        lastUpdatedBy="LAST_UPDATED_BY",
        lastUpdatedOn="LAST_UPDATED_TIMESTAMP",
        uuid="PURCHASE_ORDER_UUID",
        version="PURCHASE_ORDER_VERSION",
        customAttributes="CUSTOM_ATTRIBUTES",
        customObjects="CUSTOM_OBJECTS",
        lines=[
            PurchaseOrderLineDTO(
                subtotal="LINE_SUBTOTAL",
                total="LINE_TOTAL",
                tax="LINE_TAX",
                itemUuid="ITEM_UUID",
                itemId="ITEM_ID",
                itemName="ITEM_NAME",
                itemQuantity="ITEM_QUANTITY",
                itemPriceSnapshot=PurchaseOrderItemPriceSnapshotDTO(
                    pricingRule=PurchaseOrderPricingRuleDTO(
                        uuid="PRICING_RULE_UUID",
                        version="PRICING_RULE_VERSION",
                        priceType="PRICE_TYPE",
                        price="ITEM_PRICE",
                        uom="UOM",
                        warehouse="WAREHOUSE",
                        pricingVersion="PRICING_VERSION",
                        latestUsedPricingVersion="LATEST_USED_PRICING_VERSION"
                    )
                ),
                itemPurchaseTaxConfiguration=PurchaseOrderItemPurchaseTaxConfigurationDTO(
                    purchasePriceIsTaxInclusive="BOOLEAN",
                    taxCode=PurchaseOrderTaxCodeDTO(
                        uuid="TAX_CODE_UUID",
                        code="TAX_CODE",
                        rate="TAX_RATE",
                        link="TAX_LINK"
                    )
                ),
                itemPriceTaxExempt="BOOLEAN",
                itemPriceTax=TaxDTO(
                    uuid="TAX_UUID",
                    code="TAX_CODE",
                    rate="TAX_RATE",
                    link="TAX_LINK",
                    amount="TAX_AMOUNT"
                ),
                purchaseOrderNote="LINE_NOTE",
                itemAccountingCode=PurchaseOrderItemAccountingCodeDTO(
                    costOfGoodsSold="COGS"
                ),
                uuid="LINE_UUID",
                version="LINE_VERSION",
                itemSerialOrBatchNumber="SERIAL_OR_BATCH"
            )
        ],
        kpis="PURCHASE_ORDER_KPIS"
    )
)

Creating Purchase Order Note

Function: create_purchase_order_note()

Purpose

This SDK method allows you to add a note (with or without file attachments) to a purchase order. Notes can contain text details such as comments, instructions, or approval remarks, and optionally include supporting documents like scanned purchase orders, supplier communication, or receipts. This provides a reliable way to capture and manage contextual information alongside financial records for better traceability and collaboration.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order to which the note will be added.
datas string The content of the note (text message, comment, or description).
file_urls / filePaths array (Python) / string (PHP) One or more file paths or URLs to be attached with the note.

Use Case

This method is commonly used when businesses need to document additional context or approvals related to a purchase order. For example, a procurement officer might attach the supplier’s confirmation email and add a note stating that the order is approved for processing. Similarly, supporting files such as scanned receipts or supplier contracts can be uploaded with the note for future auditing. This ensures that critical decision-making information is recorded directly with the purchase order, improving accountability and compliance.

def create_purchase_order_note():
    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:
        datas = "This is a test note for purchase order."
        file_urls = [
            "FILE_PATH"
        ]

        response = exsited_sdk.notes.purchase_order_add_notes(
            file_urls=file_urls,
            datas=datas,
            purchase_order_id="PURCHASE_ORDER_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-order object containing a notes element with the UUID of the newly created note. This UUID acts as a unique reference for the added note and can be used to fetch, update, or manage the note later. If files are attached, they are linked with the note for retrieval in subsequent API calls. This ensures that both textual and file based information are securely recorded with the purchase order, enabling complete audit trails and seamless collaboration.

PurchaseOrderNoteResponseDetailsDTO(
    purchaseOrder=None
)

Getting All Notes for a Purchase Order

Function: purchase_order_notes()

Purpose

This API retrieves all notes attached to a specific purchase order. Each note may contain textual content, metadata (such as who created or last updated it), versioning details, and optionally attached files. The endpoint also returns pagination information to handle scenarios where multiple notes are linked to the same purchase order. This is essential for purchase order lifecycle tracking, where comments, approvals, clarifications, and supporting documents need to be stored and retrieved for audit and operational purposes.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order whose notes are to be retrieved.

Use Case

In real-world procurement workflows, purchase orders often go through multiple stakeholders, such as procurement officers, managers, and suppliers. Each stakeholder may add notes  for example, clarifications about quantities, approvals from management, or attached files like supplier quotations and compliance certificates. Instead of managing this information externally, organizations can use this endpoint to retrieve all related notes in one call, providing a complete history of communications and document attachments linked to the purchase order. This supports audit trails, reduces miscommunication, and ensures that all purchase-related documentation is centralized and easily accessible.

def purchase_order_notes():
    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.notes.purchase_order_note_details(
            id="purchase_order_id"
        )
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

On success, the API returns a purchase_order object containing an array of notes. Each note object includes its unique identifier (uuid), versioning information, rich-text content (HTML-supported), any attached files (with their own UUID, name, and version), and audit metadata such as who created or last updated the note and when. Additionally, the response includes a pagination object that provides metadata about the number of records, limits, offsets, and pagination links. This structure ensures that even when multiple notes exist for a purchase order, applications can manage them efficiently with clear visibility of history and attachments.

PurchaseOrderDetailsDTO(
    purchaseOrder=PurchaseOrderNoteDataDTO(
        notes=[
            NoteDataDTO(
                uuid='NOTE_UUID',
                version='VERSION_NUMBER',
                content='NOTE_CONTENT',
                files=[
                    FileDTO(
                        uuid='FILE_UUID',
                        name='FILE_NAME',
                        version='FILE_VERSION'
                    )
                ],
                createdBy='CREATED_BY',
                createdOn='CREATED_ON_TIMESTAMP',
                lastUpdatedBy='LAST_UPDATED_BY',
                lastUpdatedOn='LAST_UPDATED_ON_TIMESTAMP'
            )
        ],
        pagination=PaginationDTO(
            records='TOTAL_RECORDS',
            limit='PAGE_LIMIT',
            offset='PAGE_OFFSET',
            previousPage='PREVIOUS_PAGE_URL',
            nextPage='NEXT_PAGE_URL'
        )
    )
)

Getting Purchase Order Note Details

Function: purchase_order_note_details()

Purpose

This function retrieves the details of a single note attached to a purchase order. The note object contains information such as its unique identifier(uuid), version, HTML-supported content, attached files, and audit metadata (who created/updated it and when). This is particularly useful when an application needs to display or process a specific note without fetching all notes for a purchase order.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order.
NOTE_UUID string Unique identifier of the note to be retrieved.

Use Case

In procurement workflows, individual notes often contain important instructions, supplier clarifications, or internal approvals. While a purchase order may have multiple notes, sometimes a system needs to fetch details of a specific note  for example, showing the latest clarification added by a supplier or checking an attached file for compliance. This function provides direct access to that note’s full details, including attachments and metadata, without retrieving all purchase order notes.

def purchase_order_note_details():
    SDKConfig.PRINT_REQUEST_DATA = False
    SDKConfig.PRINT_RAW_RESPONSE = False

    token_file_path = "shared_token.json"
    file_token_mgr = FileTokenManager(token_file_path)

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        response = exsited_sdk.notes.purchase_order_note_uuid_details(
            id="purchase_order_id",
            uuid="note_uuid"
        )
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

On success, the function returns a purchase_order object containing a single note. This note includes its UUID, version, content (HTML-supported), optional file attachments (each with its own UUID, name, and version), and audit fields such as created_by, created_on, last_updated_by, and last_updated_on. The custom_attributes field is provided for client-defined metadata. This makes it easy to track note ownership, review attached files, and maintain compliance/audit records for the purchase order.

PurchaseOrderNoteUuidDetailsDTO(
    purchaseOrder=PurchaseOrderNoteUuidDataDTO(
        note=NoteDataDTO(
            uuid='note_uuid',
            version='note_version',
            content='<p>note_content</p>',
            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 of a Purchase Order Note

Function: purchase_order_note_files()

Purpose

This function retrieves all files attached to a specific note within a purchase order. Each file object includes metadata such as UUID, filename, and version. This is useful when notes contain supporting documents, images, or compliance-related attachments that need to be displayed, downloaded, or processed.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order.
NOTE_UUID string Unique identifier of the note whose files are being retrieved.

Use Case

In many procurement processes, users attach important files (such as invoices, compliance certificates, delivery confirmations, or supplier communications) to notes within a purchase order. Instead of fetching all notes and filtering files manually, this function allows applications to retrieve just the files of a specific note. For example, if a supplier attaches a product quality certificate to a purchase order note, the system can fetch it directly using this endpoint.

def purchase_order_note_files():
    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.notes.purchase_order_note_uuid_files_details(
            id="purchase_order_id",
            uuid="note_uuid"
        )
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

On success, the function returns a purchase_order object containing a single note, which holds an array of files. Each file entry provides the UUID (for identification and retrieval), file name, and version (for version tracking). The custom_attributes array is available for client-defined metadata. This makes it simple to list and manage all attachments of a specific note without scanning all purchase order notes.

PurchaseOrderUuidFileDetailsDTO(
    purchaseOrder=PurchaseOrderUuidFileDataDTO(
        note=NoteFileDataDTO(
            files=[
                FileDTO(
                    uuid='file_uuid',
                    name='file_name',
                    version='file_version'
                )
            ]
        )
    )
)

Getting a Specific File of a Purchase Order Note

Function: purchase_order_note_file_details()

Purpose

This function retrieves details of a single file attached to a specific note within a purchase order. It is useful for fetching metadata (UUID, name, version) of a particular file, typically when the user selects a file from a note for preview, download, or validation.

Parameters

Parameter Type Description
purchase_order_id string Unique identifier of the purchase order.
NOTE_UUID string Unique identifier of the note containing the file.
FILE_UUID string Unique identifier of the file to be retrieved.

Use Case

When users attach multiple files to a purchase order note, sometimes only a specific file needs to be accessed (example: downloading an invoice PDF, verifying a compliance certificate, or retrieving a product image). Instead of listing all files and filtering manually, this function directly fetches the details of the file by its UUID.

def purchase_order_note_file_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.notes.purchase_order_note_uuid_files_uuid_details(
            id="purchase_order_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 function returns a purchase_order object containing a note, which includes the requested file. The file object provides its UUID (for identification), name (usually filename with extension), and version (for tracking different versions of the file). An empty custom_attributes array is included for extensibility if client-defined metadata is needed.

PurchaseOrderNoteUuidFileUuidDetailsDTO(
    purchaseOrder=PurchaseOrderNoteUuidFileUuidDataDTO(
        note=NoteFileUuidDataDTO(
            file=FileDTO(
                uuid='file_uuid',
                name='file_name',
                version='file_version'
            )
        )
    )
)