Creating Invoice of an Order
Function: create_order_invoice()
Purpose
The function is designed to create an invoice for a specific order using the Exsited SDK. It constructs an invoice request, sends it to the SDK’s invoice creation service and handles any errors during the process.
Parameters
| Parameter | Type | Description |
|---|---|---|
| order_id | String | A unique identifier for the order that the invoice is being created for. |
Use Case
This function can be used when creating invoices for orders in an e-commerce or billing system. It can be used to generate invoices for new orders, provide documentation for transactions or automate the invoice creation process for accounting purposes.
def create_order_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:
request_data = InvoiceCreateDTO(invoice=InvoiceDataDTO(invoiceNote="INVOICE_NOTE"))
response = exsited_sdk.invoice.create(id="ORDER_ID", request_data=request_data)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function createOrderInvoice()
{
$params = [
'invoice' => [
'invoice_note' => 'INVOICE_NOTE'
]
];
$orderID='ORDER_ID';
try {
$invoice = $this->invoiceService->createOrderInvoice($params,$orderID);
echo '<pre>' . json_encode($invoice, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a confirmation of the created invoice, including details such as the invoice number, order ID, and any associated data. In case of failure, error messages and the raw response are returned to help with debugging
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0019',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='CPO-XXXXX-0001',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal=None,
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='Updater Name',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
customForms=None,
currency=CurrencyDTO(
uuid='UUID-PLACEHOLDER',
name='Currency Code (e.g., USD, AUD)',
link='https://api.exsited.com/api/v1/currencies/UUID-PLACEHOLDER'
),
lines=[
OrderLineDTO(
itemId='ITEM-XXXX',
itemOrderQuantity='0.000000',
itemUuid='UUID-PLACEHOLDER',
itemName=None,
shippingCost=None,
itemInvoiceNote=None,
itemDescription=None,
itemType=None,
itemChargeType=None,
chargeItemUuid=None,
version='1',
itemPriceTax=None,
isTaxExemptWhenSold=None,
itemAccountingCode=None,
itemPriceSnapshot=None,
itemSaleTaxConfiguration=None,
purchaseOrder=None
)
]
)
)
{
"invoice": {
"status": "ACTIVE",
"id": "INV-XXXXX-0018",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "UUID-PLACEHOLDER",
"name": "Custom Form Name"
},
"currency": {
"uuid": "UUID-PLACEHOLDER",
"name": "Currency Code (e.g., USD, AUD)",
"link": "https://api.exsited.com/api/v1/currencies/UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "CPO-XXXXX-0001",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Standard Invoice Note",
"account_id": "ACC-XXXXX",
"order_id": "ORD-XXXXX-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "0.000000",
"last_payment_date": "YYYY-MM-DDTHH:MM:SSZ",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "0.000000",
"last_reactivated_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_cancelled_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_amended_on": "YYYY-MM-DDTHH:MM:SSZ",
"voided_on": "YYYY-MM-DDTHH:MM:SSZ",
"deleted_on": "YYYY-MM-DDTHH:MM:SSZ"
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "Last Updater Name",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "UUID-PLACEHOLDER",
"code": "TAX-CODE",
"rate": "0.0000",
"link": "https://api.exsited.com/api/v1/taxes/UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": "Account Code"
},
"item_uuid": "UUID-PLACEHOLDER",
"item_id": "ITEM-XXXX",
"item_order_quantity": "0.000000",
"item_uom": "Unit of Measure",
"item_warehouse": "Warehouse Name",
"pricing_snapshot_uuid": "UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
}
Getting All Invoice List
Function: get_invoice_list()
Purpose
The function retrieves a complete list of invoices available on the system. It provides a streamlined way to access billing records, ensuring smooth integration with financial and accounting workflows.
Parameters
This function does not require any input parameters.
Use Case
This function can be used to view or analyze the account's entire invoice history. For instance, this function is helpful for financial auditing, generating comprehensive reports, or conducting invoice-related analyses.
def get_invoice_list():
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.invoice.list()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoiceList()
{
try {
$response = $this->invoiceService->readAll();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a structured list containing details for each invoice associated with the account. If an error occurs during the retrieval process, both the error message and raw response are returned for debugging.
InvoiceListDTO(
invoices=[
InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0019',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='CPO-XXXXX-0001',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal='0.000000',
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='Updater Name',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
customForms=None,
currency=CurrencyDTO(
uuid='UUID-PLACEHOLDER',
name='Currency Code (e.g., USD, AUD)',
link='https://api.exsited.com/api/v1/currencies/UUID-PLACEHOLDER'
),
lines=[
OrderLineDTO(
itemId='ITEM-XXXX',
itemOrderQuantity='0.000000',
itemUuid='UUID-PLACEHOLDER',
itemName=None,
shippingCost=None,
itemInvoiceNote=None,
itemDescription=None,
itemType=None,
itemChargeType=None,
chargeItemUuid=None,
version='1',
itemPriceTax=None,
isTaxExemptWhenSold=None,
itemAccountingCode=None,
itemPriceSnapshot=None,
itemSaleTaxConfiguration=None,
purchaseOrder=None
)
]
)
],
pagination=PaginationDTO(
records=1,
limit=20,
offset=0,
previousPage='',
nextPage='NULL'
)
)
{
"invoices": [
{
"status": "ACTIVE",
"id": "INV-XXXXX-0019",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "UUID-PLACEHOLDER",
"name": "Custom Form Name"
},
"currency": {
"uuid": "d6a08554-30fa-42e6-afaa-2d62b3de8354",
"name": "AUD",
"link": "https://api-stage.exsited.com/api/v1/currencies/d6a08554-30fa-42e6-afaa-2d62b3de8354"
},
"customer_purchase_order_id": "CPO-XXXXX-0001",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Invoice Note Placeholder",
"account_id": "ACC-XXXXX",
"order_id": "ORD-XXXXX-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "",
"last_payment_date": "",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "Updater Name",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "UUID-PLACEHOLDER",
"code": "GST",
"rate": "0.0000",
"link": "https://app-stage.exsited.com/api/v1/taxes/UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": ""
},
"item_uuid": "UUID-PLACEHOLDER",
"item_id": "ITEM-XXXXX",
"item_order_quantity": "0.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"pricing_snapshot_uuid": "UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
}
],
"pagination": {
"records": 1,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
Getting Specific Invoice Details
Function: get_invoice_details()
Purpose
The function retrieves detailed information about a specific invoice, identified by its unique invoice ID. This function is essential for reviewing invoice data such as items, amounts, dates, and other relevant details.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | String | The unique identifier of the invoice whose details need to be fetched. |
Use Case
This function can be used for businesses or support teams needing to access comprehensive information about a specific invoice. It can be used in scenarios such as verifying invoice contents, conducting audits, or troubleshooting billing issues.
def get_invoice_details():
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.invoice.details(id="INVOICE_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoiceDetails()
{
$id='INVOICE_ID';
try {
$response = $this->invoiceService->readDetails($id);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns detailed information about the specified invoice, including its items and any other relevant data. In case of an error, it provides an error message along with the raw response for debugging.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0019',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal='0.000000',
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='Updater Name',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
lines=[
OrderLineDTO(
itemId='ITEM-XXXXX',
itemOrderQuantity='0.000000',
itemUuid='UUID-PLACEHOLDER',
itemName=None,
shippingCost=None,
itemInvoiceNote=None,
itemDescription=None,
itemType=None,
itemChargeType=None,
chargeItemUuid=None,
version='1',
itemPriceTax=None,
isTaxExemptWhenSold=None,
itemAccountingCode=None,
itemPriceSnapshot=None,
itemSaleTaxConfiguration=None,
purchaseOrder=None
)
],
customForms=None,
currency=CurrencyDTO(
uuid='UUID-PLACEHOLDER',
name='AUD',
link='https://api-stage.exsited.com/api/v1/currencies/d6a08554-30fa-42e6-afaa-2d62b3de8354'
)
)
)
{
"invoice": {
"status": "ACTIVE",
"id": "INV-XXXXX-0019",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "UUID-PLACEHOLDER",
"name": "Custom Form Name"
},
"currency": {
"uuid": "UUID-PLACEHOLDER",
"name": "AUD",
"link": "https://api-stage.exsited.com/api/v1/currencies/d6a08554-30fa-42e6-afaa-2d62b3de8354"
},
"customer_purchase_order_id": "CPO-XXXXX-0001",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Invoice Note Placeholder",
"account_id": "ACC-XXXXX",
"order_id": "ORD-XXXXX-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "",
"last_payment_date": "",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "Updater Name",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "UUID-PLACEHOLDER",
"code": "GST",
"rate": "0.0000",
"link": "https://app-stage.exsited.com/api/v1/taxes/UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": ""
},
"item_uuid": "UUID-PLACEHOLDER",
"item_id": "ITEM-XXXXX",
"item_order_quantity": "0.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"pricing_snapshot_uuid": "UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
}
}
Getting Invoice Details of an Order
Function: get_invoice_details_against_order()
Purpose
The function retrieves invoice details associated with a specific order ID. This function helps to check the invoicing status, items, and other relevant details linked to a particular order.
Parameters
| Parameter | Type | Description |
|---|---|---|
| order_id | String | The unique identifier of the order for which invoice details are to be fetched. |
Use Case
This function can be used for verifying which invoice is associated with a particular order. It can be used in scenarios such as order reconciliation, verifying the accuracy of invoice details, or for auditing purposes.
def get_invoice_details_against_order():
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.invoice.invoice_details_against_order(order_id="ORDER_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoiceDetailsAgainstOrder()
{
$orderId='ORDER_ID';
try {
$response = $this->invoiceService->readOrderInvoice($orderId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Response
The function returns detailed invoice information related to the provided order ID. If an error occurs, it returns an error message along with the raw response for debugging.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0019',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal=None,
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
lines=[
{
'subtotal': '0.000000',
'total': '0.000000',
'tax': {
'amount': '0.000000',
'uuid': 'TAX-UUID-PLACEHOLDER',
'code': 'GST',
'rate': '0.0000',
'link': 'https://app-stage.exsited.com/api/v1/taxes/TAX-UUID-PLACEHOLDER'
},
'accounting_code': {'sales_revenue': ''},
'item_uuid': 'ITEM-UUID-PLACEHOLDER',
'item_id': 'ITEM-XXXXX',
'item_order_quantity': '0.000000',
'item_uom': '',
'item_warehouse': 'Default Warehouse',
'pricing_snapshot_uuid': 'PRICING-UUID-PLACEHOLDER',
'charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'uuid': 'UUID-PLACEHOLDER',
'version': '1'
}
],
customForms={'uuid': '', 'name': ''},
currency={
'uuid': 'CURRENCY-UUID-PLACEHOLDER',
'name': 'AUD',
'link': 'https://api-stage.exsited.com/api/v1/currencies/CURRENCY-UUID-PLACEHOLDER'
}
)
)
{
"order": {
"invoices": [
{
"status": "ACTIVE",
"id": "INV-XXXXX-XXXX",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "",
"name": ""
},
"currency": {
"uuid": "CURRENCY-UUID-PLACEHOLDER",
"name": "AUD",
"link": "https://api-stage.exsited.com/api/v1/currencies/CURRENCY-UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Invoice Note Placeholder",
"account_id": "ACC-XXXXX",
"order_id": "ORD-XXXXX-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "",
"last_payment_date": "",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "TAX-UUID-PLACEHOLDER",
"code": "GST",
"rate": "0.0000",
"link": "https://app-stage.exsited.com/api/v1/taxes/TAX-UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": ""
},
"item_uuid": "ITEM-UUID-PLACEHOLDER",
"item_id": "ITEM-XXXXX",
"item_order_quantity": "0.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"pricing_snapshot_uuid": "PRICING-UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
}
],
"pagination": {
"records": 1,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
}
}
Getting Invoices List of an Order
Function: get_order_invoice_list()
Purpose
The function retrieves a list of all invoices associated with a specific order ID. It’s useful for viewing and managing multiple invoices related to a single order.
Parameters
| Parameter | Type | Description |
|---|---|---|
| order_id | String | The unique identifier of the order for which the list of invoices is to be fetched. |
Use Case
This function can be used when you need to access a complete list of invoices for an order, such as during financial reconciliation, order auditing, or customer billing verification.
def get_order_invoice_list():
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.invoice.invoice_details_list_against_order(order_id="ORDER_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getOrderInvoiceList()
{
$orderId='ORDER_ID';
try {
$response = $this->invoiceService->readOrderInvoice($orderId);
echo '' . json_encode($response, JSON_PRETTY_PRINT) . '';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Response
The function returns a list of invoice details related to the provided order ID. If an error occurs, it returns both the error message and the raw response for debugging.
[
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0019',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal=None,
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
lines=[
{
'subtotal': '0.000000',
'total': '0.000000',
'tax': {
'amount': '0.000000',
'uuid': 'TAX-UUID-PLACEHOLDER',
'code': 'GST',
'rate': '00.0000',
'link': 'https://app-stage.exsited.com/api/v1/taxes/TAX-UUID-PLACEHOLDER'
},
'accounting_code': {'sales_revenue': ''},
'item_uuid': 'ITEM-UUID-PLACEHOLDER',
'item_id': 'ITEM-XXXXX',
'item_order_quantity': '0.000000',
'item_uom': '',
'item_warehouse': 'Default Warehouse',
'pricing_snapshot_uuid': 'PRICING-UUID-PLACEHOLDER',
'charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'uuid': 'UUID-PLACEHOLDER',
'version': '1'
}
],
customForms={'uuid': '', 'name': ''},
currency={
'uuid': 'CURRENCY-UUID-PLACEHOLDER',
'name': 'AUD',
'link': 'https://api-stage.exsited.com/api/v1/currencies/CURRENCY-UUID-PLACEHOLDER'
}
)
),
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INV-XXXXX-0020',
type='LINKED_WITH_ORDER',
customerPurchaseOrderId='',
billingStartDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingStartDate='YYYY-MM-DDTHH:MM:SSZ',
billingEndDate='YYYY-MM-DDTHH:MM:SSZ',
alternateBillingEndDate='YYYY-MM-DDTHH:MM:SSZ',
issueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateIssueDate='YYYY-MM-DDTHH:MM:SSZ',
dueDate='YYYY-MM-DDTHH:MM:SSZ',
alternateDueDate='YYYY-MM-DDTHH:MM:SSZ',
subtotal='0.000000',
tax='0.000000',
taxTotal=None,
total='0.000000',
paid='0.000000',
due='0.000000',
paymentStatus='UNPAID',
discountAmount='0.000000',
priceTaxInclusive='true',
invoiceNote='Invoice Note Placeholder',
accountId='ACC-XXXXX',
orderId='ORD-XXXXX-0003',
createdBy='Creator Name',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ',
uuid='UUID-PLACEHOLDER',
version='1',
lines=[
{
'subtotal': '0.000000',
'total': '0.000000',
'tax': {
'amount': '0.000000',
'uuid': 'TAX-UUID-PLACEHOLDER',
'code': 'GST',
'rate': '00.0000',
'link': 'https://app-stage.exsited.com/api/v1/taxes/TAX-UUID-PLACEHOLDER'
},
'accounting_code': {'sales_revenue': ''},
'item_uuid': 'ITEM-UUID-PLACEHOLDER',
'item_id': 'ITEM-XXXXX',
'item_order_quantity': '0.000000',
'item_uom': '',
'item_warehouse': 'Default Warehouse',
'pricing_snapshot_uuid': 'PRICING-UUID-PLACEHOLDER',
'charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_start_date': 'YYYY-MM-DDTHH:MM:SSZ',
'charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'alternate_charging_end_date': 'YYYY-MM-DDTHH:MM:SSZ',
'uuid': 'UUID-PLACEHOLDER',
'version': '1'
}
],
customForms={'uuid': '', 'name': ''},
currency={
'uuid': 'CURRENCY-UUID-PLACEHOLDER',
'name': 'AUD',
'link': 'https://api-stage.exsited.com/api/v1/currencies/CURRENCY-UUID-PLACEHOLDER'
}
)
)
]
{
"order": {
"invoices": [
{
"status": "ACTIVE",
"id": "INV-9N9GSO-0019",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "",
"name": ""
},
"currency": {
"uuid": "CURRENCY-UUID-PLACEHOLDER",
"name": "AUD",
"link": "https:\/\/api-stage.exsited.com\/api\/v1\/currencies/CURRENCY-UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Invoice Note Placeholder",
"account_id": "ACCOUNT-ID-PLACEHOLDER",
"order_id": "ORD-9N9GSO-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "",
"last_payment_date": "",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "TAX-UUID-PLACEHOLDER",
"code": "GST",
"rate": "0.0000",
"link": "https:\/\/app-stage.exsited.com\/api\/v1\/taxes/TAX-UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": ""
},
"item_uuid": "ITEM-UUID-PLACEHOLDER",
"item_id": "ITEM-XXXXX",
"item_order_quantity": "0.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"pricing_snapshot_uuid": "PRICING-UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
},
{
"status": "ACTIVE",
"id": "INV-9N9GSO-0020",
"type": "LINKED_WITH_ORDER",
"custom_form": {
"uuid": "",
"name": ""
},
"currency": {
"uuid": "CURRENCY-UUID-PLACEHOLDER",
"name": "AUD",
"link": "https:\/\/api-stage.exsited.com\/api\/v1\/currencies/CURRENCY-UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "0.000000",
"tax": "0.000000",
"total": "0.000000",
"paid": "0.000000",
"due": "0.000000",
"payment_status": "UNPAID",
"last_payment": null,
"discount_amount": "0.000000",
"price_tax_inclusive": "true",
"invoice_note": "Invoice Note Placeholder",
"account_id": "ACCOUNT-ID-PLACEHOLDER",
"order_id": "ORD-9N9GSO-0003",
"kpis": {
"outstanding": "0.000000",
"overdue": "",
"last_payment_date": "",
"payment_applied": "0.000000",
"credit_applied": "0.000000",
"credit_issued": "",
"last_reactivated_on": "",
"last_cancelled_on": "",
"last_amended_on": "",
"voided_on": "",
"deleted_on": ""
},
"created_by": "Creator Name",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "0.000000",
"total": "0.000000",
"tax": {
"amount": "0.000000",
"uuid": "TAX-UUID-PLACEHOLDER",
"code": "GST",
"rate": "0.0000",
"link": "https:\/\/app-stage.exsited.com\/api\/v1\/taxes/TAX-UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": ""
},
"item_uuid": "ITEM-UUID-PLACEHOLDER",
"item_id": "ITEM-XXXXX",
"item_order_quantity": "0.000000",
"item_uom": "",
"item_warehouse": "Default Warehouse",
"pricing_snapshot_uuid": "PRICING-UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "1"
}
]
}
],
"pagination": {
"records": 2,
"limit": 20,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
}
Getting Information of a Specific Invoice
Function: get_invoice_information()
Purpose
The function retrieves detailed information about a specific invoice using its unique identifier. This functionality allows users to access invoice metadata, payment status, and other associated data.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | String |
The unique identifier for the invoice whose information is being retrieved |
Use Case
This function can be used to fetch comprehensive details about an invoice for review, auditing, or reporting purposes. It supports applications requiring detailed invoice insights for customer or system interaction.
def get_invoice_information():
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.invoice.information(id="INVOICE_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoiceInformation()
{
$id='INVOICE_ID';
try {
$invoice = $this->invoiceService->readDetailsInformation($id);
echo '' . json_encode($invoice, JSON_PRETTY_PRINT) . '';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
Returns a JSON object containing invoice details, including itemized charges, payment status, and metadata. In case of an error, detailed messages and raw response data are provided.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status="ACTIVE",
id="PLACEHOLDER_INVOICE_ID",
type="PLACEHOLDER_TYPE",
customerPurchaseOrderId="PLACEHOLDER_CUSTOMER_PO_ID",
billingStartDate="YYYY-MM-DDTHH:MM:SSZ",
alternateBillingStartDate="YYYY-MM-DDTHH:MM:SSZ",
billingEndDate="YYYY-MM-DDTHH:MM:SSZ",
alternateBillingEndDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
alternateIssueDate="YYYY-MM-DDTHH:MM:SSZ",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
alternateDueDate="YYYY-MM-DDTHH:MM:SSZ",
subtotal="PLACEHOLDER_SUBTOTAL",
tax="PLACEHOLDER_TAX",
taxTotal=None,
total="PLACEHOLDER_TOTAL",
paid="PLACEHOLDER_PAID",
due="PLACEHOLDER_DUE",
paymentStatus="PLACEHOLDER_PAYMENT_STATUS",
discountAmount="PLACEHOLDER_DISCOUNT_AMOUNT",
priceTaxInclusive="PLACEHOLDER_TAX_INCLUSIVE",
invoiceNote="PLACEHOLDER_NOTE",
accountId="PLACEHOLDER_ACCOUNT_ID",
orderId="PLACEHOLDER_ORDER_ID",
createdBy="PLACEHOLDER_CREATED_BY",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="PLACEHOLDER_LAST_UPDATED_BY",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER",
version="PLACEHOLDER_VERSION",
lines=None,
customForms=None,
currency=CurrencyDTO(
uuid="UUID-PLACEHOLDER",
name="PLACEHOLDER_CURRENCY",
link="https://api-stage.exsited.com/api/v1/currencies/UUID-PLACEHOLDER"
),
lastPayment=None,
kpis={
"outstanding": "PLACEHOLDER_OUTSTANDING",
"overdue": "PLACEHOLDER_OVERDUE",
"last_payment_date": "PLACEHOLDER_LAST_PAYMENT_DATE",
"payment_applied": "PLACEHOLDER_PAYMENT_APPLIED",
"credit_applied": "PLACEHOLDER_CREDIT_APPLIED",
"credit_issued": "PLACEHOLDER_CREDIT_ISSUED",
"last_reactivated_on": "PLACEHOLDER_LAST_REACTIVATED_ON",
"last_cancelled_on": "PLACEHOLDER_LAST_CANCELLED_ON",
"last_amended_on": "PLACEHOLDER_LAST_AMENDED_ON",
"voided_on": "PLACEHOLDER_VOIDED_ON",
"deleted_on": "PLACEHOLDER_DELETED_ON",
},
customAttributes=[],
customObjects=[]
)
)
{
"invoice": {
"status": "ACTIVE",
"id": "PLACEHOLDER_INVOICE_ID",
"type": "PLACEHOLDER_TYPE",
"custom_form": {
"uuid": "UUID-PLACEHOLDER",
"name": "PLACEHOLDER_NAME"
},
"currency": {
"uuid": "UUID-PLACEHOLDER",
"name": "PLACEHOLDER_CURRENCY",
"link": "https://api-stage.exsited.com/api/v1/currencies/UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "PLACEHOLDER_PO_ID",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "PLACEHOLDER_SUBTOTAL",
"tax": "PLACEHOLDER_TAX",
"total": "PLACEHOLDER_TOTAL",
"paid": "PLACEHOLDER_PAID",
"due": "PLACEHOLDER_DUE",
"payment_status": "PLACEHOLDER_PAYMENT_STATUS",
"last_payment": null,
"discount_amount": "PLACEHOLDER_DISCOUNT_AMOUNT",
"price_tax_inclusive": "PLACEHOLDER_TAX_INCLUSIVE",
"invoice_note": "PLACEHOLDER_NOTE",
"account_id": "PLACEHOLDER_ACCOUNT_ID",
"order_id": "PLACEHOLDER_ORDER_ID",
"kpis": {
"outstanding": "PLACEHOLDER_OUTSTANDING",
"overdue": "PLACEHOLDER_OVERDUE",
"last_payment_date": "PLACEHOLDER_LAST_PAYMENT_DATE",
"payment_applied": "PLACEHOLDER_PAYMENT_APPLIED",
"credit_applied": "PLACEHOLDER_CREDIT_APPLIED",
"credit_issued": "PLACEHOLDER_CREDIT_ISSUED",
"last_reactivated_on": "PLACEHOLDER_LAST_REACTIVATED_ON",
"last_cancelled_on": "PLACEHOLDER_LAST_CANCELLED_ON",
"last_amended_on": "PLACEHOLDER_LAST_AMENDED_ON",
"voided_on": "PLACEHOLDER_VOIDED_ON",
"deleted_on": "PLACEHOLDER_DELETED_ON"
},
"created_by": "PLACEHOLDER_CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "PLACEHOLDER_LAST_UPDATED_BY",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "PLACEHOLDER_VERSION",
"custom_attributes": [],
"custom_objects": []
}
}
Deleting an Invoice
Function: delete_invoice()
Purpose
The function removes an invoice from the system using its unique identifier. This action typically ensures that the invoice is no longer available for future processing or retrieval.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | String | The unique identifier for the invoice that is to be deleted. |
Use Case
This function can be used to remove invoices from the system that are no longer needed, either due to errors, outdated information or administrative purposes.
def delete_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.invoice.delete(id="INVOICE_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function deleteInvoice()
{
$id='INVOICE_ID';
try {
$response = $this->invoiceService->delete($id);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
Returns a confirmation message indicating successful deletion or an error message with additional details.
{
"success": true,
"status_code": 204
}
null
Getting Invoices List of an Account
Function: get_invoices_by_account()
Purpose
The function fetches a list of invoices associated with a specific account. This functionality enables users to view all invoices linked to a given account ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
| account_id | String | The unique identifier for the account whose invoices need to be retrieved. |
Use Case
This function can be used to get a detailed overview of all invoices linked to a specific account. This is helpful for tracking billing history, auditing, or resolving invoice-related queries.
def get_invoices_by_account():
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.invoice.invoice_account(accountId="ACCOUNT_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoicesByAccount()
{
$accountId='ACCOUNT_ID';
try {
$response = $this->invoiceService->readAccountInvoices($accountId);
echo '' . json_encode($response, JSON_PRETTY_PRINT) . '';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
Returns a list of invoices associated with the specified account, including invoice details such as invoice IDs, dates, amounts, and statuses. In case of an error, detailed messages and raw responses are provided.
InvoiceAccountDTO(
account=InvoiceListDTO(
invoices=[
InvoiceDataDTO(
status="ACTIVE",
id="PLACEHOLDER_INVOICE_ID",
type="PLACEHOLDER_TYPE",
customerPurchaseOrderId="PLACEHOLDER_PO_ID",
billingStartDate="YYYY-MM-DDTHH:MM:SSZ",
alternateBillingStartDate="YYYY-MM-DDTHH:MM:SSZ",
billingEndDate="YYYY-MM-DDTHH:MM:SSZ",
alternateBillingEndDate="YYYY-MM-DDTHH:MM:SSZ",
issueDate="YYYY-MM-DDTHH:MM:SSZ",
alternateIssueDate="YYYY-MM-DDTHH:MM:SSZ",
dueDate="YYYY-MM-DDTHH:MM:SSZ",
alternateDueDate="YYYY-MM-DDTHH:MM:SSZ",
subtotal="PLACEHOLDER_SUBTOTAL",
tax="PLACEHOLDER_TAX",
taxTotal=None,
total="PLACEHOLDER_TOTAL",
paid="PLACEHOLDER_PAID",
due="PLACEHOLDER_DUE",
paymentStatus="PLACEHOLDER_PAYMENT_STATUS",
discountAmount="PLACEHOLDER_DISCOUNT_AMOUNT",
priceTaxInclusive="PLACEHOLDER_TAX_INCLUSIVE",
invoiceNote="PLACEHOLDER_NOTE",
accountId="PLACEHOLDER_ACCOUNT_ID",
orderId="PLACEHOLDER_ORDER_ID",
createdBy="PLACEHOLDER_CREATED_BY",
createdOn="YYYY-MM-DDTHH:MM:SSZ",
lastUpdatedBy="PLACEHOLDER_LAST_UPDATED_BY",
lastUpdatedOn="YYYY-MM-DDTHH:MM:SSZ",
uuid="UUID-PLACEHOLDER",
version="PLACEHOLDER_VERSION",
lines=[
OrderLineDTO(
itemId="PLACEHOLDER_ITEM_ID",
itemOrderQuantity="PLACEHOLDER_QUANTITY",
itemUuid="UUID-PLACEHOLDER",
itemName=None,
shippingCost=None,
itemInvoiceNote=None,
itemDescription=None,
itemType=None,
itemChargeType=None,
chargeItemUuid=None,
version="PLACEHOLDER_VERSION",
itemPriceTax=None,
isTaxExemptWhenSold=None,
itemPriceSnapshot=None,
itemSaleTaxConfiguration=None,
purchaseOrder=None,
packageName=None,
itemSerialOrBatchNumber=None,
itemCustomAttributes=None,
op=None,
uuid="UUID-PLACEHOLDER",
itemProperties=None,
subtotal="PLACEHOLDER_SUBTOTAL",
total="PLACEHOLDER_TOTAL",
tax=TaxDTO(
uuid="UUID-PLACEHOLDER",
code="PLACEHOLDER_TAX_CODE",
rate="PLACEHOLDER_TAX_RATE",
link="https://app-stage.exsited.com/api/v1/taxes/UUID-PLACEHOLDER",
amount="PLACEHOLDER_TAX_AMOUNT"
),
itemUom="PLACEHOLDER_UOM",
itemWarehouse="PLACEHOLDER_WAREHOUSE",
pricingSnapshotUuid="UUID-PLACEHOLDER",
chargingStartDate="YYYY-MM-DDTHH:MM:SSZ",
alternateChargingStartDate="YYYY-MM-DDTHH:MM:SSZ",
chargingEndDate="YYYY-MM-DDTHH:MM:SSZ",
alternateChargingEndDate="YYYY-MM-DDTHH:MM:SSZ",
itemPrice=None,
itemDiscountAmount=None,
taxAmount=None,
operation=None,
discount=None,
uom=None,
warehouse=None,
quantity=None,
accountingCode={"sales_revenue": ""},
itemAccountingCode=None
)
],
customForms=None,
currency=CurrencyDTO(
uuid="UUID-PLACEHOLDER",
name="PLACEHOLDER_CURRENCY",
link="https://api-stage.exsited.com/api/v1/currencies/UUID-PLACEHOLDER"
),
lastPayment=None,
kpis={
"outstanding": "PLACEHOLDER_OUTSTANDING",
"overdue": "PLACEHOLDER_OVERDUE",
"last_payment_date": "PLACEHOLDER_LAST_PAYMENT_DATE",
"payment_applied": "PLACEHOLDER_PAYMENT_APPLIED",
"credit_applied": "PLACEHOLDER_CREDIT_APPLIED",
"credit_issued": "PLACEHOLDER_CREDIT_ISSUED",
"last_reactivated_on": "PLACEHOLDER_LAST_REACTIVATED_ON",
"last_cancelled_on": "PLACEHOLDER_LAST_CANCELLED_ON",
"last_amended_on": "PLACEHOLDER_LAST_AMENDED_ON",
"voided_on": "PLACEHOLDER_VOIDED_ON",
"deleted_on": "PLACEHOLDER_DELETED_ON"
},
customAttributes=[],
customObjects=[]
)
],
pagination=PaginationDTO(
records=1,
limit=20,
offset=0,
previousPage="PLACEHOLDER_PREVIOUS_PAGE",
nextPage="PLACEHOLDER_NEXT_PAGE"
)
)
)
{
"account": {
"invoices": [
{
"status": "ACTIVE",
"id": "PLACEHOLDER_INVOICE_ID",
"type": "PLACEHOLDER_TYPE",
"custom_form": {
"uuid": "UUID-PLACEHOLDER",
"name": "PLACEHOLDER_NAME"
},
"currency": {
"uuid": "UUID-PLACEHOLDER",
"name": "PLACEHOLDER_CURRENCY",
"link": "https://api-stage.exsited.com/api/v1/currencies/UUID-PLACEHOLDER"
},
"customer_purchase_order_id": "PLACEHOLDER_PO_ID",
"billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_billing_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_issue_date": "YYYY-MM-DDTHH:MM:SSZ",
"due_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_due_date": "YYYY-MM-DDTHH:MM:SSZ",
"subtotal": "PLACEHOLDER_SUBTOTAL",
"tax": "PLACEHOLDER_TAX",
"total": "PLACEHOLDER_TOTAL",
"paid": "PLACEHOLDER_PAID",
"due": "PLACEHOLDER_DUE",
"payment_status": "PLACEHOLDER_PAYMENT_STATUS",
"last_payment": null,
"discount_amount": "PLACEHOLDER_DISCOUNT_AMOUNT",
"price_tax_inclusive": "PLACEHOLDER_TAX_INCLUSIVE",
"invoice_note": "PLACEHOLDER_NOTE",
"account_id": "PLACEHOLDER_ACCOUNT_ID",
"order_id": "PLACEHOLDER_ORDER_ID",
"kpis": {
"outstanding": "PLACEHOLDER_OUTSTANDING",
"overdue": "PLACEHOLDER_OVERDUE",
"last_payment_date": "PLACEHOLDER_LAST_PAYMENT_DATE",
"payment_applied": "PLACEHOLDER_PAYMENT_APPLIED",
"credit_applied": "PLACEHOLDER_CREDIT_APPLIED",
"credit_issued": "PLACEHOLDER_CREDIT_ISSUED",
"last_reactivated_on": "PLACEHOLDER_LAST_REACTIVATED_ON",
"last_cancelled_on": "PLACEHOLDER_LAST_CANCELLED_ON",
"last_amended_on": "PLACEHOLDER_LAST_AMENDED_ON",
"voided_on": "PLACEHOLDER_VOIDED_ON",
"deleted_on": "PLACEHOLDER_DELETED_ON"
},
"created_by": "PLACEHOLDER_CREATED_BY",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "PLACEHOLDER_LAST_UPDATED_BY",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "PLACEHOLDER_VERSION",
"custom_attributes": [],
"custom_objects": [],
"lines": [
{
"subtotal": "PLACEHOLDER_SUBTOTAL",
"total": "PLACEHOLDER_TOTAL",
"tax": {
"amount": "PLACEHOLDER_TAX_AMOUNT",
"uuid": "UUID-PLACEHOLDER",
"code": "PLACEHOLDER_TAX_CODE",
"rate": "PLACEHOLDER_TAX_RATE",
"link": "https://app-stage.exsited.com/api/v1/taxes/UUID-PLACEHOLDER"
},
"accounting_code": {
"sales_revenue": "PLACEHOLDER_REVENUE_CODE"
},
"item_uuid": "UUID-PLACEHOLDER",
"item_id": "PLACEHOLDER_ITEM_ID",
"item_order_quantity": "PLACEHOLDER_QUANTITY",
"item_uom": "PLACEHOLDER_UOM",
"item_warehouse": "PLACEHOLDER_WAREHOUSE",
"pricing_snapshot_uuid": "UUID-PLACEHOLDER",
"charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_start_date": "YYYY-MM-DDTHH:MM:SSZ",
"charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"alternate_charging_end_date": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"version": "PLACEHOLDER_VERSION"
}
]
}
],
"pagination": {
"records": 1,
"limit": 20,
"offset": 0,
"previous_page": "PLACEHOLDER_PREVIOUS_PAGE",
"next_page": "PLACEHOLDER_NEXT_PAGE"
}
}
}
Getting Notes List of a Specific Invoice
Function: get_invoice_note_list()
Purpose
The function retrieves all notes associated with a specific invoice. This allows users to access detailed information about invoice-related comments, including attached files and version history.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | String | The unique identifier of the invoice. |
Use Case
This function can be used when a user needs to track notes linked to an invoice, including updates, file attachments, and author details. It helps in auditing and maintaining communication history regarding invoices.
def get_invoice_note_list():
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.notes.invoice_note_details(id="INVOICE_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function getInvoieNoteList()
{
$invoiceId = 'INVOICE_ID';
try {
$response = $this->notesService->readInvoiceAllNotes($invoiceId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains a list of notes with details such as content, version, associated files, and timestamps. Pagination details are also included to support large data retrieval.
InvoiceNoteDetailsDTO(
invoice=InvoiceNoteDataDTO(
notes=[
NoteDataDTO(
uuid='NOTE_UUID',
version='NOTE_VERSION',
content='NOTE_CONTENT',
files=[
FileDTO(
uuid='FILE_UUID_1',
name='FILE_NAME_1',
version='FILE_VERSION_1'
),
FileDTO(
uuid='FILE_UUID_2',
name='FILE_NAME_2',
version='FILE_VERSION_2'
)
],
createdBy='USER_ID',
createdOn='CREATED_TIMESTAMP',
lastUpdatedBy='USER_ID',
lastUpdatedOn='LAST_UPDATED_TIMESTAMP'
)
],
pagination=PaginationDTO(
records='TOTAL_RECORDS',
limit='PAGE_LIMIT',
offset='PAGE_OFFSET',
previousPage='PREVIOUS_PAGE_URL',
nextPage='NEXT_PAGE_URL'
)
)
)
{
"invoice": {
"notes": [
{
"uuid": "NOTE_UUID",
"version": "NOTE_VERSION",
"content": "NOTE_CONTENT",
"files": [
{
"uuid": "FILE_UUID_1",
"name": "FILE_NAME_1",
"version": "FILE_VERSION_1"
},
{
"uuid": "FILE_UUID_2",
"name": "FILE_NAME_2",
"version": "FILE_VERSION_2"
}
],
"created_by": "USER_ID",
"created_on": "CREATED_TIMESTAMP",
"last_updated_by": "USER_ID",
"last_updated_on": "LAST_UPDATED_TIMESTAMP"
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "PAGE_LIMIT",
"offset": "PAGE_OFFSET",
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
}
Creating Notes of an Invoice
Function: create_invoice_Notes()
Purpose
This function allows users to add notes to an invoice, optionally attaching files. It is used to document important details, such as transaction updates or additional remarks. Admin users and authorized customers can attach relevant files and notes to maintain a clear record of invoice-related communications.
Parameters
| Parameter | Type | Description |
|---|---|---|
| file_url | String | Path of the file to be attached to the note. |
| note | String | The content of the note. |
| invoice | String | Unique identifier of the invoice. |
Use Case
This function can be used to add notes to an invoice to clarify charges, request adjustments, or attach supporting documents. For example, a user might upload a scanned receipt and write a note explaining a refund request. This ensures that all relevant information is logged for future reference.
def create_invoice_notes():
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:
datas = "NOTE"
file_url = "FILE_URL"
response = exsited_sdk.notes.invoice_add_notes(file_url=file_url, datas=datas, invoice_id="INVOICE_ID")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function createInvoiceNotes()
{
$invoiceId = 'INVOICE_ID';
$filePaths = 'FILE_URL';
$note = 'NOTE';
try {
$response = $this->notesService->createInvoiceNotes($filePaths, $note, $invoiceId,'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response confirms the successful addition of a note by returning the unique identifier (UUID) of the newly created note. This allows users to track and reference notes efficiently.
InvoiceNoteResponseDetailsDTO(
invoice=InvoiceNoteResponseDataDTO(
notes=NoteDataDTO(
uuid='UUID_PLACEHOLDER',
version=VERSION,
content=CONTENT,
files=FILES,
createdBy=CREATED_BY,
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy=LAST_UPDATED_BY,
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ'
)
)
)
{
"invoice": {
"notes": {
"uuid": "UUID_PLACEHOLDER"
}
}
}
Getting Specific Note Details of an Invoice
Function: invoice_note_details()
Purpose
This function retrieves the details of a specific invoice note using its unique identifier. It provides information such as note content, attached files, version history, and timestamps. This helps users track updates and view supporting documents related to the invoice.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | String | The unique identifier of the invoice. |
| note_uuid | String | Unique identifier of the note. |
Use Case
This function can be used to retrieve invoice note details to verify past communications, check attached documents, or confirm updates made by different users. For instance, an admin reviewing a disputed transaction can access the note history, including previous versions and file attachments, to resolve the issue.
def invoice_note_details():
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.notes.invoice_note_uuid_details(id="INVOICE_ID", uuid='NOTE_UUID')
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function invoiceNoteDetails()
{
$invoiceId = "INVOICE_ID";
$noteUuid="NOTE_UUID";
try {
$response = $this->notesService->readInvoiceNotesDetails($invoiceId,$noteUuid);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains details of the invoice note, including its content, attached files, and metadata such as version, creator, and timestamps. This allows users to review all modifications and associated documents.
InvoiceNoteUuidDetailsDTO(
invoice=InvoiceNoteUuidDataDTO(
note=NoteDataDTO(
uuid='NOTE_UUID',
version='VERSION',
content='CONTENT',
files=[
FileDTO(
uuid='FILE_UUID',
name='FILE_NAME',
version='VERSION'
)
],
createdBy='USER',
createdOn='YYYY-MM-DDTHH:MM:SSZ',
lastUpdatedBy='USER',
lastUpdatedOn='YYYY-MM-DDTHH:MM:SSZ'
)
)
)
{
"invoice": {
"note": {
"uuid": "NOTE_UUID",
"version": "VERSION",
"content": "CONTENT",
"files": [
{
"uuid": "FILE_UUID",
"name": "FILE_NAME",
"version": "VERSION"
}
],
"created_by": "USER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "USER",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ"
}
}
}
Cancelling an Invoice
Function: cancel_invoice()
Purpose
This endpoint cancels a specific invoice, changing its status to INACTIVE. It is typically used when an invoice was issued incorrectly, contains errors, or needs to be voided for accounting or business reasons. Cancelling an invoice ensures that the invoice is no longer considered active for payment, reporting, or accounting purposes while preserving historical data for audit purposes.
Parameters
| parameter | type | description |
|---|---|---|
| invoice_id | string | Required. The unique identifier of the invoice to be cancelled. |
Use Case
Suppose a company issues an invoice to a customer but later discovers that the invoice contains incorrect amounts or was created in error. Using this endpoint, the system can programmatically cancel the invoice by passing its ID. This prevents further payments against the invoice and updates the invoice status in the system. Both Python and PHP SDKs provide convenient methods (invoice_cancel / invoiceCancel) to execute this action, returning the updated invoice object with status INACTIVE.
def cancel_invoice():
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
)
response = exsited_sdk.invoice.invoice_cancel(id="INVOICE_ID_PLACEHOLDER")
print(response)
Response
The response returns the updated invoice object with the status set to INACTIVE. It includes all invoice details such as invoice ID, total, due, tax, lines, currency, and KPI metrics, reflecting that the invoice is no longer active for payments. This response can be used to confirm that the cancellation has been applied successfully.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='INACTIVE',
id='INVOICE_ID_PLACEHOLDER',
type='LINKED_WITH_ORDER',
subtotal='SUBTOTAL_PLACEHOLDER',
total='TOTAL_PLACEHOLDER',
tax='TAX_PLACEHOLDER',
paid='PAID_AMOUNT_PLACEHOLDER',
due='DUE_AMOUNT_PLACEHOLDER',
paymentStatus='UNPAID',
issueDate='ISSUE_DATE_PLACEHOLDER',
dueDate='DUE_DATE_PLACEHOLDER',
accountName='ACCOUNT_NAME_PLACEHOLDER',
lines=[...],
currency=CurrencyDTO(uuid='CURRENCY_UUID_PLACEHOLDER', name='CURRENCY_NAME_PLACEHOLDER', link='CURRENCY_LINK_PLACEHOLDER')
)
)
Reactivating an Invoice
Function: reactivate_invoice()
Purpose
This SDK function retrieves a list of all accounts available to the user by calling the list() method from the ExsitedSDK. It initializes the SDK using a valid authentication token and sends a request to the backend to fetch account records associated with the authenticated user or organization.
Parameters
This function does not require any input parameters.
Use Case
The user can apply this function to view all registered accounts under their access scope. This is useful in administrative panels, reporting dashboards, or account management modules where listing all accounts is essential. Upon execution, the function retrieves metadata and identifiers for each account, allowing further actions such as view, update, or delete. If the user lacks access or if there is a backend failure, an exception is raised with full details for analysis.
def reactivate_invoice():
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.invoice.invoice_reactivate(id="INVOICE_ID_PLACEHOLDER")
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
When the invoice is successfully reactivated, the response returns the full invoice object with its status updated to ACTIVE. All invoice attributes remain intact, including subtotal, total, tax, lines, account references, payment details, currency, timestamps, and KPI metrics. This allows systems to confirm the restoration of the invoice and continue processing payments or further updates. Both Python and PHP responses provide the same structure, ensuring consistent handling across different environments.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INVOICE_ID_PLACEHOLDER',
type='INVOICE_TYPE_PLACEHOLDER',
issueDate='ISSUE_DATE_PLACEHOLDER',
dueDate='DUE_DATE_PLACEHOLDER',
subtotal='SUBTOTAL_PLACEHOLDER',
tax='TAX_PLACEHOLDER',
total='TOTAL_PLACEHOLDER',
paid='PAID_AMOUNT_PLACEHOLDER',
due='DUE_AMOUNT_PLACEHOLDER',
paymentStatus='UNPAID',
accountId='ACCOUNT_ID_PLACEHOLDER',
orderId='ORDER_ID_PLACEHOLDER',
createdBy='CREATED_BY_PLACEHOLDER',
createdOn='CREATED_ON_PLACEHOLDER',
lastUpdatedBy='LAST_UPDATED_BY_PLACEHOLDER',
lastUpdatedOn='LAST_UPDATED_ON_PLACEHOLDER',
uuid='INVOICE_UUID_PLACEHOLDER',
version='VERSION_PLACEHOLDER',
lines=[...],
currency=CurrencyDTO(uuid='CURRENCY_UUID_PLACEHOLDER', name='CURRENCY_NAME_PLACEHOLDER', link='CURRENCY_LINK_PLACEHOLDER'),
kpis=KpisDTO(outstanding='OUTSTANDING_AMOUNT_PLACEHOLDER', overdue='OVERDUE_AMOUNT_PLACEHOLDER'),
customForm=CustomFormsDTO(uuid='FORM_UUID_PLACEHOLDER', name='FORM_NAME_PLACEHOLDER')
)
)
Updating Invoice Information
Function: invoice_update_information()
Purpose
This endpoint is used to update specific informational fields on an existing invoice, such as the invoice note or other editable metadata. Businesses often need to correct or add additional information after an invoice has been issued, such as clarifying billing details, adding notes for the customer, or updating reference information. This endpoint allows partial updates without modifying financial figures, line items, or billing logic, ensuring the invoice remains accurate and properly documented throughout its lifecycle.
Parameters
| parameter | type | description |
|---|---|---|
| invoice_id | string | Required. The unique identifier of the invoice to update. |
Use Case
After an invoice is issued, additional remarks or corrected information may need to be added to ensure clarity for customers, auditors, or internal teams. Instead of cancelling or recreating the invoice, the business can simply update the informational fields. For example, the finance team may want to add a note explaining additional billing context, payment expectations, or internal handling instructions. Using the SDK makes it easy to send only the fields that need to be changed while preserving all existing invoice data. The Python and PHP SDK functions allow systems to perform this update seamlessly by submitting a minimal request containing only the updated fields.
def invoice_update_information():
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:
request_data = UpdateInvoiceInfoRequestDTO(
invoice=UpdateInvoiceInfoDataDTO(
invoiceNote='INVOICE_NOTE_PLACEHOLDER'
)
)
response = exsited_sdk.invoice.update_information(
id='INVOICE_ID_PLACEHOLDER',
request_data=request_data
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The successful response returns the updated invoice object with all invoice details, including the newly updated information field such as invoiceNote. All core invoice attributes remain unchanged, including financial totals, tax values, payment status, currency, dates, and metadata. This ensures that only the intended informational fields are modified, maintaining the integrity of the financial record. Both Python and PHP SDK responses reflect the entire invoice object so that consuming systems can refresh their local data and confirm the update.
InvoiceDetailsDTO(
invoice=InvoiceDataDTO(
status='ACTIVE',
id='INVOICE_ID_PLACEHOLDER',
type='INVOICE_TYPE_PLACEHOLDER',
billingStartDate='BILLING_START_DATE_PLACEHOLDER',
billingEndDate='BILLING_END_DATE_PLACEHOLDER',
issueDate='ISSUE_DATE_PLACEHOLDER',
dueDate='DUE_DATE_PLACEHOLDER',
subtotal='SUBTOTAL_PLACEHOLDER',
tax='TAX_PLACEHOLDER',
total='TOTAL_PLACEHOLDER',
paid='PAID_AMOUNT_PLACEHOLDER',
due='DUE_AMOUNT_PLACEHOLDER',
paymentStatus='UNPAID',
invoiceNote='INVOICE_NOTE_PLACEHOLDER',
accountId='ACCOUNT_ID_PLACEHOLDER',
orderId='ORDER_ID_PLACEHOLDER',
createdBy='CREATED_BY_PLACEHOLDER',
createdOn='CREATED_ON_PLACEHOLDER',
lastUpdatedBy='LAST_UPDATED_BY_PLACEHOLDER',
lastUpdatedOn='LAST_UPDATED_ON_PLACEHOLDER',
uuid='INVOICE_UUID_PLACEHOLDER',
version='VERSION_PLACEHOLDER',
lines=None,
currency=CurrencyDTO(
uuid='CURRENCY_UUID_PLACEHOLDER',
name='CURRENCY_NAME_PLACEHOLDER',
link='CURRENCY_LINK_PLACEHOLDER'
),
kpis=KpisDTO(
outstanding='OUTSTANDING_AMOUNT_PLACEHOLDER',
overdue='OVERDUE_AMOUNT_PLACEHOLDER'
),
customForm=CustomFormsDTO(
uuid='FORM_UUID_PLACEHOLDER',
name='FORM_NAME_PLACEHOLDER'
)
)
)
Getting Invoice Note File Details
Function: invoice_note_files_details()
Purpose
This function retrieves detailed information about files attached to a specific note within an invoice. Invoice notes often contain supporting documents such as PDFs, images, or reference attachments that provide context or evidence for the comment or note added. This function allows systems to fetch the metadata of those attached files, enabling users to preview, download, or audit the associated documents. It is particularly useful for workflows involving approvals, audits, dispute resolution, or general document management connected to an invoice note.
Parameters
| parameter | type | description |
|---|---|---|
| invoice_id | string | Required. The unique identifier of the invoice. |
| note_uuid | string | Required. The unique identifier of the note whose file details are being retrieved. |
Use Case
This function is used when invoices contain notes that reference supporting documents, users often need to retrieve information about these files for review or further processing. For example, a finance officer may attach a PDF showing a customer communication, or an auditor may attach scanned evidence. This function enables systems to fetch metadata about the files attached to a particular invoice note, such as name, type, size, and access links. Using the SDK, developers can easily access these file details by passing the invoice ID and note UUID.
def invoice_note_files_details():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "PATH_TO_TOKEN_FILE.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.notes.invoice_note_uuid_files_details(
id="INVOICE_ID_PLACEHOLDER",
uuid="NOTE_UUID_PLACEHOLDER"
)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The function returns detailed metadata about the files attached to the specified invoice note. This typically includes information such as file UUIDs, file names, sizes, created timestamps, and downloadable URLs. These details allow consuming systems to display file lists, provide download options, or conduct verification checks. The actual fields depend on the platform’s file storage implementation, but the response structure generally includes an array of file objects.
{
"files": [
{
"uuid": "FILE_UUID_PLACEHOLDER",
"name": "FILE_NAME_PLACEHOLDER",
"size": "FILE_SIZE_PLACEHOLDER",
"mimeType": "MIME_TYPE_PLACEHOLDER",
"createdOn": "CREATED_ON_PLACEHOLDER",
"link": "FILE_DOWNLOAD_LINK_PLACEHOLDER"
}
]
}
Getting Invoice Note File Details by File UUID
Function: invoice_note_files_details_by_file_uuid()
Purpose
This SDK function retrieves the detailed metadata of a specific file attached to a particular invoice note. The endpoint requires the invoice ID, the note UUID, and the file UUID. It is used to fetch a single file record, including its identifiers, metadata, and associated links. This operation is typically used in financial platforms where invoice notes may contain multiple files (attachments), and the client needs to retrieve one specific file for preview, verification, download, or audit purposes.
Parameters
| Parameter | Type | Description |
|---|---|---|
| invoice_id | string | The unique ID of the invoice. |
| note_uuid | string | The unique UUID of the note associated with the invoice. |
| file_uuid | string | The unique UUID of the file inside the note's file list. |
Use Case
This function is typically used when a system integrates invoice management and needs to fetch the full details of a specific file attached to an invoice note for operations such as displaying file metadata, enabling file preview workflows, or validating document attachments for audit or compliance checks. For example, after a list of files is retrieved for an invoice note, the application might allow the user to select one specific file to view its properties. The SDK function provides a direct and simplified method to fetch this one file using the invoice ID, the note UUID, and the file UUID. Both Python and PHP SDKs follow a similar pattern to make this request seamless, requiring only the three identifiers, while abstracting token handling and HTTP communication.
def invoice_note_files_details_by_file_uuid():
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.invoice_note_uuid_files_uuid_details(id="ID", uuid='UUID', file_uuid='UUID')
print(response)
# ResponseToObj().process(response=response["accounts"][0])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
Response
The function returns a detailed file object containing identifiers, file names, metadata, links, timestamps, and other relevant attributes. The response structure allows the client to understand what file is attached, when it was uploaded, and how it can be accessed or processed further. The SDK simply forwards this structured data in array/object form so it can be used directly in your application for UI display, file download, or workflow automation.
{
"file": {
"uuid": "FILE_UUID_PLACEHOLDER",
"name": "FILE_NAME_PLACEHOLDER",
"mime_type": "MIME_TYPE_PLACEHOLDER",
"size": "FILE_SIZE_PLACEHOLDER",
"created_at": "CREATED_AT_PLACEHOLDER",
"updated_at": "UPDATED_AT_PLACEHOLDER",
"link": "FILE_LINK_PLACEHOLDER"
}
}