Retrieving Payment Records
Function : payment_list_basic()
Purpose
This function retrieves a basic list of all recorded payments, along with associated metadata such as applied methods, invoice details, and pagination information. It helps users access a summarized view of payment transactions within the system.
Parameters
This function does not require any input parameters.
Use Case
The function is used when a user needs to retrieve a list of all payments made, including details such as payment status, amount applied, processing method, related invoices, and creator metadata. This function is particularly useful for auditing payments, reconciling financial records, or reviewing historical transactions. It returns multiple payment entries, each with structured information to help the user understand how the payment was processed and what invoices it was applied to.
def payment_list_basic():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.list()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAll(){
try {
$payments = $this->paymentService->readAll('v3');
echo '<pre>' . json_encode($payments, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function response includes a list of payments, each containing information such as payment ID, date, status, reconcile status, and total applied amount. For each payment, the applied payment methods are listed, including processor, method, amount, and reference. It also contains related invoice data like applied amount, total, due date, and issue date. Metadata fields like creator, creation timestamp, version, and UUID are also returned. The response includes pagination data to indicate how many records were returned and how the user can navigate through pages of results.
PaymentListDTO(
payments=[
PaymentDataDTO(
id='PAYMENT_ID_1',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_1',
amount=DECIMAL_VALUE,
reference='EMPTY',
method='PAYMENT_METHOD_1'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='PAYMENT_UUID_1',
version='VERSION_NUMBER',
saleOrderId=None,
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_2',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_2',
amount=DECIMAL_VALUE,
reference='EMPTY',
method='PAYMENT_METHOD_2'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='PAYMENT_UUID_2',
version='VERSION_NUMBER',
saleOrderId=None,
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_3',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_3',
amount=DECIMAL_VALUE,
reference='EMPTY',
method='PAYMENT_METHOD_3'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='PAYMENT_UUID_3',
version='VERSION_NUMBER',
saleOrderId=None,
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records=NUMBER,
limit=NUMBER,
offset=NUMBER,
previousPage='PLACEHOLDER_PREVIOUS_PAGE',
nextPage='PLACEHOLDER_NEXT_PAGE'
)
)
{
"payments": [
{
"status": "PAYMENT_STATUS",
"id": "PAYMENT_ID_1",
"date": "TIMESTAMP",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD_1",
"processor": "PAYMENT_PROCESSOR_1",
"reference": "EMPTY"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "TIMESTAMP",
"id": "INVOICE_ID_1",
"issue_date": "TIMESTAMP",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "TIMESTAMP",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "PAYMENT_UUID_1",
"payment_note": "EMPTY",
"version": "VERSION_NUMBER",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "PAYMENT_STATUS",
"id": "PAYMENT_ID_2",
"date": "TIMESTAMP",
"origin": "PAYMENT_ORIGIN",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD_2",
"processor": "PAYMENT_PROCESSOR_2",
"reference": "EMPTY"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "TIMESTAMP",
"id": "INVOICE_ID_2",
"issue_date": "TIMESTAMP",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "TIMESTAMP",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "PAYMENT_UUID_2",
"payment_note": "EMPTY",
"version": "VERSION_NUMBER",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "PAYMENT_STATUS",
"id": "PAYMENT_ID_3",
"date": "TIMESTAMP",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD_3",
"processor": "PAYMENT_PROCESSOR_3",
"reference": "EMPTY"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "TIMESTAMP",
"id": "INVOICE_ID_3",
"issue_date": "TIMESTAMP",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "TIMESTAMP",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "PAYMENT_UUID_3",
"payment_note": "EMPTY",
"version": "VERSION_NUMBER",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": NUMBER,
"limit": NUMBER,
"offset": NUMBER,
"previous_page": "EMPTY",
"next_page": "NULL"
}
}
Retrieving a Specific Payment Record
Function : payment_details()
Purpose
This function retrieves the complete details of a specific payment using its unique payment ID. It returns structured data that includes payment methods, applied invoices, creator information, and associated metadata.
Parameters
Parameter | Type | Description |
---|---|---|
payment_id | String | Unique ID of the payment . |
Use Case
The function is used when a user needs to view the full breakdown of a specific payment transaction. This is particularly helpful for finance teams or system users verifying how a payment was applied, which invoices it covered, and what method was used. The function provides a single payment record with all relevant attributes such as payment status, processor used, reconciliation status, amount applied, and invoice linkage.
def payment_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.details(id='PAYMENT_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)
public function testReadDetails()
{
$id = 'PAYMENT_ID';
try {
$response = $this->paymentService->readDetails($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function response returns a single payment object containing detailed attributes. It includes the payment ID, date, status, reconciliation state, total amount applied, and detailed records of applied payment methods (including processor, method, amount, and reference). The response also includes the list of invoices to which the payment was applied, with associated totals and dates. Metadata such as creator, creation timestamp, UUID, and version are also included. This comprehensive data structure allows for full visibility into the payment’s application and lifecycle.
PaymentDetailsDTO(
payment=PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=DECIMAL_VALUE,
reference='EMPTY',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='PAYMENT_UUID',
version='VERSION_NUMBER',
saleOrderId=None,
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
)
{
"payment": {
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": ""
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "UUID",
"payment_note": "",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
}
}
Retrieving All Payments from a Specific Account
Function: payment_account_details()
Purpose
This function retrieve detailed payment account information, including payment records, invoice applications, and associated metadata, for a specific account identified by its ID.
Parameters
Parameter | Type | Description |
---|---|---|
account_id | String | Unique identifier of the account. |
Use Case
The function is used when a user needs to fetch all payment records associated with a specific payment account. It helps provide insight into transaction history, applied invoices, processors used (SecurePay, Stripe, Cash), and reconciliation status. This is especially useful in reporting modules, finance auditing, and order reconciliation workflows.
def payment_account_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.account_details(id='ACCOUNT_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAccountPaymentDetails()
{
$accountId = 'ACCOUNT_ID';
try {
$response = $this->paymentService->readAccountPaymentDetails($accountId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function returns a object containing a paginated list of entries. Each payment record includes details such as payment ID, date, total amount applied, processor, applied invoices, payment method, reconciliation status, creator metadata, and related order ID. The response also includes pagination metadata to navigate large result sets effectively.
PaymentAccountResponseDTO(
account=PaymentListDTO(
payments=[
PaymentDataDTO(
id='PAYMENT_ID_1',
date='YYYY-MM-DDTHH:MM:SSZ',
status='STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_1',
amount='DECIMAL_VALUE',
reference='REFERENCE_1',
method='PAYMENT_METHOD_1'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='UUID_1',
version='VERSION',
saleOrderId='ORDER_ID_1',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_2',
date='YYYY-MM-DDTHH:MM:SSZ',
status='STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_2',
amount=DECIMAL_VALUE,
reference='REFERENCE_2',
method='PAYMENT_METHOD_2'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='UUID_2',
version='VERSION',
saleOrderId='ORDER_ID_2',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID_3',
date='YYYY-MM-DDTHH:MM:SSZ',
status='STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR_3',
amount='DECIMAL_VALUE',
reference='REFERENCE_3',
method='PAYMENT_METHOD_3'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='UUID_3',
version='VERSION',
saleOrderId='ORDER_ID_3',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records='NUMBER',
limit='NUMBER',
offset='NUMBER',
previousPage='',
nextPage='NULL'
)
)
)
{
"account": {
"payments": [
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"gateway_response": null,
"id": NUMBER,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "REFERENCE_NUMBER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "UUID",
"payment_note": "",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": [],
"sale_order_id": "ORDER_ID"
}
],
"pagination": {
"records": "NUMBER",
"limit": "NUMBER",
"offset": "NUMBER",
"previous_page": "PAGINATION_URL",
"next_page": "PAGINATION_URL"
}
}
}
Retrieving Payment Details for an Order
Function : payment_order_details()
Purpose
This function retrieves detailed payment information related to a specific sale order, including all associated transactions and invoice applications.
Parameters
Parameter | Type | Description |
---|---|---|
order_id | String | Unique identifier of the order. |
Use Case
The function is used when user to view all payments made for a particular sale order. It helps track transaction history, applied payment methods (like cheque, SecurePay, eWay, Payrix, Stripe), reconciliation status, and invoice-level breakdowns. This function supports internal audit, reconciliation checks, and financial reporting.
def payment_order_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.order_details(id='ORDER_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadOrderPaymentDetails()
{
$orderId = 'ORDER_ID';
try {
$response = $this->paymentService->readOrderPaymentDetails($orderId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function returns a list of payment records linked to the given sale order ID. Each record includes the payment ID, date, status, reconciliation status, amount applied, method used, processor, and applied invoice details such as due date, total, and outstanding amounts. The response is paginated and enables tracking of multiple transactions against the same order, providing a complete financial view.
PaymentOrderResponseDTO(
order=PaymentListDTO(
payments=[
PaymentDataDTO(
id='PAYMENT_ID',
date='YYYY-MM-DDTHH:MM:SSZ',
status='ACTIVE',
reconcileStatus='NOT_RECONCILE',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=DECIMAL_VALUE,
reference='EMPTY',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='YYYY-MM-DDTHH:MM:SSZ',
status='ACTIVE',
reconcileStatus='NOT_RECONCILE',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount='DECIMAL_VALUE',
reference='REFERENCE_NUMBER',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='YYYY-MM-DDTHH:MM:SSZ',
status='ACTIVE',
reconcileStatus='NOT_RECONCILE',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount='DECIMAL_VALUE',
reference='REFERENCE_NUMBER',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='YYYY-MM-DDTHH:MM:SSZ',
status='ACTIVE',
reconcileStatus='NOT_RECONCILE',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount='DECIMAL_VALUE',
reference='REFERENCE_NUMBER',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='YYYY-MM-DDTHH:MM:SSZ',
status='ACTIVE',
reconcileStatus='NOT_RECONCILE',
totalApplied='DECIMAL_VALUE',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount='DECIMAL_VALUE',
reference='REFERENCE_NUMBER',
method='PAYMENT_METHOD'
)
],
note=None,
creditApplied=[],
invoices=[
InvoiceDTO(
applied='DECIMAL_VALUE',
code=None,
dueDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
outstanding='DECIMAL_VALUE',
total='DECIMAL_VALUE'
)
],
createdBy='CREATED_BY',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records='NUMBER',
limit='NUMBER',
offset='NUMBER',
previousPage='EMPTY',
nextPage='NULL'
)
)
)
{
"order": {
"payments": [
{
"status": "STATUS",
"id": "PAYMENT_ID_1",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"gateway_response": null,
"id": "NUMBER",
"method": "PAYMENT_METHOD_1",
"processor": "PAYMENT_PROCESSOR_1",
"reference": "REFERENCE_NUMBER_1"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID_1",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "UUID_1",
"payment_note": "",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": [],
"sale_order_id": "ORDER_ID"
},
{
"status": "STATUS",
"id": "PAYMENT_ID_2",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"gateway_response": null,
"id": "NUMBER",
"method": "PAYMENT_METHOD_2",
"processor": "PAYMENT_PROCESSOR_2",
"reference": "REFERENCE_NUMBER_2"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID_1",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "UUID_2",
"payment_note": "",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": [],
"sale_order_id": "ORDER_ID"
}
],
"pagination": {
"records": "NUMBER",
"limit": "NUMBER",
"offset": "NUMBER",
"previous_page": "PAGINATION_URL",
"next_page": "PAGINATION_URL"
}
}
}
Retrieving Invoice Payments
Function : payment_details_against_invoice()
Purpose
This function is designed to retrieve detailed payment records associated with a specific invoice by using the invoice ID.
Parameter
Parameter | Type | Description |
---|---|---|
invoice_id | String | The unique identifier of the invoice to retrieve associated payment records. |
Use Case
The function is used to retrieve all payment transactions made against a given invoice. It provides a breakdown of each payment including amount applied, processor, payment method, and references. This is useful for finance teams or implementers who want to audit or trace how a particular invoice was paid, verify reconciliation status, or inspect payment timelines and responsible users.
def payment_details_against_invoice():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.invoice_details(id='INVOICE_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadInvoicePaymentDetails()
{
$invoiceId = 'INVOICE_ID';
try {
$response = $this->paymentService->readInvoicePaymentDetails($invoiceId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function response includes a list of payments linked to the given invoice. Each payment entry provides its ID, date, status, reconciliation status, amount applied, and related invoice summary including issue date, due date, outstanding balance, and total. It also details the processor used (Cheque, Stripe), payment method, and reference number if any. Metadata such as the creator of the payment entry, timestamps, and associated sale order ID are also returned. Pagination information is included to support navigating large sets of payment data efficiently.
PaymentInvoiceResponseDTO(
invoice=PaymentListDTO(
payments=[
PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=NUMBER,
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=NUMBER,
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=NUMBER,
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount='NUMBER',
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
),
PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=NUMBER,
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
],
pagination=PaginationDTO(
records='NUMBER',
limit='NUMBER',
offset='NUMBER',
previousPage='EMPTY',
nextPage='NULL'
)
)
)
{
"invoice": {
"payments": [
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "EMPTY"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "REFERENCE_NUMBER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": DECIMAL_VALUE,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "REFERENCE_NUMBER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": DECIMAL_VALUE,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "REFERENCE_NUMBER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
},
{
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "YYYY-MM-DDTHH:MM:SSZ",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "DECIMAL_VALUE",
"payment_applied": [
{
"amount": "DECIMAL_VALUE",
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "REFERENCE_NUMBER"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "DECIMAL_VALUE",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"id": "INVOICE_ID",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"outstanding": "DECIMAL_VALUE",
"total": "DECIMAL_VALUE"
}
],
"created_by": "CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": []
}
],
"pagination": {
"records": NUMBER,
"limit": NUMBER,
"offset": NUMBER,
"previous_page": "EMPTY",
"next_page": "NULL"
}
}
}
Removing Payment Record by ID
Function :payment_delete()
Purpose
This function delete a specific payment record from the system by its payment ID. It initializes the SDK, sends a delete request, and handles the response or any exceptions raised during the process.
Parameters
Parameter | Type | Description |
---|---|---|
payment_id | String | The unique payment ID to be deleted. |
Use Case
The function is used when a payment record needs to be permanently removed, such as in cases of incorrect entries, test data cleanup, or financial adjustments. By calling the SDK's method with the target payment ID, the function ensures the specified payment record is deleted and no longer associated with any related transactions.
def payment_delete():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.payment.delete(id="PAYMENT_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testDelete()
{
$id = 'PAYMENT_ID';
try {
$response = $this->paymentService->delete($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function succesfully returns a response with success: True and status_code: 204, confirming that the payment was removed with no additional content.
Creating Payment for a Single Invoice
Function : payment_create_basic()
Purpose
This function designed to create a payment for a specific invoice using basic payment details such as processor, amount, and reference.
Parameters
Parameter | Type | Description |
---|---|---|
invoice_id | String | The ID of the invoice to apply payment to. |
Use Case
The function is used when a user needs to apply a simple payment to an invoice. It demonstrates how to construct the payment data with minimal fields, initialize the SDK, and execute the payment creation process through the method in the SDK. This is particularly useful for real-time invoice settlement, reconciliations, and payment tracking in systems where multiple payment methods are accepted.
def payment_create_basic():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
payment_applied = PaymentAppliedDTO(processor="PAYMENT_PROCESSOR", amount="NUMBER", reference="PAYMENT_REFERENCE")
payment_data = PaymentDataDTO(date="TIMESTAMP", paymentApplied=[payment_applied], note="STRING_VALUE")
request_data = PaymentCreateDTO(payment=payment_data)
response = exsited_sdk.payment.create(invoice_id="INVOICE_ID", request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testCreateSinglePayment()
{
$invoiceId = "INVOICE_ID";
$params = [
"payment" => [
"date" => "TIMESTAMP",
"note" => "STRING_VALUE",
"payment_applied" => [
[
"processor" => "PAYMENT_PROCESSOR",
"amount" => "NUMBER",
"reference" => "PAYMENT_REFERENCE"
],
[
"processor" => "PAYMENT_PROCESSOR",
"amount" => "NUMBER",
"reference" => "PAYMENT_REFERENCE"
],
[
"processor" => "PAYMENT_PROCESSOR",
"amount" => "NUMBER",
"reference" => "PAYMENT_REFERENCE"
]
],
]
];
try {
$response = $this->paymentService->createSinglePayment($invoiceId, $params, 'API_VERSION');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The SDK function response returns the complete payment details that were recorded for the invoice. It includes metadata such as the payment ID, date, status, and the amount applied. It also confirms the payment method used, invoice summary (issue date, due date, total, outstanding amount), and audit info like who created the payment and when. This response confirms that the payment has been successfully processed and stored in the system.
PaymentDetailsDTO(
payment=PaymentDataDTO(
id='PAYMENT_ID',
date='TIMESTAMP',
status='PAYMENT_STATUS',
reconcileStatus='RECONCILE_STATUS',
totalApplied='NUMBER',
paymentApplied=[
PaymentAppliedDTO(
processor='PAYMENT_PROCESSOR',
amount=NUMBER,
reference='PAYMENT_REFERENCE',
method='PAYMENT_METHOD'
)
],
note='NULL',
creditApplied=[],
invoices=[
InvoiceDTO(
applied='NUMBER',
code='NULL',
dueDate='TIMESTAMP',
issueDate='TIMESTAMP',
outstanding='NUMBER',
total='NUMBER'
)
],
createdBy='CREATED_BY',
createdOn='TIMESTAMP',
lastUpdatedBy='EMPTY',
lastUpdatedOn='EMPTY',
uuid='UUID',
version='VERSION',
saleOrderId='ORDER_ID',
customAttributes=[],
customObjects=[],
giftCertificateApplied=[]
)
)
{
"payment": {
"status": "STATUS",
"id": "PAYMENT_ID",
"date": "TIMESTAMP",
"origin": "EMPTY",
"reconcile_status": "RECONCILE_STATUS",
"total_applied": "NUMBER",
"payment_applied": [
{
"amount": NUMBER,
"gateway_response": "NULL",
"id": NUMBER,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "PAYMENT_REFERENCE"
},
{
"amount": NUMBER,
"gateway_response": "NULL",
"id": NUMBER,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "PAYMENT_REFERENCE"
},
{
"amount": NUMBER,
"gateway_response": "NULL",
"id": NUMBER,
"method": "PAYMENT_METHOD",
"processor": "PAYMENT_PROCESSOR",
"reference": "PAYMENT_REFERENCE"
}
],
"credit_applied": [],
"gift_certificate_applied": [],
"invoices": [
{
"applied": "NUMBER",
"due_date": "TIMESTAMP",
"id": "INVOICE_ID",
"issue_date": "TIMESTAMP",
"outstanding": "NUMBER",
"total": "NUMBER"
}
],
"created_by": "CREATED_BY",
"created_on": "TIMESTAMP",
"last_updated_by": "EMPTY",
"last_updated_on": "EMPTY",
"uuid": "UUID",
"payment_note": "EMPTY",
"version": "VERSION",
"custom_attributes": [],
"custom_objects": [],
"sale_order_id": "ORDER_ID"
}
}
Getting Payment Notes
Function: payment_notes()
Purpose
This endpoint retrieves all notes linked to a specific payment record. Each note provides contextual details such as unique identifiers, version, textual content (HTML-supported), attached files, and audit metadata like who created or last updated the note and when. Optional custom_attributes can also be included, depending on client-defined configurations. Additionally, pagination metadata helps manage large sets of notes efficiently. This functionality is especially useful for finance teams and auditors to track approvals, comments, or supporting documents attached to payments.
Parameters
Parameter | Type | Description |
---|---|---|
payment_id |
string | Unique identifier of the payment whose notes are being retrieved. |
Use Case
Suppose a finance officer needs to verify all comments or attachments related to a particular payment, such as clarifications, adjustments, or supporting documents. Instead of manually searching through multiple sources, the SDK provides a single request to fetch all associated notes. With just the payment_id, developers can pull detailed notes history, including file attachments and audit trails, ensuring accountability and transparency in financial workflows.
def payment_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.payment_note_details(id="{{PAYMENT_ID}}")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function paymentNotes()
{
$paymentId = '{{PAYMENT_ID}}';
try {
$response = $this->notesService->readPaymentAllNotes($paymentId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response returns a payment object containing an array of notes and pagination details. Each note includes a uuid, version, content, and may include a list of attached files with file metadata (uuid, name, version). Audit information such as created_by, created_on, last_updated_by, and last_updated_on provides a clear timeline of who interacted with the note. Empty arrays indicate no files or custom attributes. The Python SDK maps this response into structured DTO objects, while the PHP SDK presents it in JSON.
PaymentNoteDetailsDTO(
payment=PaymentNoteDataDTO(
notes=[
NoteDataDTO(
uuid='{{NOTE_UUID}}',
version='{{VERSION}}',
content='{{NOTE_CONTENT}}',
files=[],
createdBy='{{CREATED_BY}}',
createdOn='{{CREATED_ON}}',
lastUpdatedBy='{{LAST_UPDATED_BY}}',
lastUpdatedOn='{{LAST_UPDATED_ON}}'
)
],
pagination=PaginationDTO(
records=1,
limit=20,
offset=0,
previousPage='',
nextPage='NULL'
)
)
)
{
"payment": {
"notes": [
{
"uuid": "{{NOTE_UUID}}",
"version": "{{VERSION}}",
"content": "{{NOTE_CONTENT}}",
"files": [
{
"uuid": "{{FILE_UUID}}",
"name": "{{FILE_NAME}}",
"version": "{{FILE_VERSION}}"
}
],
"created_by": "{{CREATED_BY}}",
"created_on": "{{CREATED_ON}}",
"last_updated_by": "{{LAST_UPDATED_BY}}",
"last_updated_on": "{{LAST_UPDATED_ON}}",
"custom_attributes": []
}
],
"pagination": {
"records": 1,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
},
"autobillCredential": {
"apiUrl": "https:\/\/{{domain}}\/api\/v3\/payments\/{{PAYMENT_ID}}\/notes",
"appUrl": null,
"ClientId": "{{CLIENT_ID}}",
"ClientSecret": "{{CLIENT_SECRET}}",
"accessToken": "{{ACCESS_TOKEN}}",
"refreshToken": "{{REFRESH_TOKEN}}",
"file_path": "C:\\Path\\To\\token.json"
}
}
Getting Payment Note Details
Function: payment_note_details()
Purpose
This API endpoint retrieves detailed information about a specific note attached to a payment, identified by its unique UUID. It is particularly useful when you need to fetch the complete details of a single note, including metadata (UUID, version, creator), content, attached files, timestamps, and any custom attributes. This ensures precise access to a single note without retrieving the entire list of notes for the payment.
Parameters
Parameter | Type | Description |
---|---|---|
payment_id |
string | Unique identifier of the payment to which the note belongs. |
NOTE_UUID |
string | Unique identifier of the specific note. |
Use Case
Suppose a business wants to retrieve a specific note that was previously added to a payment, for auditing or compliance purposes. Instead of listing all notes attached to a payment, the finance team can directly access the note using its UUID. This method returns not only the note’s textual content but also its creation and update metadata, plus any attached files. This ensures accurate referencing of payment-related documentation in financial workflows.
def payment_note_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.payment_note_uuid_details(
id="{{payment_id}}",
uuid="{{NOTE_UUID}}"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function paymentNoteDetails()
{
$paymentId = '{{payment_id}}';
$noteUuid = '{{NOTE_UUID}}';
try {
$response = $this->notesService->readPaymentNotesDetails($paymentId, $noteUuid, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the API returns the details of the requested payment note. The response contains identifiers, version control, note content (with HTML support), audit details (creator, timestamps), optional attached files, and any custom attributes. This allows clients to fully reconstruct the note’s context and history for reporting or auditing.
PaymentNoteUuidDetailsDTO(
payment=PaymentNoteUuidDataDTO(
note=NoteDataDTO(
uuid='{{NOTE_UUID}}',
version='{{version}}',
content='{{note_content}}',
files=[
FileDTO(
uuid='{{file_uuid}}',
name='{{file_name}}',
version='{{file_version}}'
)
],
createdBy='{{created_by}}',
createdOn='{{created_on}}',
lastUpdatedBy='{{last_updated_by}}',
lastUpdatedOn='{{last_updated_on}}'
)
)
)
{
"payment": {
"note": {
"uuid": "{{NOTE_UUID}}",
"version": "{{version}}",
"content": "{{note_content}}",
"files": [
{
"uuid": "{{file_uuid}}",
"name": "{{file_name}}",
"version": "{{file_version}}"
}
],
"created_by": "{{created_by}}",
"created_on": "{{created_on}}",
"last_updated_by": "{{last_updated_by}}",
"last_updated_on": "{{last_updated_on}}",
"custom_attributes": []
}
}
}
Getting All Files for a Payment Note
Function: payment_note_files()
Purpose
This API retrieves all files attached to a specific note within a payment. Each file object includes its unique identifier, name, and version information. This is particularly useful when a note contains supporting documents (such as receipts, invoices, or scanned attachments) and you need to fetch all related files for validation, review, or download purposes.
Parameters
Parameter | Type | Description |
---|---|---|
payment_id |
string | Unique identifier of the payment to which the note belongs. |
NOTE_UUID |
string | Unique identifier of the specific note for which files are being requested. |
Use Case
Consider a scenario where a finance officer needs to audit a payment’s supporting documents. Instead of checking multiple locations, the officer can directly fetch all the files attached to the specific payment note. These files may include receipts, scanned agreements, or additional documents that validate the payment. This ensures all documentation is easily retrievable and linked directly to the relevant payment record.
def payment_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.payment_note_uuid_files_details(
id="{{payment_id}}",
uuid="{{NOTE_UUID}}"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function paymentNoteFiles()
{
$paymentId = '{{payment_id}}';
$noteUuid = '{{NOTE_UUID}}';
try {
$response = $this->notesService->readPaymentNoteAllFiles($paymentId, $noteUuid, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the API returns all files associated with the given note. Each file object includes its unique identifier (uuid), file name, and version. These details allow clients to fetch or download the correct file and keep track of file version history.
PaymentNoteUuidFileDetailsDTO(
payment=PaymentNoteUuidFileDataDTO(
note=NoteFileDataDTO(
files=[
FileDTO(
uuid='{{file_uuid}}',
name='{{file_name}}',
version='{{file_version}}'
)
]
)
)
)
{
"payment": {
"note": {
"files": [
{
"uuid": "{{file_uuid}}",
"name": "{{file_name}}",
"version": "{{file_version}}"
}
],
"custom_attributes": []
}
}
}
Getting a Specific File for a Payment Note
Function: payment_note_file_details()
Purpose
This API fetches the details of a single file attached to a specific note within a payment. Instead of retrieving all files, this endpoint allows you to directly access a particular file by its unique identifier. This is particularly useful in scenarios where multiple files are attached to a note, and you need to fetch or reference one specific file (for example, retrieving the signed contract copy among multiple uploaded documents).
Parameters
Parameter | Type | Description |
---|---|---|
payment_id |
string | Unique identifier of the payment to which the note belongs. |
NOTE_UUID |
string | Unique identifier of the note that contains the file. |
FILE_UUID |
string | Unique identifier of the file to be retrieved. |
Use Case
Imagine a payment note that has several files attached, such as an invoice copy, a signed agreement, and supporting receipts. If the finance department needs to retrieve only the signed agreement, they can call this endpoint with the file’s unique identifier. This ensures targeted retrieval of specific documents without needing to process the entire list of files.
def payment_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.payment_note_uuid_files_uuid_details(
id="{{payment_id}}",
uuid="{{NOTE_UUID}}",
file_uuid="{{FILE_UUID}}"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function paymentNoteFileDetails()
{
$paymentId = '{{payment_id}}';
$noteUuid = '{{NOTE_UUID}}';
$fileUuid = '{{FILE_UUID}}';
try {
$response = $this->notesService->readPaymentNoteFileDetails($paymentId, $noteUuid, $fileUuid, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the API returns the details of the requested file. The response includes the file’s unique identifier(uuid) file name, and version. These attributes allow applications to uniquely identify, reference, and manage specific files related to payment notes.
PaymentNoteUuidFileUuidDetailsDTO(
payment=PaymentNoteUuidFileUuidDataDTO(
note=NoteFileUuidDataDTO(
file=FileDTO(
uuid='{{file_uuid}}',
name='{{file_name}}',
version='{{file_version}}'
)
)
)
)
{
"payment": {
"note": {
"file": {
"uuid": "{{file_uuid}}",
"name": "{{file_name}}",
"version": "{{file_version}}"
},
"custom_attributes": []
}
}
}
Creating a Note for a Payment
Function: payment_note_create()
Purpose
This API allows adding a note to a specific payment. Notes can include plain text and optionally one or more attached files. It is typically used to record payment-related comments, evidence, or supporting documents (example: receipts, screenshots, or remarks from the finance team).
Parameters
Parameter | Type | Description |
---|---|---|
payment_id |
string | Unique identifier of the payment to which the note will be added. |
Use Case
Finance teams, operations, and field agents use this endpoint whenever they need to attach context or evidence directly to a payment record. Typical scenarios include: logging adjustment reasons (refunds, credit notes), uploading receipts or bank transfer screenshots during reconciliation, attaching signed approvals or contract excerpts, and recording notes created automatically by backend workflows (example: webhook-driven status changes). Because the note UUID returned can be used later to fetch or manage attached files, this endpoint fits neatly into dispute resolution, audit trails, and reconciliation workflows — letting systems and users keep payment commentary and supporting documents tied to the payment for compliance, traceability, and downstream automation.
def payment_note_create():
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 = "{{NOTE_TEXT}}" # e.g. "Refund processed — see attached receipt"
file_urls = ["{{FILE_PATH_1}}", "{{FILE_PATH_2}}"] # local paths to attachments or [] if none
response = exsited_sdk.notes.payment_add_notes(
file_urls=file_urls,
datas=datas,
payment_id="{{PAYMENT_ID}}"
)
print(response) # contains the created note UUID: {{NOTE_UUID}}
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function paymentNoteCreate()
{
$paymentId = '{{PAYMENT_ID}}';
$filePaths = '{{FILE_PATH}}';
$note = '{{NOTE_TEXT}}';
try {
$response = $this->notesService->createPaymentNotes($filePaths, $note, $paymentId, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>'; // response contains uuid: {{NOTE_UUID}}
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
On success, the API returns a payment object containing the newly created note. The response includes only the uuid of the note for reference, which can later be used to fetch note details, update it, or manage its files.
PaymentNoteResponseDetailsDTO(
payment=PaymentNoteResponseDataDTO(
notes=NoteDataDTO(
uuid='{{note_uuid}}',
version=None,
content=None,
files=None,
createdBy=None,
createdOn=None,
lastUpdatedBy=None,
lastUpdatedOn=None
)
)
)
{
"payment": {
"notes": {
"uuid": "{{note_uuid}}"
}
}
}