I. Integration configuration
Create integration for Salesforce on Lago side
Contact us to get premium access to the Lago Salesforce package. Log in to Lago as an admin user, navigate to Settings > Integrations > Salesforce (allowed only if the team has enabled it for your account), and click “Create new”. Enter the following details:- Name
- Code
- Salesforce Instance (URL of your Salesforce instance)

Create new Salesforce integration in Lago

Salesforce integration connection details
Install Salesforce CRM package
Click the link we provide to open the installation page, then follow the instructions. Contact us if you need help during the installation.
Install Lago Salesforce App package
- We recommend selecting the “Install for all users” option;
- Click on the “Install” button;
- Make sure to check the box to grant access to these third-party websites; and
- Once completed, you’ll have successfully installed the Lago Salesforce App.
Webhook config: sync real-time data
After installation in Salesforce CRM, set up a webhook URL in Salesforce to receive real-time data from Lago. This involves configuring a new “Site” in Salesforce’s setup section. Note that the four main actions described below must be performed by a Salesforce admin, and are only required during the initial setup.Access the Site section in Salesforce
- Click the gear icon in the upper right to access Salesforce Setup;
- Search and navigate to the Sites section; and
- Create a new Site (see picture below).

Create a new Site in Salesforce
Create a new Site in Salesforce
- Set a unique Site Label;
- Specify a unique Site Name;
- Optionally, add a Site Description;
- Ensure the Site Contact and Default Record Owner are filled;
- Set the Default Web Address prefix to
getPushNotification; - Choose
SiteLoginas the Active Site Home Page; and - Don’t forget to save the new site; and
- Activate the newly created site by going to the Site Details and clicking the
Activatebutton.

New site creation flow in Salesforce
Edit Public Access Settings in Salesforce
- Visit the site and click Public Access Settings;
- In the Enabled Apex Class Access section, click “edit”;
- Add
LagoWebHookSubscriptionControllerto Enabled Apex Classes; and - Save your changes.

Edit Salesforce's site Public Access Settings
Paste the Webhook URL into Your Lago App
- Return to your newly created site;
- Locate the Custom URLs section;
- Copy the domain name (e.g., lago.my.salesforce-sites.com);
- Add the
https://prefix to this domain name (e.g.,https://lago.my.salesforce-sites.com); and - Append
/services/apexrest/lago/api/Webhooks/incoming/pushDetails/to the domain name (e.g.,https://lago.my.salesforce-sites.com/services/apexrest/lago/api/Webhooks/incoming/pushDetails/).

Find Salesforce's site domain name
- Within Lago, navigate to Developers;
- Visit the Webhooks tab;
- Choose
HMACas the mandatory signature type; - Paste your Salesforce webhook URL; and
- Save this webhook endpoint.

Paste Salesforce webhook URL to Lago
Establish and finalize connection

Connect your Lago instance to Salesforce Lago App
- Access Salesforce and locate the App Launcher;
- Find and open the Lago app you recently installed;
- Within the Lago Base Configuration tab:
- Provide your Lago API Key (located in Lago’s Developer Section)
- Enter your Lago API base URL. Do not append an API version path to the URL. By default, the valid URL is
https://api.getlago.com/. If you want to change the API base URL to another one (e.g.,https://api.eu.getlago.com/or a custom self-hosted one), please follow option 2. - Enter lago app URL (Front End Base URL). By default, the valid URL is
https://app.getlago.com/(it will be different for self-hosted). - Enter Lago Integration code from Step 1
Salesforce integration on Lago
- “Save and validate” your connection; and
- If the Lago API Key is valid then only Start Data Sync button will be enabled.
- Click the “Start Data Sync” to finalize the connection between Lago and Salesforce.
- Navigate to Salesforce’s Setup;
- Search for and select Remote Site Settings;
- Find and access the remote site for the Lago App;
- Click the Edit button to modify the remote site’s details;
- Update the Remote Site URL with your preferred URL; and
- Save the changes.
II. Sync data from Lago to Salesforce
If your webhook endpoint is configured correctly, your customer and billing data flow in real time.Sync customers to Salesforce (> v2.7)
- Navigate to the customer creation screen in Lago
- Complete the standard customer information fields
- Expand the ‘Connect to external apps’ section at the bottom of the form
- Select Salesforce and choose the integration established during the initial setup
- Choose the appropriate synchronization method:
- For new Salesforce customers: Enable the Create automatically this customer option
- For existing Salesforce customers: Enter the corresponding ‘Salesforce Account ID’

Customer external apps connection interface
Customer Type is set to Individual: Creates a Person Record type account.When Customer Type is Company or unspecified: Creates a standard company account using the default record type for the running userFor Salesforce instances without Person Accounts:
Creates all accounts using the default record type associated with the running userSync customers to Salesforce (< v2.7)
To synchronize Lago Customer data with Salesforce Accounts (native object), ensure that your Salesforce Account is created first, and that the Lago Customer’sexternal_salesforce_id is explicitly populated.
- Begin by creating a new Account in Salesforce or accessing an existing one;
- Next, create a customer in Lago and populate the
external_salesforce_idfield for a Lago Customer with the Salesforce Account Id; and - Your Salesforce Account and Lago Customer are now synchronized.

Salesforce Account with Lago Customer information
Sync invoices to Salesforce

Sync invoices data from Lago to Salesforce
Lago Invoices custom object.
Here is a list of invoice fields that are automatically synced:
- Invoice Number;
- Invoice Payment Status;
- Invoice Type;
- Invoice Issuing Date;
- Invoice Amount;
- Invoice File URL; and
- Invoice Currency.
Sync credit notes to Salesforce
Whenever a credit note is issued for a Lago Invoice, the credit note details will be automatically synced in real time with Salesforce, using theLago CreditNotes custom object.
Schedule sync from Lago to Salesforce
We also provide an option to schedule the data sync from Lago to Salesforce.LagoSyncScheduleable: a schedulable class which helps us schedule either all the data or any one of them.- To schedule the sync of any ONE of the object:
- Create a new instance of class by passing one of the following strings:
CUSTOMER,INVOICE,CREDITNOTE- Ex: To sync invoices from Lago to Salesforce everyday at 1PM, execute below anonymous code in Anonymous window in Developer Console. (click here to learn more about CRON expression)
- Ex: To sync invoices from Lago to Salesforce everyday at 1PM, execute below anonymous code in Anonymous window in Developer Console. (click here to learn more about CRON expression)
- Create a new instance of class by passing one of the following strings:
- To schedule the sync of ALL the objects:
- create a new instance of class by passing
true- Ex: To sync all objects from lago to Salesforce everyday at 1PM, execute below anonymous code in Anonymous window in Developer Console. (click here to learn more about CRON expression)
- Ex: To sync all objects from lago to Salesforce everyday at 1PM, execute below anonymous code in Anonymous window in Developer Console. (click here to learn more about CRON expression)
- create a new instance of class by passing
III. Actions from Salesforce to Lago
Beyond syncing data from Lago to Salesforce, you can initiate actions in Lago directly from Salesforce with SalesforceFlows. Lago provides a customizable template for creating customers from Salesforce Accounts.
Create customers
Flow: Lago Template - Create Customer in Lago on Account Create

Use Lago template to create a customer on Account creation
- Log into your Salesforce instance;
- Access the Setup section via the settings wheel icon in Salesforce;
- Find and select
Flowsunder Process Automation in the sidebar; - Locate and open the
Lago Template - Create Customer in Lago on Account Create; - Click ‘Save As’ to create and save your own version of the template; and
- Do not forget to click the
Activatebutton to activate your flow.
customer type to ‘Individual’ or ‘Company’ when you create a customer from Salesforce in Lago.

Customize the flow
Get invoice PDF
We can also get the invoice PDF directly from Salesforce.- Go to the Lago Invoice tab;
- Open an invoice that is already synced; and
- Click
Get Invoice pdf, the PDF opens in a new tab.
Get invoice line item details
We can fetch Invoice line items manually for any invoices if required.- Go to Lago Invoice tab > Open any Invoice which is already synced.
- Click on
Lago Sync Invoice Line Itembutton. If button is not present on the layout, please add it on Page layout or Lightning record page. - All lago items will be synced and available in
Lago Line Itemschild custom object.

Get Invoice line items
Debugging & logs
Every action and data transfer between Lago and Salesforce is logged. The logs are accessible through the Lago package:- Navigate to ‘Lago Base Configuration’, the starting point for the debugging tools; and
- Access Logs: Click on the ‘Logs’ tab to view a detailed record of all activities.
Customer management
Create a customer
POST /api/v2/customers reference, including external_salesforce_id.