» Invoice Module SDK Documentation
» Invoice Module SDK Documentation

Overview

The Invoice Module in the Exsited SDK provides essential functions for creating, retrieving, and managing invoices associated with an account. It simplifies financial operations by offering seamless integration for generating invoices, viewing invoice lists, and handling errors effectively. This module is ideal for tasks such as transaction tracking, financial auditing, and support.

Common Import Requirements

The following imports are required when working with any account-related functions in both Python and PHP.

from exsited.exsited.exsited_sdk import ExsitedSDK
from exsited.common.ab_exception import ABException
from exsited.common.sdk_conf import SDKConfig
from config import CommonData
from exsited.exsited.invoice.dto.invoice_dto import InvoiceCreateDTO, InvoiceDataDTO     

Creating Invoice of an Order

Function: createOrderInvoice()

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

ParameterType Description
ORDER_ID String A unique identifier for the order that the invoice is being created for.
INVOICE_NOTEStringInvoice note for the invoice.

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)       

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
      )
    ]
  )
)

Getting All Invoice List

Function: getInvoiceList()

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)       

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'
  )
)

Getting Specific Invoice Details

Function: getInvoiceDetails()

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

ParameterTypeDescription
INVOICE_IDStringThe 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)      

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'
        )
    )
)

Getting Invoice Details of an Order

Function: getInvoiceDetailsAgainstOrder()

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

ParameterType 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)      

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'
        }
    )
)

Getting Invoices List of an Order

Function: getOrderInvoiceList()

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

ParameterType Description
ORDER_IDString 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)      

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'
            }
        )
    )
]

Getting Information of a Specific Invoice

Function: getInvoiceInformation()

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

ParameterType Description
INVOICE_IDString 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)       

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=[]
    )
)

Deleting an Invoice

Function: deleteInvoice()

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

ParameterType Description
INVOICE_IDString 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)        

Response

Returns a confirmation message indicating successful deletion or an error message with additional details.

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

Getting Invoices List of an Account

Function: getInvoicesByAccount()

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

ParameterType Description
ACCOUNT_IDString 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)        

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"
        )
    )
)

Getting Notes List of a Specific Invoice

Function: getInvoieNotesList()

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

ParameterTypeDescription
INVOICE_IDStringThe 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_notes_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)

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'
        )
    )
)

Creating Notes of an Invoice

Function: createInvoiceNotes()

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

ParameterTypeDescription
FILE_URLStringPath of the file to be attached to the note.
NOTEStringThe content of the note.
INVOICE_IDStringUnique 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)

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'
        )
    )
)

Getting Specific Note Details of an Invoice

Function: getInvoiceNotesDetails()

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

ParameterTypeDescription
INVOICE_IDStringThe unique identifier of the invoice.
NOTE_UUIDStringUnique 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 get_invoice_notes_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)

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'
        )
    )
)

Configuration

Before using any of these functions, ensure that your API credentials are properly configured.

  • Python: The request token is retrieved from CommonData.get_request_token_dto().
  • PHP: Configuration is managed via ConfigManager and $this->invoiceService.

Language-Specific Features

Feature
Python Implementation
PHP Implementation
SDK Initialization
ExsitedSDK().init_sdk()
$this->invoiceService
Exception Handling
ABException handles errors and raw response
try-catch block for exceptions
Response Format
Prints response using print()
Outputs response using json_encode()
Configuration
Managed through SDKConfig
Managed via ConfigManager
Authentication Method
OAuth token via CommonData.get_request_token_dto()
API credentials via $this->invoiceService
Error Logging
Captures errors with ABException and prints raw response
Captures exceptions and prints error message
Data Parsing
JSON response parsed natively in Python
JSON encoded and displayed using PHP
Error Output
print(ab.get_errors()) and ab.raw_response
echo 'Error: ' . $e->getMessage()