Bank Customer Refund API

Zumzum Financials Knowledge Base

    Overview

    The Zumzum Financials Bank Customer Refund API service provides the following capabilities

    • Post a Customer Refund to the general ledger

    Bank Customer Refund Description

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

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

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

    BankCustomerRefundWrapper API Fields

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

    Create a Bank Customer Refund – CreateBankCustomerRefund Method

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

    Global Class Name Method Input Output
    BankCustomerRefundService CreateBankCustomerRefund List “BankCustomerRefundWrapper” List “Bank_Payment__c”

    Sample Code: Create Bank Customer Refund

    This example is provided to help you begin creating your own custom code.  The code will post a single Batch Bank Customer Refund record, with a single Bank Customer Refund, containing a single Bank Customer Refund 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 CreateBankCustomerRefund function.
    2. Post the Bank Customer Refund
    3. Return a list of the Bank Customer Refund created with “Bank_Payment__c”

    Sample Code :

    /**************Create Customer Refund*****************************/
    
    // Create a new instance of the Bank Customer Refund Service. 
    zumzum.BankCustomerRefundService objCustomerRefundService = new zumzum.BankCustomerRefundService();
    
    // Declare the Bank Customer Refund Wrapper
    
    zumzum.BankCustomerRefundService.BankCustomerRefundWrapper objRefundWrapper = new 
    
    zumzum.BankCustomerRefundService.BankCustomerRefundWrapper();
    
    // Add variables to the Bank Customer Refund Wrapper
    
    objRefundWrapper.AccountID = '0013H000002bIDHQA2';
    
    objRefundWrapper.PostingDate = Date.Today();
    
    objRefundWrapper.BankAccountId = 'a0K3H000000ExmXUAS';
    
    objRefundWrapper.TaxRate = 'a173H0000008OciQAE';
    
    objRefundWrapper.Amount = 5;
    
    // Execute the command to create the Bank Customer Refund
    
    zumzum.BankCustomerRefundService.Response objResponse = objCustomerRefundService.CreateBankCustomerRefund(objRefundWrapper);
    
    system.debug('Response>>' + objResponse.ResponseMessage);
    
    // Receive a list of the Bank Payments created for the Customer Refund
    
    system.debug('BankPayments>>' + objResponse.BankPayments);
    
    /**********************************************************/

    Supported Error Codes – Bank Customer Refund Service (API)

    Error Message Reason Resolution
    The account needs to be updated correctly for <' + customerFieldAPIName + '> and value of <'+ customerFieldAPIValue + '> The Account Type is not set to Customer Check settings on the Account referenced and ensure that it is set Type Customer.

    Ensure the ID used is correct and references the correct account.

    Please provide the value for Date to be able to create a Bank Customer 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 Customer Refund The Bank provided has setup issues or no Bank 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 Customer Refund The Account provided has setup issues or no Account provided Check the Account seettings and ensure the Type field and other values are set correctly.

    Make sure the ID, used to reference the Account in the code, is correct.

    Please provide the ID for a Tax Rate to be able to create a Bank Customer 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.
    Enter Date first Date is missing from the Bank Payment Line Submit the BankPaymentWrapper with the “PostingDate” value to be used for this line item.
    in Bank Customer Refund API Tags: bankIntegration

    Related Articles