Expense Sheet API

Zumzum Financials Knowledge Base

    Overview:

    Convert Expense Sheets with the Zumzum Financials API with Global Classes for developers. The Zumzum Financials Expense Sheet API service provides the following capabilities

    • Convert Expense Sheet to a Purchase Invoice

    Expense Sheet with Expense Sheet Details Description

    The Expense Sheet object is an ideal integration point to create transactions from Zumzum Financials from Salesforce.  You should be aware of the following:

    • When converting an Expense Sheet to a Purchase Invoice, your Account for the Purchase Invoice should be set with the Account “Type” field as “Supplier”.
    • The Supplier Account field on the Expense Sheet can be manually or automatically populated.
    • If your Expense Sheet Owner is a Salesforce Community User, the Expense Supplier Account will be automatically set as the Contact Account associated with the user record (User.Contact.AccountId)
    • When converting an Expense Sheet to a Purchase Invoice, the  Purchase Invoice Account will be automatically set as the Supplier Account from the Expense sheet.

    Convert Expense Sheet to Purchase Invoice – ConvertToPurchaseInvoice Method

    Below is information related on how to convert an Expense Sheet to a draft Purchase Invoice. Zumzum Financials includes a global class called ExpenseSheetService which you may call from your own Apex code. The ConvertToPurchaseInvoice method is used to convert and Expense Sheet with Expense Sheet Details to a Purchase Invoice with Purchase Invoice Line Items.

    Global Class Name Method Input Output
    ExpenseSheetService ConvertToPurchaseInvoice Set List

    Sample Code: Convert Expense Sheet To Purchase Invoice

    Please follow the below steps to convert an Expense Sheet to a Purchase Invoice.

    1. Prepare the collection ‘Set<expenseSheetIds>’ to supply as an input for the ConvertToPurchaseInvoice method. For this, you can execute an SOQL command to fetch the ID of the Expense Sheet which should be converted.

    This example is provided to help you begin creating your own custom code.

    Sample Code:

    *******************Start Sample Convert To Purchase Invoice Script *****************************
    
    //Initiate a new instance of the Expense Sheet Service
    
    zumzum.ExpenseSheetService objExpenseSheetService = new zumzum.ExpenseSheetService();
    
    
    // Provide the Expense Sheet ID to be converted
    
    Set<Id> expenseSheetIds = new Set<Id>{'a0T25000006kcDb'};
    
    
    // Execute the method to convert the Expense Sheet
    
    zumzum.ExpenseSheetService.Response objResponse = objExpenseSheetService.ConvertToPurchaseInvoice(expenseSheetIds);
    
    system.debug('Response>>' + objResponse.ResponseMessage);
    
    *******************End Sample Convert To Purchase Invoice Script *****************************
    

    Below are a list of error codes that are returned by the Expense Sheet  Service.

    Supported Error Codes – Expense Sheet Service (API)

    Error Message Reason Resolution
    Provide Supplier Name
    Creating a Purchase Invoice for a Supplier Account value which is empty. Provide an account ID for a SupplierName value

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

    in Expense Sheet API Tags: AutomationExpense SheetIntegrationPurchase Invoice

    Related Articles