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
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional. Number of purchase payment records to return per page. |
| offset | integer | Optional. 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
| Parameter | Type | Description |
|---|
| payment_id | string | Required. 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
| Parameter | Type | Description |
|---|
| purchase_order_id | string | Required. 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
}
Getting Purchase Payments by Account
Function: get_from_account()
Purpose
This API retrieves all purchase payments associated with a specific account (supplier/vendor). Each payment in the response includes its status, id, purchasePaymentDate, totalApplied, purchaseOrderId, purchasePaymentNote, payment methods applied (processor, amount, reference), associated invoices (id, dueDate, issueDate, outstanding, total, applied), and audit fields. The response wraps the payment list with pagination metadata for navigating large result sets. This is essential for vendor management and accounts payable workflows where finance teams need to review the complete payment history for a supplier, track outstanding balances, reconcile payments against invoices, and generate vendor spend reports.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| id | String | The unique ID of the account whose purchase payments are to be retrieved. |
Use Case
In accounts payable operations, finance teams regularly need to review all payments made to a specific supplier. A payment officer may need to verify that all outstanding invoices for a vendor have been paid, a controller may need to reconcile total payments against the vendor's statement, or a procurement manager may need to evaluate the payment history as part of a vendor performance review. During audits, the complete payment history for an account provides evidence that payments were made on time, for the correct amounts, and through authorized payment methods. This endpoint provides that consolidated view in a single call, with pagination support for vendors with extensive payment histories, eliminating the need to manually aggregate payment data from multiple sources.
def test_get_purchase_payment_from_account():
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.purchase_payments.get_from_account(id="ACC-OJ1FWL-CA")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns an account object containing a paginated list of purchase payments for the specified account. Each payment includes its status, id, purchasePaymentDate, totalApplied, purchaseOrderId, and purchasePaymentNote. The purchasePaymentApplied array details each payment method used (id, amount, method, processor, reference), while the purchaseInvoices array shows which invoices the payment was applied to (id, dueDate, issueDate, outstanding, total, applied). Audit fields such as createdBy, createdOn, lastUpdatedBy, lastUpdatedOn, uuid, and version are provided for tracking. Pagination metadata (records, limit, offset, previousPage, nextPage) is included for navigating large result sets. This makes it easy to review a supplier's full payment history, reconcile account balances, and audit payment activity.
PurchaseAccountPaymentResponseDTO(
account=PurchasePaymentsListDTO(
purchasePayments=[
PurchasePaymentDTO(
status='PAYMENT_STATUS',
id='PAYMENT_ID',
purchasePaymentDate='PAYMENT_DATE',
totalApplied='TOTAL_APPLIED',
purchaseOrderId='PURCHASE_ORDER_ID',
purchasePaymentNote='PAYMENT_NOTE',
purchasePaymentApplied=[
PurchasePaymentAppliedDTO(
id='APPLIED_ID',
amount='APPLIED_AMOUNT',
method='PAYMENT_METHOD',
processor='PAYMENT_PROCESSOR',
reference='PAYMENT_REFERENCE'
)
],
purchaseInvoices=[
PurchaseInvoiceDTO(
id='INVOICE_ID',
dueDate='DUE_DATE',
issueDate='ISSUE_DATE',
outstanding=OUTSTANDING_AMOUNT,
total=TOTAL_AMOUNT,
applied=APPLIED_AMOUNT
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='PAYMENT_UUID',
version='PAYMENT_VERSION'
)
],
pagination=PaginationDTO(
records=PAGINATION_RECORDS,
limit=PAGINATION_LIMIT,
offset=PAGINATION_OFFSET,
previousPage=PAGINATION_PREVIOUS_PAGE,
nextPage=PAGINATION_NEXT_PAGE
)
)
)
Creating a Purchase Payment
Function: create()
Purpose
This API creates a new purchase payment and applies it to one or more purchase invoices. The request accepts the payment date, an optional note, an effective date, a purchaseInvoices array specifying which invoices to pay and the amounts to apply, and a purchasePaymentApplied array detailing the payment methods used (processor, amount, reference). The system records the payment, updates invoice balances accordingly, and returns the fully populated payment object with its generated id, calculated totalApplied, and audit fields. This is the core payment recording operation in the accounts payable lifecycle, supporting scenarios where payments are applied across multiple invoices through various payment methods.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| request_data | PurchasePaymentRequestDTO | The payment creation payload containing payment details. |
Use Case
In accounts payable operations, payments are the final step in the procurement-to-payment lifecycle. A finance officer may need to record a bank transfer that settles multiple supplier invoices at once, specifying the exact amount applied to each invoice. A payment processor may handle part of the amount via credit card and part via bank transfer, requiring multiple payment method entries. Some payments may be partial, leaving an outstanding balance on the invoice for future settlement. This endpoint supports all these scenarios by allowing flexible invoice-to-payment mapping and multiple payment method entries in a single call. The effective date ensures the payment is recorded in the correct accounting period, and the returned payment object provides immediate confirmation of what was applied and how.
def test_purchase_payment_create():
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:
request_data = PurchasePaymentRequestDTO(
purchasePayment=PurchasePaymentDTO(
date="2025-05-18",
note="This is a Note",
effectiveDate="2025-05-18",
purchaseInvoices=[PurchaseInvoiceDTO(
id="PI-7475XV-0011",
amount="1.00"
)],
purchasePaymentApplied=[PurchasePaymentAppliedDTO(
processor="Cash",
amount="1.00",
reference="ehdasged_2025"
)]
)
)
response = exsited_sdk.purchase_payments.create(request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_payment object containing the newly created payment. The response includes the generated id, status, purchasePaymentDate, and totalApplied. The purchasePaymentApplied array details each payment method used (id, amount, processor, reference), while the purchaseInvoices array shows which invoices the payment was applied to (id, amount). Audit fields such as createdBy, createdOn, uuid, and version are provided for tracking and concurrency control. This makes it easy to confirm the payment was recorded correctly, verify the amounts applied to each invoice, and retrieve the system-generated payment identifier for future reference.
PurchasePaymentResponseDTO(
purchasePayment=PurchasePaymentDTO(
status='PAYMENT_STATUS',
id='PAYMENT_ID',
purchasePaymentDate='PAYMENT_DATE',
totalApplied='TOTAL_APPLIED',
purchasePaymentApplied=[
PurchasePaymentAppliedDTO(
id='APPLIED_ID',
amount='APPLIED_AMOUNT',
processor='PAYMENT_PROCESSOR',
reference='PAYMENT_REFERENCE'
)
],
purchaseInvoices=[
PurchaseInvoiceDTO(
id='INVOICE_ID',
amount='APPLIED_AMOUNT'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='PAYMENT_UUID',
version='PAYMENT_VERSION'
)
)
Creating a Purchase Payment from Purchase Invoice
Function: create_from_purchase_invoice()
Purpose
This API creates a new purchase payment directly linked to a specific purchase invoice. The request accepts the purchase invoice ID along with payment details including the date, note, effective date, and a purchasePaymentApplied array specifying the payment methods and amounts. Since the payment is created in the context of a specific invoice, the invoice association is handled automatically by the system. The response returns the fully populated payment object with its generated id, totalApplied, payment method details, and audit fields. This is useful for straightforward payment scenarios where a payment is being made against a single, known invoice.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_invoice_id | String | The unique ID of the purchase invoice to pay. |
| request_data | PurchasePaymentRequestDTO | The payment creation payload containing payment details. |
Use Case
In many accounts payable workflows, payments are made against individual invoices rather than in bulk. For example, a finance officer may process a payment for a single invoice upon receiving a delivery confirmation, or make a partial payment against a large invoice as part of a staged payment agreement. When processing payments through automated systems or payment gateways, the payment is often triggered by a specific invoice approval event. This endpoint simplifies these scenarios by automatically linking the payment to the target invoice, eliminating the need to specify the invoice in the payment body. The payment method flexibility (processor, amount, reference) supports various payment channels including bank transfers, credit cards, and cash, ensuring the payment is recorded exactly as it was processed.
def test_create_purchase_payment_from_purchase_invoice():
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:
request_data = PurchasePaymentRequestDTO(
purchasePayment=PurchasePaymentDTO(
date="2025-05-18",
note="This is a Note",
effectiveDate="2025-05-18",
purchasePaymentApplied=[PurchasePaymentAppliedDTO(
processor="Cash2",
amount="1.00",
reference="Cash2"
)]
)
)
response = exsited_sdk.purchase_payments.create_from_purchase_invoice(
purchase_invoice_id="PI-7475XV-0008",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_payment object containing the newly created payment linked to the specified invoice. The response includes the generated id, status, purchasePaymentDate, and totalApplied. The purchasePaymentApplied array details each payment method used (id, amount, processor, reference). Audit fields such as createdBy, createdOn, uuid, and version are provided for tracking and concurrency control. Since the payment is created directly from an invoice, the invoice association is implicit. This makes it easy to confirm the payment was applied to the correct invoice and retrieve the payment identifier for reconciliation.
PurchasePaymentResponseDTO(
purchasePayment=PurchasePaymentDTO(
status='PAYMENT_STATUS',
id='PAYMENT_ID',
purchasePaymentDate='PAYMENT_DATE',
totalApplied='TOTAL_APPLIED',
purchasePaymentApplied=[
PurchasePaymentAppliedDTO(
id='APPLIED_ID',
amount='APPLIED_AMOUNT',
processor='PAYMENT_PROCESSOR',
reference='PAYMENT_REFERENCE'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON',
uuid='PAYMENT_UUID',
version='PAYMENT_VERSION'
)
)
Updating a Purchase Payment
Function: update()
Purpose
This API updates an existing purchase payment's modifiable fields, including the payment date, note, and custom attributes. The request wraps the update data in a purchasePayment object containing the fields to be changed. The system applies the updates and returns the full payment object with the modified values and updated audit fields (lastUpdatedBy, lastUpdatedOn). The version field is included for concurrency control. This is important for maintaining accurate payment records when corrections are needed — for example, adjusting the payment date to match the actual bank processing date, updating the note with additional context, or adding organizational metadata through custom attributes.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_payment_id | String | The unique ID of the purchase payment to update. |
| request_data | PurchasePaymentUpdateRequestDTO | The update request payload containing payment changes. |
Use Case
In accounts payable operations, payment records occasionally need to be corrected after initial entry. A common scenario is adjusting the payment date — for example, when a payment was recorded on the date it was submitted, but the bank processed it on a different date. Finance teams may also need to update the payment note with additional context, such as recording the bank transaction reference number once it becomes available, or adding a note explaining why the payment was delayed. Custom attributes can be updated to reflect organizational tags such as cost center codes or approval identifiers. This endpoint enables these corrections without affecting the payment's core financial data (amounts, applied invoices), ensuring that metadata stays accurate while preserving the integrity of the payment record.
def test_purchase_payment_update():
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:
request_data = PurchasePaymentUpdateRequestDTO(
purchasePayment=PurchasePaymentUpdateDataDTO(
date="2025-05-26",
note="This is a test purchase payment updated from SDK"
)
)
response = exsited_sdk.purchase_payments.update(
request_data=request_data,
purchase_payment_id="PPT-7475XV-0002"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_payment object containing the updated payment. The response includes the status, id, purchasePaymentDate, totalApplied, purchasePaymentNote, and the purchasePaymentApplied array (id, amount, method, processor, reference). Audit fields such as createdBy, createdOn, lastUpdatedBy, lastUpdatedOn, uuid, and version are provided for tracking changes and concurrency control. This makes it easy to confirm the payment was updated correctly, verify the modified date and note, and track who made the change and when.
PurchasePaymentsUpdateResponseDTO(
purchasePayment=PurchasePaymentDTO(
status='PAYMENT_STATUS',
id='PAYMENT_ID',
purchasePaymentDate='PAYMENT_DATE',
totalApplied='TOTAL_APPLIED',
purchasePaymentNote='PAYMENT_NOTE',
purchasePaymentApplied=[
PurchasePaymentAppliedDTO(
id='APPLIED_ID',
amount='APPLIED_AMOUNT',
method='PAYMENT_METHOD',
processor='PAYMENT_PROCESSOR',
reference='PAYMENT_REFERENCE'
)
],
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON',
uuid='PAYMENT_UUID',
version='PAYMENT_VERSION'
)
)
Updating Purchase Payment Information
Function: update_information()
Purpose
This API updates the information fields of an existing purchase payment, specifically the issueDate, dueDate, and purchaseOrderNote. The request wraps the update data in a purchaseInvoice object containing the fields to be modified. The system applies the updates and returns the full payment object with the modified values and audit fields. This is important for maintaining accurate scheduling and reference information on payment records, particularly when payment terms change, due dates are renegotiated with the supplier, or additional context needs to be recorded against the payment for tracking and reporting purposes.
Parameters
| Parameter name | Type | Description |
|---|---|---|
| purchase_payment_id | String | The unique ID of the purchase payment to update. |
| request_data | PurchasePaymentInformationRequestDTO | The update request payload containing information changes. |
Use Case
In payment management workflows, scheduling and reference information may need to be updated as business circumstances evolve. For example, a supplier may agree to extend the due date on a payment after a cash flow discussion, requiring the dueDate field to be updated. The issueDate may need correction if it was entered incorrectly during initial recording. The purchaseOrderNote field is commonly updated to add context about payment scheduling decisions, record supplier communications about payment terms, or document the reason for a payment timing change. This endpoint allows these information updates without affecting the payment's financial data (amounts, applied invoices, payment methods), ensuring scheduling and reference metadata stays current while preserving the integrity of the core payment record.
def test_purchase_payment_update_information():
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:
request_data = PurchasePaymentInformationRequestDTO(
purchaseInvoice=PurchasePaymentInformationDataDTO(
issueDate="2025-01-02",
dueDate="2025-01-02",
purchaseOrderNote="Purchase order note added"
)
)
response = exsited_sdk.purchase_payments.update_information(
purchase_payment_id="PPT-7475XV-0001",
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
On success, the function returns a purchase_payment object containing the updated payment with the modified information fields. The response includes the status, id, purchasePaymentDate, totalApplied, purchaseOrderId, purchasePaymentNote, and audit fields such as createdBy, createdOn, lastUpdatedBy, lastUpdatedOn, uuid, and version. This makes it easy to confirm that the information updates (issueDate, dueDate, purchaseOrderNote) were applied correctly and retrieve the current state of the payment for display or further processing.
PurchasePaymentInformationResponseDTO(
purchasePayment=PurchasePaymentDTO(
status='PAYMENT_STATUS',
id='PAYMENT_ID',
purchasePaymentDate='PAYMENT_DATE',
totalApplied='TOTAL_APPLIED',
purchaseOrderId='PURCHASE_ORDER_ID',
purchasePaymentNote='PAYMENT_NOTE',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON',
uuid='PAYMENT_UUID',
version='PAYMENT_VERSION'
)
)
