» Credit Note Module SDK Documentation
» Credit Note Module SDK Documentation

Retrieving Credit Note by ID

Functioncredit_note_details()

Purpose

This function retrieves the detailed information of a specific credit note using its unique credit note ID.

Parameters

ParameterTypeDescription
credit-note_idStringUnique identifier of the credit note .

Use Case

The function is used to fetch comprehensive details of a particular credit note, including status, amount, related invoice, payment information, remaining balance, and metadata. Credit note in the system are generated when excess payment is made through any payment processor for an order, and the extra payment is recorded as a credit note for future adjustments or refunds. It is helpful when businesses need to review or validate the full record of a credit note for reconciliation or auditing purposes.

def credit_note_details():
    SDKConfig.PRINT_REQUEST_DATA = False
    SDKConfig.PRINT_RAW_RESPONSE = False

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = exsited_sdk.credit_note.details(id='CREDIT-NOTE_DETAILS')
        print(response)
        return response

    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The SDK function returns the complete details of the specified credit note, including general information such as status, credit note ID, date, amount, associated invoice and payment IDs, remaining balance, refund eligibility, custom attributes, and audit metadata. 

CreditNoteDetailsDTO(
    creditNote=CreditNoteDTO(
        status='STATUS',
        id='CREDIT_NOTE_ID',
        date='TIMESTAMP',
        amount='NUMBER',
        invoiceId='INVOICE_ID',
        remainingBalance='NUMBER',
        refundable='BOOLEAN',
        paymentId='PAYMENT_ID',
        customAttributes=[
            CustomAttributesDetailsDTO(
                name='ATTRIBUTE_NAME',
                value='EMPTY'
            )
        ],
        customObjects=[],
        version='VERSION',
        createdBy='CREATED_BY',
        createdOn='TIMESTAMP',
        updatedBy='EMPTY',
        updatedOn='EMPTY',
        uuid='UUID',
        accountId='ACCOUNT_ID'
    )
)

Retrieving Credit Note Applications 

Functioncredit_note_application_list()

Purpose

This function retrieves a list of credit note application records with details on usage, remaining balance, and related transactions.

Parameters

This function does not have any parameters.

Use Case

The function is used to to monitor the usage of credit notes in transactions. For example, when a customer makes a new order and chooses to pay using an existing credit note, the application of that credit note is recorded here. This helps finance teams understand how credit balances are reduced and track any remaining amounts available.

def credit_note_application_list():
    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.credit_note.credit_note_application_list()
        print(response)
        return response

    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The SDK function returns a list of credit note application details and pagination information. Each record includes the date, amount applied, credit note ID, associated payment or refund ID, remaining balance, creator details, and version information.

CreditNoteApplicationListDTO(
    creditNoteApplications=[
        CreditNoteApplicationDTO(
            date='TIMESTAMP',
            amount='NUMBER',
            creditNoteId='CREDIT_NOTE_ID',
            paymentId='PAYMENT_ID',
            refundId='EMPTY',
            remainingBalance='NUMBER',
            createdBy='CREATED_BY',
            createdOn='TIMESTAMP',
            uuid='UUID',
            version='VERSION'
        ),
        CreditNoteApplicationDTO(
            date='TIMESTAMP',
            amount='NUMBER',
            creditNoteId='CREDIT_NOTE_ID',
            paymentId='PAYMENT_ID',
            refundId='EMPTY',
            remainingBalance='NUMBER',
            createdBy='CREATED_BY',
            createdOn='TIMESTAMP',
            uuid='UUID',
            version='VERSION'
        )
    ],
    pagination=PaginationDTO(
        records='NUMBER',
        limit='NUMBER',
        offset='NUMBER',
        previousPage='EMPTY',
        nextPage='EMPTY'
    )
)

Retrieving  Credit Note Application by UUID 

Functioncredit_note_application_details()

Purpose

This function retrieves detailed information about a specific credit note application using its unique UUID. It provides key details such as application date, amount, associated credit note ID, payment ID, refund information, remaining balance, creator details, and version.

Parameters

ParameterTypeDescription
credit-note-applications_uuidStringUnique identifier of the credit note application to retrieve details for.

Use Case

The function is used to fetch and review the full details of a specific credit note application for auditing, reconciliation, or customer account verification purposes. It helps businesses verify payment adjustments and ensure accurate credit allocations.

def credit_note_application_details():
    SDKConfig.PRINT_REQUEST_DATA = False
    SDKConfig.PRINT_RAW_RESPONSE = False

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = exsited_sdk.credit_note.credit_note_application_details(uuid='')
        print(response)
        return response

    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The SDK  function returns the complete details of the requested credit note application, including the transaction date, credited amount, related credit note and payment IDs, remaining balance, and metadata about its creation and version history.

CreditNoteApplicationDetailDTO(
    creditNoteApplication=CreditNoteApplicationDTO(
        date='TIMESTAMP',
        amount='NUMBER',
        creditNoteId='CREDIT_NOTE_ID',
        paymentId='PAYMENT_ID',
        refundId='EMPTY',
        remainingBalance='NUMBER',
        createdBy='CREATED_BY',
        createdOn='TIMESTAMP',
        uuid='UUID',
        version='VERSION'
    )
)

Retrieving a Invoice Credit Note Application List

Functioninvoice_credit_note_application_list()

Purpose

This function retrieves a list of credit note applications that have been applied to a specific invoice. It provides details about the applied amounts, linked payments, remaining balance, and audit information, along with pagination support for handling multiple records.

Parameters

ParamterTypeDescription
invoice_idStringUnique identifier of the invoice for which credit note applications are being retrieved.

Use Case

The function is used to check how credit notes have been applied against a given invoice. It is particularly useful for finance teams or billing systems to reconcile invoice balances, verify applied credit note amounts, and track payment associations to maintain accurate financial records.

def invoice_credit_note_application_list():
    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.credit_note.invoice_credit_note_application_list(id='INVOICE_ID')
        print(response)
        return response

    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The SDK function response returns the invoice object containing a list of credit note applications and pagination details. Each credit note application includes the date of application, amount applied, credit note identifier, payment identifier, refund reference if any, remaining balance on the invoice, and metadata such as created_by, created_on, uuid, and version. Pagination provides record count, page size, offset, and navigation links to manage large sets of applications efficiently.

InvoiceCreditNoteApplicationListDTO(
    invoice=CreditNoteApplicationListDTO(
        creditNoteApplications=[
            CreditNoteApplicationDTO(
                date='TIMESTAMP',
                amount='NUMBER',
                creditNoteId='CREDIT_NOTE_ID',
                paymentId='PAYMENT_ID',
                refundId='EMPTY',
                remainingBalance='NUMBER',
                createdBy='CREATED_BY',
                createdOn='TIMESTAMP',
                uuid='UUID',
                version='VERSION'
            ),
            CreditNoteApplicationDTO(
                date='TIMESTAMP',
                amount='NUMBER',
                creditNoteId='CREDIT_NOTE_ID',
                paymentId='PAYMENT_ID',
                refundId='EMPTY',
                remainingBalance='NUMBER',
                createdBy='CREATED_BY',
                createdOn='TIMESTAMP',
                uuid='UUID',
                version='VERSION'
            ),
            CreditNoteApplicationDTO(
                date='TIMESTAMP',
                amount='NUMBER',
                creditNoteId='CREDIT_NOTE_ID',
                paymentId='PAYMENT_ID',
                refundId='EMPTY',
                remainingBalance='NUMBER',
                createdBy='CREATED_BY',
                createdOn='TIMESTAMP',
                uuid='UUID',
                version='VERSION'
            )
        ],
        pagination=PaginationDTO(
            records=NUMBER,
            limit=NUMBER,
            offset=NUMBER,
            previousPage='EMPTY',
            nextPage='NULL'
        )
    )
)