Bank Supplier Payment API

Zumzum Financials Knowledge Base

    Overview:

    The Zumzum Financials Bank Supplier Payment API service provides the following capabilities

    • Allocate payment to a supplier Purchase Invoice Line Item.
    • Post a Supplier Payment On Account.

    Bank Supplier Payment Description

    The Bank Supplier Payment Service provides the capability to allocate Bank Payments to Purchase Invoice Line Items in Zumzum Financials.  The system will take care of  tracking paid and unpaid amounts against Purchase Invoices.

    Payment to suppliers may be posted as Payments on Account, to later be allocated to supplier Purchase Invoices, either via the Zumzum Financials web interface or Bank Allocate Credits And Payments API Service.

    You should be aware of the following:

    • Bank Payments are automatically posted to the Zumzum Financials general ledger.
    • When using the BankSupplierPaymentService Apex class, you will be creating the following records
      • Batch Bank Payment
      • Bank Payment
      • Bank Payment Line Items
      • Ledger records
      • Ledger Payment History (Only With Allocations to Purchase Invoice Line Items)
    • 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 Bank Supplier Payment  then you will need to post an alternative transactions, e.g. a Purchase Credit and Bank Supplier Refund (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.
    • You  may post a list of 50 Supplier Payments to a Purchase Invoice with 10 line items for each Purchase Invoice.
    • You may post a list of 50 Supplier Payments On Account.

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

    BankSupplierPaymentWrapper API Fields

    Object Name Field Name API Name Type Required
    BankSupplierPaymentWrapper Account AccountId Lookup (Account_c) Yes
    BankSupplierPaymentWrapper Reference Reference String No
    BankSupplierPaymentWrapper Bank BankAccountId Lookup (Zumzum__Bank_Account__c) Yes
    BankSupplierPaymentWrapper Date PostingDate Date Yes
    BankSupplierPaymentWrapper Tax Rate TaxRate Lookup (Zumzum_Tax_Rate__c) Yes, For Supplier Payment on Account Only
    BankSupplierPaymentWrapper Amount BankReceiptAmount Decimal (2 decimal places) Yes, For Supplier Payment on Account Only
    BankSupplierPaymentWrapper BankPaymentLine BankPaymentLine List Yes, Except For Supplier Payment On Account.

    The BankSupplierPaymentService function will accept the list of ‘BankPaymentLine’ as an input parameter.  Below are the required fields when allocating a Bank Supplier Payment Line to a Purchase Invoice Line Item.

    Note:  You would query your unpaid Purchase Invoice Line items and then find the Ledger record of the Creditors Control Account so that you may pass the Ledger Name as a variable to the BankPaymentLine list.

    BankPaymentLine API Fields

    Object Name Field Name API Name Data Type Required
    BankPaymentLine Amount Amount Number (16,2) Yes
    BankPaymentLine Ledger Name LedgerName String Yes

    Create a Bank Supplier Payment – CreateBankSupplierPayment Method

    Below is information related on how to allocate supplier payment to Purchase Invoice Line Items with the Bank Customer Receipt API service using Apex code.  Zumzum Financials includes a global class called BankSupplierPaymentService which you may call from your own Apex code. The CreateBankSupplierPayment method is used to insert a Batch Bank Payment record, with a  Bank Payment, Bank Payment Line Item, Ledger records and Ledger Payment History (Payment Allocations). The service returns a list of Bank Payment records created.

    Global Class Name Method Input Output
    BankSupplierPaymentService CreateBankSupplierPayment List “BankSupplierPaymentWrapper” List of type object, e.g. “Bank_Payment__c”

    Sample Code: Create Bank Supplier 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 Bank Payment record, a Bank Payment Line, two ledger records and one Ledger Payment History (Payment Allocations).

    The following steps will be performed:

    1. Prepare the list collection “List<BankSupplierPaymentWrapper>” to supply as an input for the CreateBankSupplierPayment function.
    2. Prepare the list collection “List<BankPaymentLine>” to supply as an input for the CreateBankSupplierPaymentt function.
    3. Create the Bank Supplier Payment
    4. Return a list of the Bank Payment created with “Bank_Payment__c”

    Sample Code :

    /**************Create Bank Supplier Payment*****************************/
    
    // Initiate A New Bank Supplier Payment
    zumzum.BankSupplierPaymentService objBankSupplierPaymentService = new zumzum.BankSupplierPaymentService();
    
    // Create Bank Supplier Payment Wrapper
    zumzum.BankSupplierPaymentService.BankSupplierPaymentWrapper objPaymentWrapper = new zumzum.BankSupplierPaymentService.BankSupplierPaymentWrapper();
    
    // Supplier Account ID
    objPaymentWrapper.AccountId = '0013H000003sPCoQAM';
    
    // Bank Supplier Payment Posting Date
    objPaymentWrapper.PostingDate = Date.Today();
    
    // Bank Account ID
    objPaymentWrapper.BankAccountId= 'a0K3H000000ExmXUAS';
    
    // Create Bank Supplier Payment Line Wrapper
    List<BankPaymentService.BankPaymentLine> listBankPaymentLines = new List<BankSupplierPaymentService.BankPaymentLine>();
    
    BankSupplierPaymentService.BankPaymentLine obPBankPaymentLine = new BankSupplierPaymentService.BankPaymentLine();
    
    // Ledger Record of Purchase Invoice Line To Be Paid
    objBankPaymentLine.LedgerName = '0000056120';
    
    // Amount Of Line Item To Be Paid
    objBankPaymentLine.Amount = 12;
    
    listBankPaymentLine.add(objBankPaymentLine);
    
    objPaymenttWrapper.BankPaymentLine = listBankPaymentLine;
    
    // Execute the command to post the Bank Supplier Payment
    BankSupplierPaymentService.Response objResponse = objBankSupplierPaymentService.CreateBankSupplierPayment(objPaymentWrapper);
    
    // Receive a response of the Bank Payment records created
    
    system.debug('Response>>' + objResponse.ResponseMessage);
    
    /**********************************************************/

    Post a Bank Supplier Payment On Account – PostBankSupplierPaymentOnAccount Method

    Below is information related on how to post a Supplier Payment On Account with the Bank Supplier Payment API Service using Apex code.  Zumzum Financials includes a global class called BankSupplierPaymentService which you may call from your own Apex code. The PostBankSupplierPaymentOnAccount method is used to insert a Batch Bank Payment record, with a  Bank Payment, Bank Payment Line Item and Ledger records. The service returns a list of Bank Payment records created.

    Global Class Name Method Input Output
    BankSupplierPaymentService PostBankSupplierPaymentOnAccount List “BankSupplierPaymentWrapper” List of type object, e.g. “Bank_Payment__c”

    Sample Code: Post Bank Supplier Payment On Account

    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 Bank Payment record, a Bank Payment Line with two ledger records.  The bank account balance and supplier account balances will be increased as a result of posting this entry.

    The following steps will be performed:

    1. Prepare the list collection “List<BankSupplierPaymentWrapper>” to supply as an input for the PostBankSupplierPaymentOnAccount function.
    2. Post the Bank Supplier Payment On Account
    3. Return a list of the Bank Payment created with “Bank_Payment__c”

    Sample Code :

    /**************Post Supplier Payment On Account*****************************/
    
    // Initiate A New Bank Supplier Payment
    
    zumzum.BankSupplierPaymentService objBankSupplierPaymentService = new zumzum.BankSupplierPaymentService();
    
    // Create Bank Supplier Payment Wrapper
    
    zumzum.BankSupplierPaymentService.BankSupplierPaymentWrapper objPaymentWrapper = new zumzum.BankSupplierPaymentService.BankSupplierPaymentWrapper();
    
    // Supplier Account ID
    
    objPaymentWrapper.AccountId = '0013H000002bIDHQA2';
    
    // Bank Supplier Payment Posting Date
    
    objPaymentWrapper.PostingDate = Date.Today();
    
    // Bank Account ID
    
    objPaymentWrapper.BankAccountId = 'a0K3H000000ExmXUAS';
    
    // Bank Transaction Tax Rate
    
    objPaymentWrapper.TaxRate = 'a173H0000008OcZQAU';
    
    //Bank Supplier Payment On Account Amount
    
    objPaymentWrapper.Amount = 10;
    
    zumzum.BankSupplierPaymentService.Response objResponse = objBankSupplierPaymentService.PostBankSupplierPaymentOnAccount(objPaymentWrapper);
    
    system.debug('Response>>' + objResponse.ResponseMessage);
    
    /**********************************************************/

     

    Supported Error Codes – Bank Supplier Payment Service (API)

    Error Message Reason Resolution
    [ResponseMessage=Please provide the BankPaymentLine variable] The list of Bank Payments does not contain a Bank Payment Line. Submit the BankPaymentLine with all the necessary fields, for a Bank Payment Line to be created
    [ResponseMessage= <1> Please provide the value for Amount to be able to post a Bank Supplier Payment for Ledger Name , bankReceipts=null] The Bank Payment line value is zero Submit the BankPaymentLine with the “Amount” value greater than 0.00

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please provide the ID for a Tax Rate to be able to post a Supplier Payment On Account. Tax Rate is missing from the Bank Payment Line Submit the BankSupplierPaymentWrapper 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.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please provide the ID for an Account to be able to post a Bank Supplier Payment. Supplier Account is missing from the Bank Supplier Payment Submit the BankSupplierPaymentWrapper with the “AccountID” value as an ID to the Account_c record to be used for this line item.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please provide a valid Bank Account ID to create a Bank Supplier Payment Bank Account is missing from the Bank Payment Line Submit the BankSupplierPaymentWrapper with the “BankAccountID” value as an ID to the Zumzum_Bank_Account__c record to be used for this line item.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please provide the value for Date to be able to post a Bank Payment. Date is missing from the Bank Payment Line Submit the BankSupplierPaymentWrapper with the “PostingDate” value to be used for this line item.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please limit your Reference value to only 255 characters The value provided to Reference has exceeded the 255 character limit. Submit the BankSupplierPaymentWrapper with the “Reference” value with 255 characters or less.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Please provide a Ledger Name in the BankPaymentLine item variable. The BankPaymentLine variable is missing a Ledger Name. Submit the BankPaymentLine with the “LedgerName” value of a ledger record related to an unpaid Purchase Invoice Line Item.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Paid Amount should not be greater then Due Amount for Ledger Name The BankPaymentLine Amount is greater than the unpaid amount on the ledger record for this Purchase Invoice Line Item Submit the BankPaymentLine with the “Amount” value less than or equal to the unpaid amount of the Purchase Invoice Line Item.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> Purchase Invoice Line Ledger Record’ + LedgerName + ‘ Is not eligible for payment as it does not contain a Creditors Control Account The BankPaymentLine is invalid as it is not the Creditors Control Account of the Purchase Invoice Line item. Submit the BankPaymentLine with the “LedgerName” value of a ledger record related to an unpaid Purchase Invoice Line Item which contains the Creditors Control Account.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    [ResponseMessage= <1> “Insufficient access, you require edit access to the Purchase Invoice object, Paid Amount and Paid fields” The user posting the bank supplier payment lacks the permission to the Purchase Invoice Object. Add the following permissions to the user profile or add a permission set:

    – Edit Purchase Invoice object
    – Edit Purchase Invoice, Paid Amount field
    – Edit Purchase Invoice, Paid field

    Note that the <1> is referring to which wrapper within your batch the error has occurred in.

    Note that the <1> is referring to which wrapper within your batch the error has occurred in. With the sample script this will only show as <1> but If you customize to add multiple wrappers this may vary, e.g. <2>.

    Related Articles