Bank Transfer API

Zumzum Financials Knowledge Base

    Overview

    The Zumzum Financials Bank Transfer API provides the following capabilities:

    • Insert a Draft Bank Transfer
    • Post a Draft Bank Transfer
    • Create and Post a Bank Transfer

    Bank Transfer Description

    The Bank Transfer API will allow you to move funds from one Bank Account record in Zumzum Financials  to another. The Bank Transfer API uses the global class called BankTransferService which you may call from your own Apex code. When using this feature you should be aware of the below:

    • You are able to create Bank Transfer records with a status of draft.
    • Draft records may only be created and posted from the Bank Transfer service and not in the Zumzum Financials web interface.
      • NOTE: Please do not add the  “Edit” button on the Bank Transfer layout or Salesforce lightning record page.
    • You can deploy your own list view to track the list of draft Bank Transfer records on the Bank Transfer tab in Zumzum Financials.
    • Any Posted Bank Transfer records can not be edited.

    The below table contains Bank Transfer Wrapper API fields

    BankTransferWrapper API Fields

    Object Name Field Name API Name Data Type Required
    BankTransferWrapper Bank Account From BankAccountFrom Lookup (Zumzum__Bank_Account__c) Yes
    BankTransferWrapper Bank Account To BankAccountTo Lookup (Zumzum__Bank_Account__c) Yes
    BankTransferWrapper Date TransactionDate Date Yes
    BankTransferWrapper Amount Amount Decimal (2 decimal places) Yes
    BankTransferWrapper Reference Reference String (255) No
    BankTransferWrapper Description Description String (255) No

    Insert Bank Transfer – InsertBankTransfer Method

    Below is information related to inserting a draft Bank Transfer record within Zumzum Financials using Apex code. The InsertBankTransfer method is used to insert a Bank Transfer record in a Draft status.

    • Draft records may only be created and posted from the Bank Transfer service and not in the Zumzum Financials web interface.
      • NOTE: Please do not add the  “Edit” button on the Bank Transfer layout or Salesforce lightning record page.
    Global Class Name Method Input Output
    BankTransferService InsertBankTransfer BankTransferList BankTransferResponse List of “Bank_Transfer__c”

    Sample Code: Insert Bank Transfer

    /*===============================================START INSERT BANK TRANSFER SAMPLE SCRIPT ========================================*/
    
    //Initiate a new instance of the Bank Transfer Object
    
    BankTransferService bankTransferService = new BankTransferService();
    
    // Create a new list to store the Bank Transfer Wrappers
    
    List<BankTransferService.BankTransferWrapper> BankTransferList = new List<BankTransferService.BankTransferWrapper>();
    
    //Create an object to store the response from the Bank Transfer API
    
    BankTransferService.BankTransferResponse BankTransferResponse = new BankTransferService.BankTransferResponse();
    
    //Create the data for the first Bank Transfer wrapper to be created
    
    BankTransferService.BankTransferWrapper BankTransferWrapper1 = new BankTransferService.BankTransferWrapper();
    
    // Provide the Bank Transfer Wrapper 1 Variables
    
    // Provide the Bank Account ID which will be used to transfer from
    
    BankTransferWrapper1.BankAccountFrom = '<Set Bank Account Id>';
    
    // Provide the Bank Account ID which will be used to transfer to
    
    BankTransferWrapper1.BankAccountTo = '<Set Bank Account Id>';
    
    // Provide the Transaction Date
    
    BankTransferWrapper1.TransactionDate = Date.Today();
    
    // Provide the Foreign Amount to Transfer to the target bank account
    
    BankTransferWrapper1.ForeignAmount = 100;
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    
    BankTransferWrapper1.Reference = 'Sample Reference 1';
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    
    BankTransferWrapper1.Description = 'Sample description 1';
    
    //add Bank Transfer Wrapper 1 to the list of Bank Transfer Wrappers
    
    BankTransferList.add(BankTransferWrapper1);
    
    // Provide the Bank Transfer Wrapper 2 Variables
    
    BankTransferService.BankTransferWrapper BankTransferWrapper2 = new BankTransferService.BankTransferWrapper();
    
    // Provide the Bank Account ID which will be used as the source to transfer the funds from
    
    BankTransferWrapper2.BankAccountFrom = '<Set Bank Account Id>';
    
    // Provide the Bank Account ID which will be used as the target to transfer the funds to
    
    BankTransferWrapper2.BankAccountTo = '<Set Bank Account Id>';
    
    // Provide the Transaction Date
    
    BankTransferWrapper2.TransactionDate = Date.today();
    
    // Provide the Foreign Amount to Transfer to the target bank account
    
    BankTransferWrapper2.ForeignAmount = 101;
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    
    BankTransferWrapper2.Reference = 'Sample Reference 2';
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    
    BankTransferWrapper2.Description = 'Sample description 2';
    
    //Add the Bank Transfer Wrapper 2 the list Of Bank Transfers to process.
    
    BankTransferList.add(BankTransferWrapper2);
    
    //Call The Bank Transfer CreateBankTransfer method to process the list of bank transfers
    
    BankTransferResponse = bankTransferService.InsertBankTransfer(BankTransferList);
    
    // Receive the response from the Bank Transfer API class.
    
    system.debug(BankTransferResponse);
    
    /*===============================================END INSERT BANK TRANSFER SAMPLE SCRIPT ========================================*/

    Post Bank Transfer – PostBankTransfer Method

    Below is information related to the posting of a Draft Bank Transfer record within Zumzum Financials using Apex code. The PostBankTransfer method is used to change the status of the Bank Transfer to Posted and inset the related Ledger records.

    Global Class Name Method Input Output
    BankTransferService PostBankTransfer bankTransferIds (set) List of “Bank_Transfer__c”

    Sample Code: Post Bank Transfer

    /*===============================================Start POST Bank Transfer Script========================================*/
    
    //Initiate a new instance of the Bank Transfer Object
    BankTransferService bankTransferService = new BankTransferService();
    
    // Create a Set variable to store the Bank Transfer Record IDs
    Set<Id> bankTransferListToPostIds = new Set<Id>();
    
    // Create a List to store the responses from the Bank Transfer API
    BankTransferService.BankTransferResponse response = new BankTransferService.BankTransferResponse();
    
    // Query the system for Draft Bank Transfer records to return the IDs
    for(BankTransfer__c bankTransfer : [SELECT Id 
    FROM BankTransfer__c 
    WHERE status__c = 'Draft'])
    {
    bankTransferListToPostIds.add(BankTransfer.Id);
    }
    
    // Execute the Post Bank Transfer method 
    response = bankTransferService.PostBankTransfer(bankTransferListToPostIds);
    
    //Receive the response from the Bank Transfer Service API
    system.debug(response);
    
    /*===============================================End Post Bank Transfer Script========================================*/

    Create Bank Transfer – CreateBankTransfer Method

    Below is information related to creating a Bank Transfer record and automatically posting  the transaction to create the related ledger records within Zumzum Financials. Create your own Apex code to call the CreateBankTransfer method. This will insert a Bank Transfer record as Posted and create the Ledger records in a single call.

    Global Class Name Method Input Output
    BankTransferService CreateBankTransfer BankTransferWrappersList response list of “Bank_Transfer__c”

    Sample Code: Create Bank Transfer

    /*===============================================START CREATE BANK TRANSFER SAMPLE SCRIPT========================================*/
    
    //Initiate a new instance of the Bank Transfer Object
    
    BankTransferService bankTransferService = new BankTransferService();
    
    // Create a new list to store the Bank Transfer Wrappers
    
    List<BankTransferService.BankTransferWrapper> BankTransferWrapppersList = new List<BankTransferService.BankTransferWrapper>();
    
    //Create an object to store the response from the Bank Transfer API
    
    BankTransferService.BankTransferResponse response = new BankTransferService.BankTransferResponse();
    
    //Create a list to store the data for the Bank Transfer Wrappers of records to be created
    
    BankTransferService.BankTransferWrapper BankTransferWrapper = new BankTransferService.BankTransferWrapper();
    
    // Provide the Bank Account ID which will be used as the source to transfer the funds from
    BankTransferWrapper.BankAccountFrom = '<Set Bank Account Id>';
    
    // Provide the Bank Account ID which will be used as the target to transfer the funds to
    BankTransferWrapper.BankAccountTo = '<Set Bank Account Id>';
    
    // Provide the Transaction Date
    BankTransferWrapper.TransactionDate = Date.Today();
    
    // Provide the Foreign Amount to Transfer to the target bank account
    BankTransferWrapper.ForeignAmount = 100;
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    BankTransferWrapper.Reference = 'Sample Reference 1';
    
    // Optional: Provide a text reference to be stored in the Bank Transfer record.
    BankTransferWrapper.Description = 'Sample description 1';
    
    //add Bank Transfer Wrapper 1 to the list of Bank Transfer Wrappers
    BankTransferWrapppersList.add(BankTransferWrapper);
    
    
    //Call The Bank Transfer CreateBankTransfer method to process the list of bank transfers
    response = bankTransferService.CreateBankTransfer(BankTransferWrapppersList);
    
    // Receive the response from the Bank Transfer API class.
    system.debug(response);
    
    
    /*===============================================END CREATE BANK TRANSFER SAMPLE SCRIPT========================================*/

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

    Supported Error Codes – Bank Transfer Service (API)

    Error Message Reason Resolution
    ‘ Please enter a Starting Document Number & Current Document Number for Bank Transfer in General Setup>BT record.’ Missing a Document Number record in Zumzum Setup > Document Numbers. The Document Number for a bank transfer record is automatically created after you first Bank Transfer transaction in the web interface. Otherwise, please add manually.
    ‘Foreign Amount: Please provide a “Foreign Amount” which is greater than zero.’ The Foreign Amount is set to zero or missing. Please submit the wrapper with a value greater than 0.00 for Foreign Amount.
    ‘Please provide different “Bank Account From” and “Bank Account To” values. Both values should be provided. ‘ The same Bank Account record ID appears in both the Bank Account From and Bank Account To variables. Submit a data wrapper with unique values for both the Bank Account From and Bank Account To variables.
    ‘Bank Account To: Please confirm this Bank Account (ID) is valid and the Bank Account is set as “Active”.’ Either there is an incorrect Bank Account record ID or the Bank Account record is not marked as Active. Ensure your Bank Account record is set to Active and provide a valid Bank Account records ID.
    ‘Bank “Account To” is missing. Please specify a Bank Account to transfer to.’ The Bank Account To variable is missing in your data wrapper. Provide a valid Bank Account record ID in the Bank Account To variable.
    ‘Bank Account From: Please confirm this Bank Account (ID) is valid and the Bank Account is set as “Active”.’ The Bank Account From variable is missing in your data wrapper. Provide a valid Bank Account record ID in the Bank Account From variable.
    ‘Bank “Account From” is missing. Please specify a Bank Account to transfer from.’ The Bank Account From variable is missing in your data wrapper. Provide a valid Bank Account record ID in the Bank Account From variable.
    ‘Bank Transfer \”+bankTransferWrapper.Name+’\’ with ID \”+bankTransferWrapper.Id+’\’ Should be in “Draft” or “Approved” to post to the ledger’ The Bank Transfer record ID is already Posted or is set to another status than Draft of Approved. Confirm the Bank Account record ID is in a status of Draft or Approved.
    ‘Bank Transfer input list is empty. Please provide at least one Bank Transfer Wrapper to create a Bank Transfer.’ No Bank Transfer Wrappers are included in the list of Bank Transfer Wrappers submitted to the API. Include at least one Bank Transfer Wrapper in the list of Bank Transfer Wrappers passed to the method.

    in Bank Transfer APIIntegration