Bank Supplier Refund API

Zumzum Financials Knowledge Base

    Overview

    The Zumzum Financials Supplier Refund API service provides the following capabilities

    • Post a Supplier Refund to the general ledger

    Bank Supplier Refund Description

    The Supplier Refund objects are an ideal integration point to create transactions in Zumzum Financials from Salesforce.  You should be aware of the following:

    • Supplier Refunds are automatically posted to the Zumzum Financials general ledger as Bank Receipts.
    • When using the BankSupplierRefundService Apex class, you will be creating a Bank Receipt Record, with Bank Receipt, Bank Receipt Lines and the Ledger records.
    • You are unable to un post or delete a Supplier Refund / Bank Receipt and it’s associated records once you have posted to the ledger.

    The BankSupplierRefundService method will accept the list of ‘BankSupplierRefundWrapper’ as an input parameter.  Below are the required fields when a Bank Supplier Refund is created.

    Object Name Field Name API Name Data Type Required
    objRefundWrapper.AccountID Account AccountId Lookup
    (Account)
    Yes
    objRefundWrapper.PostingDate Date PostingDate Date Yes
    objRefundWrapper.BankAccountID Bank BankAccountId Lookup (Zumzum__Bank_Account__c) Yes
    objRefundWrapper.BankAccountID.TaxRate Tax Rate TaxRate Lookup (Zumzum_Tax_Rate__c) Yes
    objRefundWrapper.Amount Amount Amount Decimal (2 decimal places) Yes

    Create a Bank Supplier Refund – CreateBankSupplierRefund Method

    Below is information related to how to post a Bank Supplier Refund with the Bank Supplier Refund API service using Apex code. Zumzum Financials includes a global class called BankSupplierRefundService which you may call from your own Apex code. The CreateBankSupplierRefund method is used to insert Batch Bank Receipt records, with Bank Receipts, Bank Receipt Lines, and ledger records. The service returns a list of Bank Receipt records created.

    Global Class Name Method Input Output
    BankSupplierRefundService CreateBankSupplierRefund List “BankSupplierRefundWrapper” List “Bank_Receipt__c”

    Sample Code: Create Bank Supplier Refund

    This example is provided to help you begin creating your own custom code.  The code will post a single Supplier Refund record, with a single Bank Receipts, containing a single Bank Receipt Line Item and three ledger records (if using a Tax code that generates a ledger entry). The following steps will be performed:

    1. Prepare the list collection “List<RefundWrapper>” to supply as an input for the CreateBankSupplierRefund function.
    2. Post the Bank Supplier Refund
    3. Return a list of the Bank Supplier Refund created with “Bank_Receipt”

    Sample Code :

    /**************Create Supplier Refund*****************************/
    
    // Create a new instance of the Bank Supplier Refund Service. 
    zumzumBankSupplierRefundService objSupplierRefundService = new zumzum.BankSupplierRefundService();
    
    // Declare the Bank Supplier Refund Wrapper
    
    zumzum.BankSupplierRefundService.BankSupplierRefundWrapper objRefundWrapper = new 
    
    zumzum.BankSupplierRefundService.BankSupplierRefundWrapper();
    
    // Add variables to the Bank Supplier Refund Wrapper
    
    objRefundWrapper.AccountID = '0012600000yKYhj';
    
    objRefundWrapper.PostingDate = Date.Today();
    
    objRefundWrapper.BankAccountId = 'a032600000IQwSj';
    
    objRefundWrapper.TaxRate = 'a1H260000019Qva';
    
    objRefundWrapper.Amount = 5;
    
    // Execute the command to create the Bank Supplier Refund
    
    zumzum.BankSupplierRefundService.Response objResponse = objSupplierRefundService.CreateBankSupplierRefund(objRefundWrapper);
    
    system.debug('Response>>' + objResponse.ResponseMessage);
    
    // Receive a list of the Bank Receipts created for the Supplier Refund
    
    system.debug('BankReceipts >>' + objResponse.BankReceipts );
    
    /**********************************************************/
    Field Description Default Value
    Please provide the value for Date to be able to create a Bank Supplier Refund. No date is provided. Add a Date into the running script and/or check the format of the current value.
    Please provide a valid Bank Account ID to create a Bank Supplier Refund The Bank account provided has setup issues or no Account provided. Check that the Bank is active and the ID referenced in the code is correct.
    Please provide the ID for an Account to be able to create a Bank Supplier Refund The Supplier Account provided has setup issues or no Account provided. Check a supplier account ID referenced in the code is correct.
    Please provide the ID for a Tax Rate to be able to create a Bank Supplier Refund No Tax provided or the Tax record provided has setup issues. Check that the Tax is active and the ID referenced in the code is correct.
    Please provide the value for Amount to be able to create a Bank Supplier Refund Amount has not been entered. Check an amount has been entered and amount is in numeric format.
    in Bank Supplier Refund APIIntegration