» Purchase Payment Module SDK Documentation

Getting Purchase Payment List

Function: purchase_payment_list()

Purpose

This SDK function retrieves a paginated list of all purchase payments recorded in the system. It returns detailed information for each payment including the payment identifier, applied amounts, associated purchase orders and invoices, credit applications, timestamps, versioning, and any configured custom attributes or custom objects. This endpoint is typically used in financial reconciliation, supplier payment auditing, accounts payable workflows, and reporting dashboards where visibility into payment activity is required.

Parameters

ParameterTypeDescription
limitintegerOptional. Number of purchase payment records to return per page.
offsetintegerOptional. Starting index for paginated results.

Use Case

This function is used whenever a system needs to fetch a complete or filtered list of purchase payments for finance, auditing, reporting, or dashboard display. For example, an accounts payable officer may need to quickly review all payments made within a selected month, identify which invoices have been fully or partially paid, or confirm credit applications applied against supplier balances. Developers can use the Python or PHP SDK to fetch these payment records without constructing complex API calls manually.

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

Response

The response returns a structured list of purchase payment records, each containing status, IDs, payment dates, total applied amounts, related purchase orders, notes, and arrays describing payment applications, applied credits, and invoice associations. Metadata such as createdBy, createdOn, lastUpdatedOn, version, and UUID are included for audit and tracking purposes. Pagination data is also returned to allow smooth browsing through large result sets.

{
    "purchasePayments": [
        {
            "status": "STATUS_PLACEHOLDER",
            "id": "PURCHASE_PAYMENT_ID_PLACEHOLDER",
            "purchasePaymentDate": "PAYMENT_DATE_PLACEHOLDER",
            "totalApplied": "TOTAL_APPLIED_PLACEHOLDER",
            "purchaseOrderId": "PURCHASE_ORDER_ID_PLACEHOLDER",
            "purchasePaymentNote": "PURCHASE_PAYMENT_NOTE_PLACEHOLDER",
            "purchasePaymentApplied": [
                {
                    "id": PAYMENT_APPLIED_ID_PLACEHOLDER,
                    "amount": PAYMENT_APPLIED_AMOUNT_PLACEHOLDER,
                    "method": "PAYMENT_METHOD_PLACEHOLDER",
                    "processor": "PAYMENT_PROCESSOR_PLACEHOLDER",
                    "reference": "PAYMENT_REFERENCE_PLACEHOLDER"
                }
            ],
            "purchaseCreditApplied": [
                {
                    "id": "PURCHASE_CREDIT_ID_PLACEHOLDER",
                    "amount": PURCHASE_CREDIT_AMOUNT_PLACEHOLDER
                }
            ],
            "purchaseInvoices": [
                {
                    "applied": INVOICE_APPLIED_AMOUNT_PLACEHOLDER,
                    "id": "INVOICE_ID_PLACEHOLDER",
                    "dueDate": "INVOICE_DUE_DATE_PLACEHOLDER",
                    "issueDate": "INVOICE_ISSUE_DATE_PLACEHOLDER",
                    "outstanding": OUTSTANDING_AMOUNT_PLACEHOLDER,
                    "total": INVOICE_TOTAL_PLACEHOLDER
                }
            ],
            "createdBy": "CREATED_BY_PLACEHOLDER",
            "createdOn": "CREATED_ON_PLACEHOLDER",
            "lastUpdatedBy": "LAST_UPDATED_BY_PLACEHOLDER",
            "lastUpdatedOn": "LAST_UPDATED_ON_PLACEHOLDER",
            "uuid": "UUID_PLACEHOLDER",
            "version": "VERSION_PLACEHOLDER",
            "customAttributes": [],
            "customObjects": []
        }
    ],
    "pagination": {
        "records": RECORDS_PLACEHOLDER,
        "limit": LIMIT_PLACEHOLDER,
        "offset": OFFSET_PLACEHOLDER,
        "previousPage": "PREVIOUS_PAGE_PLACEHOLDER",
        "nextPage": "NEXT_PAGE_PLACEHOLDER"
    }
}

Getting Purchase Payment Details

Function: purchase_payment_details()

Purpose

This SDK function retrieves detailed information for a specific purchase payment by its unique identifier. It is used to fetch all relevant data about a single purchase payment record, including applied amounts, associated purchase orders and invoices, credits, timestamps, custom attributes, and audit metadata. This endpoint is typically used when displaying a purchase payment profile screen, performing payment verification, or validating a payment before applying updates or allocating credits.

Parameters

ParameterTypeDescription
payment_idstringRequired. The unique purchase payment ID to retrieve details for.

Use Case

This function is used when a system needs full detail of a specific purchase payment rather than a list. For example, a finance officer may open a payment record to verify the applied amounts, check which invoices were paid, or confirm audit details such as who created or last updated the payment. Developers use this endpoint when retrieving data for a single payment prior to editing, reconciling, or integrating with external accounting systems.

def purchase_payment_details():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True

    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_payments.details(id='PPT-B38IXX-0024')
        print(response)
        return response
        # ResponseToObj().process(response=response["purchase_payment"])
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response returns the detailed purchase payment record, including status, identifiers, payment dates, applied amounts, related purchase orders, credit applications, invoice associations, custom attributes, objects, and audit fields. If no matching record is found, the SDK may return an empty or null structure.

{
    "purchasePayments": {
        "status": "STATUS_PLACEHOLDER",
        "id": "PURCHASE_PAYMENT_ID_PLACEHOLDER",
        "purchasePaymentDate": "PAYMENT_DATE_PLACEHOLDER",
        "totalApplied": "TOTAL_APPLIED_PLACEHOLDER",
        "purchaseOrderId": "PURCHASE_ORDER_ID_PLACEHOLDER",
        "purchasePaymentNote": "PURCHASE_PAYMENT_NOTE_PLACEHOLDER",
        "purchasePaymentApplied": [
            {
                "id": PAYMENT_APPLIED_ID_PLACEHOLDER,
                "amount": PAYMENT_APPLIED_AMOUNT_PLACEHOLDER,
                "method": "PAYMENT_METHOD_PLACEHOLDER",
                "processor": "PAYMENT_PROCESSOR_PLACEHOLDER",
                "reference": "PAYMENT_REFERENCE_PLACEHOLDER"
            }
        ],
        "purchaseCreditApplied": [
            {
                "id": "PURCHASE_CREDIT_ID_PLACEHOLDER",
                "amount": PURCHASE_CREDIT_AMOUNT_PLACEHOLDER
            }
        ],
        "purchaseInvoices": [
            {
                "applied": INVOICE_APPLIED_AMOUNT_PLACEHOLDER,
                "id": "INVOICE_ID_PLACEHOLDER",
                "dueDate": "INVOICE_DUE_DATE_PLACEHOLDER",
                "issueDate": "INVOICE_ISSUE_DATE_PLACEHOLDER",
                "outstanding": OUTSTANDING_AMOUNT_PLACEHOLDER,
                "total": INVOICE_TOTAL_PLACEHOLDER
            }
        ],
        "createdBy": "CREATED_BY_PLACEHOLDER",
        "createdOn": "CREATED_ON_PLACEHOLDER",
        "lastUpdatedBy": "LAST_UPDATED_BY_PLACEHOLDER",
        "lastUpdatedOn": "LAST_UPDATED_ON_PLACEHOLDER",
        "uuid": "UUID_PLACEHOLDER",
        "version": "VERSION_PLACEHOLDER",
        "customAttributes": [],
        "customObjects": []
    }
}

Getting Purchase Payments From Purchase Order

Function: purchase_payment_from_purchase_order()

Purpose

This function allows developers to retrieve all purchase payments associated with a specific purchase order using its unique purchase order ID. It helps users obtain a complete list of payments applied to the purchase order, including details such as payment amount, payment method, processor, applied invoices, timestamps, identifiers, and related metadata. This API is commonly used in scenarios where financial reconciliation, audit tracking, or payment validation workflows are required.

Parameters

ParameterTypeDescription
purchase_order_idstringRequired. The unique purchase order ID to retrieve details for.

Use Case

This function is used when a system needs to view all payments applied to a specific purchase order for reconciliation or validation. For example, an accounts payable module may need to ensure that all payments recorded for a purchase order align with internal financial systems. By providing the purchase order ID, the SDK retrieves a list of all purchase payments, including metadata such as method, processor, applied invoices, amounts applied, and creation details. This helps QA engineers, accountants, or integration systems validate financial correctness and trace transaction histories. 

def purchase_payment_from_purchase_order():
    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().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        response = exsited_sdk.purchase_payments.get_from_purchase_order(id="PURCHASE_ORDER_ID_PLACEHOLDER")
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The function returns all purchase payments linked to the specified purchase order. It includes a list of payments, each with details such as payment ID, applied amount, method, processor, notes, associated invoices, timestamps, and custom data. This allows developers and QA testers to validate financial consistency, track transactional changes, and audit past activities. A pagination object is also included to support long lists. 

PurchaseOrderPaymentResponseDTO(
    purchaseOrder=PurchasePaymentsListDTO(
        purchasePayments=[
            PurchasePaymentDTO(
                status="STATUS_PLACEHOLDER",
                id="PURCHASE_PAYMENT_ID_PLACEHOLDER",
                purchasePaymentDate="PURCHASE_PAYMENT_DATE_PLACEHOLDER",
                totalApplied="TOTAL_APPLIED_PLACEHOLDER",
                purchaseOrderId="PURCHASE_ORDER_ID_PLACEHOLDER",
                purchasePaymentNote="NOTE_PLACEHOLDER",
                purchasePaymentApplied=[
                    PurchasePaymentAppliedDTO(
                        id=0,
                        amount=0.0,
                        method="METHOD_PLACEHOLDER",
                        processor="PROCESSOR_PLACEHOLDER",
                        reference="REFERENCE_PLACEHOLDER"
                    )
                ],
                purchaseCreditApplied=[],
                purchaseInvoices=[
                    PurchaseInvoiceDTO(
                        applied=0.0,
                        id="INVOICE_ID_PLACEHOLDER",
                        dueDate="DUE_DATE_PLACEHOLDER",
                        issueDate="ISSUE_DATE_PLACEHOLDER",
                        outstanding=0.0,
                        total=0.0,
                        amount=None
                    )
                ],
                createdBy="CREATED_BY_PLACEHOLDER",
                createdOn="CREATED_ON_PLACEHOLDER",
                lastUpdatedBy="UPDATED_BY_PLACEHOLDER",
                lastUpdatedOn="UPDATED_ON_PLACEHOLDER",
                uuid="UUID_PLACEHOLDER",
                version="VERSION_PLACEHOLDER",
                customAttributes=[],
                customObjects=[],
                date=None,
                note=None,
                effectiveDate=None
            )
        ],
        pagination=PaginationDTO(
            records=1,
            limit=20,
            offset=0,
            previousPage="",
            nextPage="NULL"
        )
    )
)

Deleting Purchase Payment

Function: purchase_payment_delete()

Purpose

This function allows the deletion of an existing purchase payment using its unique purchase payment ID. It is typically used when a payment was recorded by mistake, needs to be voided, or must be removed during QA testing or financial correction workflows. The deletion operation permanently removes the purchase payment record and returns a confirmation response indicating whether the deletion was successful.

Parameters

Parameter
Type
Description
purchase_payment_id
String
Required. The unique purchase payment ID to retrieve details for.

Use Case

This function is used when a system needs to remove an incorrect or unwanted purchase payment entry from the platform. For example, during financial reconciliation or QA testing, a payment may be found to have incorrect values, duplicate entries, or failed validations. Instead of updating it, the user may choose to delete the record completely. By providing the purchase payment ID, the SDK triggers the deletion request and returns a result indicating whether the action succeeded.

def purchase_payment_delete():
    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().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        response = exsited_sdk.purchase_payments.delete(purchase_payment_id="PURCHASE_PAYMENT_ID_PLACEHOLDER")
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response indicates whether the purchase payment was successfully deleted. A successful deletion generally returns a boolean success flag and an HTTP status code of 204, meaning the server processed the request and the resource was removed. This helps QA testers, financial controllers, and automated workflows confirm that the target payment no longer exists in the system.

{
    "success": true,
    "status_code": 204
}