Getting Purchase Invoice List
Function: purchase_invoice_list_basic()
Purpose
This SDK function retrieves a list of purchase invoices, providing comprehensive details such as invoice status, issue dates, amounts, custom attributes, and associated accounts. It is essential for tracking and managing financial transactions and outstanding payments.
Parameters
This function does not require any input parameters.
Use Case
An organization needs to view all active purchase invoices to monitor financial transactions and ensure compliance with billing terms. This function enables quick access to detailed invoice data, facilitating better financial oversight.
def purchase_invoice_list_basic():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.list()
print(response)
# ResponseToObj().process(response=response["purchase_invoices"][0])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAll(){
try {
$response = $this->purchaseInvoiceService->readAll('v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains a list of purchase invoices with detailed metadata, including invoice identifiers, financial details, custom attributes, associated lines, and pagination data. It allows users to analyze invoice status and details effectively.
PurchaseInvoiceListDTO(
purchaseInvoices=[
PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-DQLP9B-0001',
customForm=CustomFormsDTO(uuid=None, name=None),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-20T00:00:00Z',
alternateIssueDate='2025-07-20T00:00:00Z',
dueDate='2025-07-20T00:00:00Z',
alternateDueDate='2025-07-20T00:00:00Z',
subtotal='',
tax='',
total='50.000000',
priceTaxInclusive='true',
accountId='DQLP9B',
purchaseOrderId='PO-DQLP9B-0001',
createdBy='Implementer',
createdOn='2025-07-20T08:50:23Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='8499f7e3-b120-4f5c-a17e-21ef83e0ea1d',
version='1',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='50.000000',
total='50.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='8a83dc00-1976-4b51-923f-1ec8837c242c',
itemPurchaseOrderQuantity='1.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
),
PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-DQLP9B-0002',
customForm=CustomFormsDTO(uuid=None, name=None),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-20T00:00:00Z',
alternateIssueDate='2025-07-20T00:00:00Z',
dueDate='2025-07-20T00:00:00Z',
alternateDueDate='2025-07-20T00:00:00Z',
subtotal='',
tax='',
total='350.000000',
priceTaxInclusive='true',
accountId='DQLP9B',
purchaseOrderId='',
createdBy='Implementer',
createdOn='2025-07-20T10:17:35Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='c611b4bf-be32-453f-9dce-1eecd90d3911',
version='1',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='350.000000',
total='350.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='',
itemPurchaseOrderQuantity='5.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='2f5f5d1e-5441-4ecc-a0c8-880089cd1855',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
),
PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-DQLP9B-0003',
customForm=CustomFormsDTO(uuid=None, name=None),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-27T00:00:00Z',
alternateIssueDate='2025-07-27T00:00:00Z',
dueDate='2025-07-27T00:00:00Z',
alternateDueDate='2025-07-27T00:00:00Z',
subtotal='',
tax='',
total='1500.000000',
priceTaxInclusive='true',
accountId='DQLP9B',
purchaseOrderId='',
createdBy='Implementer',
createdOn='2025-07-27T05:51:56Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='eb361cf8-17d8-41f7-a00f-df57d68db057',
version='0',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='1500.000000',
total='1500.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='',
itemPurchaseOrderQuantity='10.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='365ee374-4f04-4afe-8790-24c61fdca122',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
),
PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-7O8DW7-0004',
customForm=CustomFormsDTO(uuid=None, name=None),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-27T00:00:00Z',
alternateIssueDate='2025-07-27T00:00:00Z',
dueDate='2025-07-27T00:00:00Z',
alternateDueDate='2025-07-27T00:00:00Z',
subtotal='',
tax='',
total='1000.000000',
priceTaxInclusive='true',
accountId='7O8DW7',
purchaseOrderId='',
createdBy='Implementer',
createdOn='2025-07-27T08:09:33Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='7ce74a23-a760-4b12-9aac-ec750b4e2771',
version='0',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='1000.000000',
total='1000.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='',
itemPurchaseOrderQuantity='20.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='6bf3a78a-94b7-4128-8ffd-a58c778de17c',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
)
],
pagination=PaginationDTO(
records=4,
limit=20,
offset=0,
previousPage='',
nextPage='NULL'
)
)
{
"purchase_invoices": [
{
"status": "ACTIVE",
"id": "PI-DQLP9B-0001",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-20T00:00:00Z",
"alternate_issue_date": "2025-07-20T00:00:00Z",
"due_date": "2025-07-20T00:00:00Z",
"alternate_due_date": "2025-07-20T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "50.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "PO-DQLP9B-0001",
"created_by": "Implementer",
"created_on": "2025-07-20T08:50:23Z",
"last_updated_by": "saeed",
"last_updated_on": "2025-07-30T04:05:54Z",
"uuid": "8499f7e3-b120-4f5c-a17e-21ef83e0ea1d",
"version": "3",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "50.000000",
"total": "50.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "8a83dc00-1976-4b51-923f-1ec8837c242c",
"item_purchase_order_quantity": "1.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
{
"status": "ACTIVE",
"id": "PI-DQLP9B-0002",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-20T00:00:00Z",
"alternate_issue_date": "2025-07-20T00:00:00Z",
"due_date": "2025-07-20T00:00:00Z",
"alternate_due_date": "2025-07-20T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "350.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "",
"created_by": "Implementer",
"created_on": "2025-07-20T10:17:35Z",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "c611b4bf-be32-453f-9dce-1eecd90d3911",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "350.000000",
"total": "350.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "5.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "2f5f5d1e-5441-4ecc-a0c8-880089cd1855",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
{
"status": "ACTIVE",
"id": "PI-DQLP9B-0003",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-27T00:00:00Z",
"alternate_issue_date": "2025-07-27T00:00:00Z",
"due_date": "2025-07-27T00:00:00Z",
"alternate_due_date": "2025-07-27T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "1500.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "",
"created_by": "Implementer",
"created_on": "2025-07-27T05:51:56Z",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "eb361cf8-17d8-41f7-a00f-df57d68db057",
"version": "0",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "1500.000000",
"total": "1500.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "10.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "365ee374-4f04-4afe-8790-24c61fdca122",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
{
"status": "ACTIVE",
"id": "PI-7O8DW7-0004",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-27T00:00:00Z",
"alternate_issue_date": "2025-07-27T00:00:00Z",
"due_date": "2025-07-27T00:00:00Z",
"alternate_due_date": "2025-07-27T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "1000.000000",
"price_tax_inclusive": "true",
"account_id": "7O8DW7",
"purchase_order_id": "",
"created_by": "Implementer",
"created_on": "2025-07-27T08:09:33Z",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "7ce74a23-a760-4b12-9aac-ec750b4e2771",
"version": "0",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "1000.000000",
"total": "1000.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "20.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "6bf3a78a-94b7-4128-8ffd-a58c778de17c",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
{
"status": "ACTIVE",
"id": "PI-DQLP9B-0005",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-29T00:00:00Z",
"alternate_issue_date": "2025-07-29T00:00:00Z",
"due_date": "2025-07-29T00:00:00Z",
"alternate_due_date": "2025-07-29T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "100.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "PO-DQLP9B-0002",
"created_by": "Implementer",
"created_on": "2025-07-29T10:00:14Z",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "84e0220f-07d8-45c3-a279-ce7832999a84",
"version": "0",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "100.000000",
"total": "100.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "5.000000",
"item_uom": "",
"item_warehouse": "",
"uuid": "027dc2c4-4c8a-4f9c-904b-4def24557e2d",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
{
"status": "INACTIVE",
"id": "PI-DQLP9B-0014",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-30T00:00:00Z",
"alternate_issue_date": "2025-07-30T00:00:00Z",
"due_date": "2025-07-30T00:00:00Z",
"alternate_due_date": "2025-07-30T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "50.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "",
"created_by": "Implementer",
"created_on": "2025-07-30T10:18:13Z",
"last_updated_by": "saeed",
"last_updated_on": "2025-07-30T10:23:11Z",
"uuid": "6a1d05ea-7376-4112-bc82-1b11a7eed85d",
"version": "7",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "50.000000",
"total": "50.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "1.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "0a3f6e1e-ab14-4ccf-ab9f-d4a189a00c5c",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
}
],
"pagination": {
"records": 6,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
},
"autobillCredential": {
"apiUrl": "https:\/\/dev-api.exsited.com\/api\/v3\/purchase-invoices",
"appUrl": null,
"ClientId": "DTgOBjoFCTsCCDU3DAY5OWUCBwsKNgIJOgs6Ag0KDgcCCjg3CTkLBwYKBzo3Ag4FBwwCBQwKBjg=",
"ClientSecret": "NmE3L2MuMmQrL2YyYWJgMjErNDViYysyMjU3K2BiNTcrMWI3YDEvZF81NzEzKzcuMDUrYTY3M2E=",
"file_path": "C:\\Users\\saeedullah\\Desktop\\PROJECTS\\exsited\\php-sdk\\exsited-app-sdk-php\/token.json"
}
}
Getting Purchase Invoice Details by ID
Function: purchase_invoice_details()
Purpose
This function retrieves detailed information about a specific purchase invoice by its unique identifier. It is essential for obtaining precise financial details, including invoice status, associated currency, amounts, line items, and custom attributes.
Parameters
Parameter | Type | Description |
---|---|---|
id | String | The unique identifier of the purchase invoice to fetch details for. |
Use Case
A finance team needs to retrieve and review the details of a specific purchase invoice for reconciliation or auditing purposes. This function provides all necessary information, ensuring accuracy in financial reporting.
def purchase_invoice_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.details(id='PI-DQLP9B-0001')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadDetails()
{
$id = 'PI-DQLP9B-0001';
try {
$response = $this->purchaseInvoiceService->readDetails($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains detailed metadata for the specified purchase invoice, including its status, amounts, associated currency, line items, and additional attributes. This data facilitates financial tracking and invoice analysis.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-DQLP9B-0001',
customForm=CustomFormsDTO(
uuid=None,
name=None
),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-20T00:00:00Z',
alternateIssueDate='2025-07-20T00:00:00Z',
dueDate='2025-07-20T00:00:00Z',
alternateDueDate='2025-07-20T00:00:00Z',
subtotal='',
tax='',
total='50.000000',
priceTaxInclusive='true',
accountId='DQLP9B',
purchaseOrderId='PO-DQLP9B-0001',
createdBy='Implementer',
createdOn='2025-07-20T08:50:23Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='8499f7e3-b120-4f5c-a17e-21ef83e0ea1d',
version='1',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='50.000000',
total='50.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='8a83dc00-1976-4b51-923f-1ec8837c242c',
itemPurchaseOrderQuantity='1.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
),
pagination=None
)
{
"purchase_invoice": {
"status": "ACTIVE",
"id": "PI-DQLP9B-0001",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-20T00:00:00Z",
"alternate_issue_date": "2025-07-20T00:00:00Z",
"due_date": "2025-07-20T00:00:00Z",
"alternate_due_date": "2025-07-20T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "50.000000",
"price_tax_inclusive": "true",
"account_id": "DQLP9B",
"purchase_order_id": "PO-DQLP9B-0001",
"created_by": "Implementer",
"created_on": "2025-07-20T08:50:23Z",
"last_updated_by": "saeed",
"last_updated_on": "2025-07-30T04:05:54Z",
"uuid": "8499f7e3-b120-4f5c-a17e-21ef83e0ea1d",
"version": "3",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "50.000000",
"total": "50.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "8a83dc00-1976-4b51-923f-1ec8837c242c",
"item_purchase_order_quantity": "1.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
"autobillCredential": {
"apiUrl": "https:\/\/dev-api.exsited.com\/api\/v3\/purchase-invoices\/PI-DQLP9B-0001",
"appUrl": null,
"ClientId": "DTgOBjoFCTsCCDU3DAY5OWUCBwsKNgIJOgs6Ag0KDgcCCjg3CTkLBwYKBzo3Ag4FBwwCBQwKBjg=",
"ClientSecret": "NmE3L2MuMmQrL2YyYWJgMjErNDViYysyMjU3K2BiNTcrMWI3YDEvZF81NzEzKzcuMDUrYTY3M2E=",
"file_path": "C:\\Users\\saeedullah\\Desktop\\PROJECTS\\exsited\\php-sdk\\exsited-app-sdk-php\/token.json"
}
}
Getting Purchase Invoice Line Details
Function: purchase_invoice_line_details()
Purpose
The function retrieves detailed information about a specific line item within a purchase invoice. It enables accurate tracking of individual invoice components, ensuring seamless financial and inventory management.
Parameters
Parameter | Type | Description |
---|---|---|
PURCHASE_INVOICE_ID | String | The unique identifier of the purchase invoice. |
LINES_UUID | String | The unique identifier of the invoice line item. |
Use Case
This function can be used for businesses managing invoices with multiple line items. For instance, an accounting system can utilize this function to review specific purchase invoice details, track inventory movements, and validate tax calculations. This helps maintain financial accuracy and enhances reporting efficiency.
def purchase_invoice_line_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.line_details(id='PI-DQLP9B-0001', uuid='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadLinesDetails()
{
$id = 'PI-DQLP9B-0001';
$lineUUID='26eb02eb-8d0c-40e3-82e9-984cb9e67a3b';
try {
$response = $this->purchaseInvoiceService->readLinesDetails($id,$lineUUID,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a structured response containing purchase invoice line details. On success, it includes information such as the subtotal, tax, item UUID, warehouse location, and accounting codes. If the operation fails, it provides an error message with relevant debugging information.
PurchaseInvoiceDetailDTO(
purchaseInvoice=PurchaseInvoiceDTO(
status="INVOICE_STATUS",
id="INVOICE_ID",
customForm=CustomFormsDTO(
uuid="FORM_UUID",
name="FORM_NAME"
),
currency="CURRENCY",
issueDate="ISSUE_DATE",
alternateIssueDate="ALTERNATE_ISSUE_DATE",
dueDate="DUE_DATE",
alternateDueDate="ALTERNATE_DUE_DATE",
subtotal="SUBTOTAL_AMOUNT",
tax="TAX_AMOUNT",
total="TOTAL_AMOUNT",
priceTaxInclusive="PRICE_TAX_INCLUSIVE",
accountId="ACCOUNT_ID",
purchaseOrderId="PURCHASE_ORDER_ID",
createdBy="USER_ID",
createdOn="CREATED_DATE",
lastUpdatedBy="USER_ID",
lastUpdatedOn="LAST_UPDATED_DATE",
uuid="INVOICE_UUID",
version="INVOICE_VERSION",
customAttributes=[
CustomAttributesDTO(
name="ATTRIBUTE_NAME",
value="ATTRIBUTE_VALUE"
)
],
customObjects=[],
lines=[
PurchaseInvoiceLineDTO(
subtotal="LINE-SUBTOTAL",
total="LINE-TOTAL",
tax="LINE-TAX",
accountingCode="ACCOUNTING-CODE",
itemUuid="ITEM-UUID",
itemPurchaseOrderQuantity="ITEM-PURCHASE-ORDER-QUANTITY",
itemUom="ITEM-UOM",
itemWarehouse="ITEM-WAREHOUSE",
uuid="LINE-UUID",
version="LINE-VERSION"
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding="OUTSTANDING_AMOUNT",
overdue="OVERDUE_AMOUNT",
lastPaymentDate="LAST_PAYMENT_DATE",
paymentApplied="PAYMENT_APPLIED_AMOUNT",
creditApplied="CREDIT_APPLIED_AMOUNT",
creditIssued="CREDIT_ISSUED_AMOUNT",
lastReactivatedOn="LAST_REACTIVATED_DATE",
lastCancelledOn="LAST_CANCELLED_DATE",
lastAmendedOn="LAST_AMENDED_DATE",
voidedOn="VOIDED_DATE",
deletedOn="DELETED_DATE"
)
)
)
{
"purchase_invoice": {
"status": null,
"id": null,
"custom_form": {},
"subtotal": "",
"tax": "",
"created_by": "",
"last_updated_by": "",
"custom_attributes": [],
"custom_objects": [],
"line": {
"subtotal": "50.000000",
"total": "50.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "8a83dc00-1976-4b51-923f-1ec8837c242c",
"item_purchase_order_quantity": "1.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"version": "0"
},
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
},
"autobillCredential": {
"apiUrl": "https:\/\/dev-api.exsited.com\/api\/v3\/purchase-invoices\/PI-DQLP9B-0001\/lines\/26eb02eb-8d0c-40e3-82e9-984cb9e67a3b",
"appUrl": null,
"ClientId": "DTgOBjoFCTsCCDU3DAY5OWUCBwsKNgIJOgs6Ag0KDgcCCjg3CTkLBwYKBzo3Ag4FBwwCBQwKBjg=",
"ClientSecret": "NmE3L2MuMmQrL2YyYWJgMjErNDViYysyMjU3K2BiNTcrMWI3YDEvZF81NzEzKzcuMDUrYTY3M2E=",
"file_path": "C:\\Users\\saeedullah\\Desktop\\PROJECTS\\exsited\\php-sdk\\exsited-app-sdk-php\/token.json"
}
}
Getting Purchase Invoice List of a Specific Account
Function: purchase_invoice_account_details()
Purpose
The function retrieves detailed information about all purchase invoices associated with a specific account. It helps businesses track all purchase-related financial data for a given account, including invoice totals, statuses, and payment details.
Parameters
Parameter | Type | Description |
---|---|---|
ACCOUNT_ID | string | The unique identifier of the account to retrieve purchase invoices for. |
Use Case
This function can be used by businesses to retrieve purchase invoice details related to a specific account. For example, an accounting or finance team can use it to view all active invoices associated with a customer or supplier, monitor payment statuses, and ensure accurate financial records.
def purchase_invoice_account_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_invoice.account_details(id='7O8DW7')
print(response)
return response
# ResponseToObj().process(response=response["purchase_invoice"])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAccountPurchaseInvoices()
{
$accountId = '7O8DW7';
try {
$response = $this->purchaseInvoiceService->readAccountPurchaseInvoices($accountId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a response containing a list of purchase invoices associated with the provided account. The response includes details such as the status, issue date, total amount, custom attributes, and invoice line details. If an error occurs, an exception with error details is returned.
PurchaseInvoiceAccountDetailDTO(
account=PurchaseInvoiceListDTO(
purchaseInvoices=[
PurchaseInvoiceDTO(
status='ACTIVE',
id='PI-7O8DW7-0004',
customForm=CustomFormsDTO(
uuid=None,
name=None
),
currency=PurchaseInvoiceCurrencyDTO(
id='1',
name='AUD',
link=CurrencyLinkDTO(
rel='self',
href='https://dev-api.exsited.com/api/v1/currencies/1'
)
),
issueDate='2025-07-27T00:00:00Z',
alternateIssueDate='2025-07-27T00:00:00Z',
dueDate='2025-07-27T00:00:00Z',
alternateDueDate='2025-07-27T00:00:00Z',
subtotal='',
tax='',
total='1000.000000',
priceTaxInclusive='true',
accountId='7O8DW7',
purchaseOrderId='',
createdBy='Implementer',
createdOn='2025-07-27T08:09:33Z',
lastUpdatedBy='',
lastUpdatedOn='',
uuid='7ce74a23-a760-4b12-9aac-ec750b4e2771',
version='0',
customAttributes=[],
customObjects=[],
lines=[
PurchaseInvoiceLineDataDTO(
subtotal='1000.000000',
total='1000.000000',
tax='0.000000',
accountingCode='Account Receivable',
itemUuid='',
itemPurchaseOrderQuantity='20.000000',
itemUom='',
itemWarehouse='Default Warehouse',
uuid='6bf3a78a-94b7-4128-8ffd-a58c778de17c',
version='0',
itemId=None,
itemName=None,
itemQuantity=None,
itemPriceSnapshot=None,
itemPriceTax=None,
priceTaxExampt=None
)
],
kpis=PurchaseInvoiceKPIDTO(
outstanding=0,
overdue=0,
lastPaymentDate='',
paymentApplied=0,
creditApplied=0,
creditIssued='',
lastReactivatedOn='',
lastCancelledOn='',
lastAmendedOn='',
voidedOn='',
deletedOn=''
),
externalBankDetails=None
)
],
pagination=PaginationDTO(
records=1,
limit=20,
offset=0,
previousPage='',
nextPage='NULL'
)
)
)
{
"account": {
"purchase_invoices": [
{
"status": "ACTIVE",
"id": "PI-7O8DW7-0004",
"custom_form": {},
"currency": {
"id": "1",
"name": "AUD",
"link": {
"rel": "self",
"href": "https:\/\/dev-api.exsited.com\/api\/v1\/currencies\/1"
}
},
"issue_date": "2025-07-27T00:00:00Z",
"alternate_issue_date": "2025-07-27T00:00:00Z",
"due_date": "2025-07-27T00:00:00Z",
"alternate_due_date": "2025-07-27T00:00:00Z",
"subtotal": "",
"tax": "",
"total": "1000.000000",
"price_tax_inclusive": "true",
"account_id": "7O8DW7",
"purchase_order_id": "",
"created_by": "Implementer",
"created_on": "2025-07-27T08:09:33Z",
"last_updated_by": "",
"last_updated_on": "",
"uuid": "7ce74a23-a760-4b12-9aac-ec750b4e2771",
"version": "0",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "1000.000000",
"total": "1000.000000",
"tax": "0.000000",
"accounting_code": "Account Receivable",
"item_uuid": "",
"item_purchase_order_quantity": "20.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"uuid": "6bf3a78a-94b7-4128-8ffd-a58c778de17c",
"version": "0"
}
],
"kpis": {
"outstanding": 0,
"overdue": 0,
"last_payment_date": "",
"payment_applied": 0,
"credit_applied": 0,
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
}
}
],
"pagination": {
"records": 1,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
},
"autobillCredential": {
"apiUrl": "https:\/\/dev-api.exsited.com\/api\/v3\/accounts\/7O8DW7\/purchase-invoices",
"appUrl": null,
"ClientId": "DTgOBjoFCTsCCDU3DAY5OWUCBwsKNgIJOgs6Ag0KDgcCCjg3CTkLBwYKBzo3Ag4FBwwCBQwKBjg=",
"ClientSecret": "NmE3L2MuMmQrL2YyYWJgMjErNDViYysyMjU3K2BiNTcrMWI3YDEvZF81NzEzKzcuMDUrYTY3M2E=",
"file_path": "C:\\Users\\saeedullah\\Desktop\\PROJECTS\\exsited\\php-sdk\\exsited-app-sdk-php\/token.json"
}
}
Deleting a Purchase Invoice
Function: deletePurchaseInvoice()
Purpose
The function allows users to delete a specific purchase invoice by providing its unique identifier. This is useful for removing invalid or redundant invoices from the system.
Parameter | Type | Description |
---|---|---|
PURCHASE_INVOICE_ID | String | The unique identifier of the purchase invoice. |
Use Case
This function can be used when a business needs to remove an incorrectly created or unnecessary purchase invoice. It helps maintain accurate records by allowing users to delete outdated or duplicate invoices.
def delete_purchase_invoice():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.purchase_invoice.delete(id='PURCHASE_INVOICE_ID')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function deletePurchaseInvoice()
{
$id = 'PURCHASE_INVOICE_ID';
try {
$response = $this->purchaseInvoiceService->delete($id,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a success response with status code 204, indicating that the purchase invoice has been successfully deleted. If an error occurs, an exception is raised with the corresponding error details.
{
"success": True,
"status_code": 204
}
null