Bank Payment API

Zumzum Financials Knowledge Base

    Overview:

    The Zumzum Financials Bank Payment API service provides the following capabilities

    • Post a Bank Payment to the general ledger

    Bank Payment Description

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

    • Bank Payments are automatically posted to the Zumzum Financials general ledger.
    • When using the BankPaymentService Apex class, you will be creating the Batch Bank Payment Record, with Bank Payment and Bank Payment Lines and the Ledger records.
    • All Bank Payment Line Item values will need to be provided as a positive number as negative amounts are not supported.  If you wish to reverse a transaction to a bank account, then you will need to post the opposite transaction, e.g. a Bank Receipt (both should be included in your Bank Reconciliation process)
    • You are unable to un post or delete a Bank Payment and it’s associated records once you have posted to the ledger.

    The BankPaymentService function will accept the list of ‘BankPaymentWrapper’ as an input parameter.  Below are the required fields when a Bank Payment is created.

    BankPaymentWrapper API Fields

    Object Name Field Name API Name Data Type Required
    BankPaymentWrapper Reference Reference String No
    BankPaymentWrapper Bank BankAccountId Lookup (Zumzum__Bank_Account__c) Yes
    BankPaymentWrapper Date PostingDate Date Yes
    BankPaymentWrapper Tax Rate TaxRate Lookup (Zumzum_Tax_Rate__c) Yes
    BankPaymentWrapper Nominal Account NominalAccount Lookup (Zumzum_Nominal_Account__c) Yes
    BankPaymentWrapper Amount Amount Decimal (2 decimal places) Yes
    BankPaymentWrapper Details Details String (255) No

    Create a Bank Payment – CreateBankPayment Method

    Below is information related on how to post a Bank Payment with the Bank Payment API service using Apex code.  Zumzum Financials includes a global class called BankPaymentService which you may call from your own Apex code. The CreateBankPayment 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
    BankPaymentService CreateBankPayment List “BankPaymentWrapper” List of type object, e.g. “Bank_Payment__c”

    Sample Code: Post Bank Payment

    This example is provided to help you begin creating your own custom code.  The code will post a single Batch Bank Payment record, with a single Bank Payment, containing a single Bank Payment Line 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<BankPaymentWrapper>” to supply as an input for the CreateBankPayment function.
    2. Post the Bank Payment
    3. Return a list of the Bank Payment created with “Bank_Payment__c”

    Sample Code :

    /* Create and Post Bank Payment */
    
    BankPaymentService.BankPaymentWrapper  objBankPaymentWrapper = new BankPaymentService.BankPaymentWrapper ();
    
    List<BankPaymentService.BankPaymentWrapper > listOfWrapper = new List<BankPaymentService.BankPaymentWrapper >();
    
    /* Define the data fields for the Bank Payment */
    objBankPaymentWrapper.PostingDate =Date.Today();
    
    objBankPaymentWrapper.NominalAccount ='a0i3H00000000LYQAY'; //Miscellaneous Expenses
    
    objBankPaymentWrapper.TaxRate ='a173H0000008OciQAE'; //Standard Rate 20% VAT
    
    objBankPaymentWrapper.BankAccountId  = 'a0K3H000000ExmXUAS'; //Bank Deposit Account
    
    objBankPaymentWrapper.Amount = 100;
    
    objBankPaymentWrapper.Details = 'Example Bank Payment';
    
    listOfWrapper.add(objBankPaymentWrapper);
    
    BankPaymentService objBankService = new BankPaymentService();
    
    /* Execute the command to Post a Bank Payment */
    
    BankPaymentService.BankPaymentResponse objResponse = objBankService.CreateBankPayment(listOfWrapper);
    
    system.debug('objResponse>> ' + objResponse);

    Below are a list of error codes that are returned by the Bank Payment Service.

    Supported Error Codes – Bank Payment Service (API)

    Error Message Reason Resolution
    “BankPaymentResponse:[ResponseMessage=Success, bankPayments=null]” The list of Bank Payments does not contain a Bank Payment Line Submit the BankPaymentWrapper with all the necessary fields, for a payment line to be created
    “BankPaymentResponse:[ResponseMessage= <1> Enter an amount first , bankPayments=null] The Bank Payment line value is zero Submit the BankPaymentWrapper with the “Amount” value greater than 0.00
    “BankPaymentResponse:[ResponseMessage= <1> Select Tax Rate first , bankPayments=null]” Tax Rate is missing from the Bank Payment Line Submit the BankPaymentWrapper with the “TaxRate” value as an ID to the Zumzum_Tax_Rate__c record to be used as your tax rate for this line item.
    “BankPaymentResponse:[ResponseMessage= <1> Select Nominal Account first , bankPayments=null]” Nominal Account is missing from the Bank Payment Line Submit the BankPaymentWrapper with the “NominalAccount” value as an ID to the Zumzum_Nominal_Account__c record to be used for this line item.
    “BankPaymentResponse: [ResponseMessage= <1> Select Bank Account first , bankPayments=null]
    Bank Account is missing from the Bank Payment Line Submit the BankPaymentWrapper with the “NominalAccount” value as an ID to the Zumzum_Bank_Account__c record to be used for this line item.
    “BankPaymentResponse: [ResponseMessage= <1> Enter Date first , bankPayments=null]” Date is missing from the Bank Payment Line Submit the BankPaymentWrapper with the “PostingDate” value to be used for this line item.

    Learn more about leveraging the Zumzum Financials API to create your own integration.

    in Bank Payment API Tags: bankBank PaymentsPayment

    Related Articles