PREMIUM ADD-ON

This integration is available upon request only. Please contact us to get access to this premium integration.

RESTlet script configuration

Lago’s native integration with NetSuite utilizes a custom RESTlet script to provide maximum flexibility in fetching or pushing billing data. To set up the Lago RESTlet script in your NetSuite instance, follow these steps:

Upload Lago Scripts

  1. In NetSuite, go to Documents > Files > File Cabinet;
  2. Under SuiteScripts, create a new folder named Lago;
  3. Upload ramda.min.js: This library is essential for using Lago and can be downloaded from here; and
  4. Upload another file into the Lago folder and paste the script provided by your Lago Account Manager.

Upload scripts provided by Lago

Deploy Lago Scripts

  1. Navigate to Customization > Scripting > Scripts > Create a New Script;
  2. Deploy the Lago script for All roles and All employees (you can create custom roles if needed); and
  3. Make sure to change the script status to released.

By deploying this script, you’ll generate a custom endpoint url that is crucial for the authentication process and enables seamless data synchronization between Lago and NetSuite.

Mandatory NetSuite settings

To ensure the sync doesn’t fail, verify that the following settings are correctly configured. This will enable Lago to sync data to NetSuite properly.

Remove Locations on invoices

Lago doesn’t recognize the location field on invoices, which is mandatory by default. To resolve this, remove the location requirement from your invoice form:

  1. Navigate to Customization > Forms > Transaction Forms;
  2. Locate the form related to your invoices;
  3. Go to the Screen Fields tab; and
  4. Find the Location field and uncheck both the Show and Mandatory checkboxes.

Remove Locations on invoices

Define Taxable items

To enable tax amount overrides for your Lago invoices synced to NetSuite, ensure all items are marked as taxable. If any item is non-taxable, the invoice sync will fail. To update an item:

  1. Go to Lists > Accounting > Items;
  2. Edit the item associated with a Lago object;
  3. Navigate to the Accounting tab;
  4. Locate the Tax / Tariff section; and
  5. Set the item to Taxable.

Define Taxable items

Connecting Lago to NetSuite

To fully integrate Lago with NetSuite, start by connecting your Lago instance to a new NetSuite connection. You can have an unlimited number of NetSuite connections. First, link your NetSuite account to Lago. Once connected, activate the specific syncs and actions required for your use case. This ensures that your Lago instance is properly configured to communicate with NetSuite, enabling seamless data synchronization and management.

Create a new integration in NetSuite

After logging into your NetSuite account, navigate to Setup > Integration > Manage Integrations > New. Enter the required integration details and follow these steps:

  • Make sure the oAuth feature is enabled for your NetSuite instance;
  • Make sure the SOAP WEB SERVICES and REST WEB SERVICES features are enabled in NetSuite > Company > Enable Features > SuiteCloud;
  • Under Authentication, select TOKEN-BASED AUTHENTICATION;
  • Disable TBA: AUTHORIZATION FLOW and AUTHORIZATION CODE GRANT; and
  • Save your new integration.

The Client Credentials will be displayed. Copy the Consumer Key/Client ID and Consumer Secret/Client Secret and save them in a secure document for future reference, as this information will not be accessible once you leave the screen.

Create a new NetSuite Integration

Create a new access token in NetSuite

  • Log into your NetSuite account and navigate to the homepage by clicking the home icon;
  • In the Settings section at the bottom left corner, locate and click the Manage Access Tokens button;
  • Select the Application Name created for this integration;
  • Enter a token Name; and
  • Save your new access token.

The Token Credentials will be displayed. Copy the Token ID and Token Secret and save them in a secure document for future reference, as this information will not be accessible once you leave the screen.

Create a new NetSuite My Access Token

Authentication flow

The authentication process connects Lago and NetSuite through OAuth2. To establish this connection, you need to provide the following mandatory fields:

  • Connection Name: an internal name for the connection within Lago;
  • Unique Connection Code: an internal code for the connection within Lago;
  • NetSuite Account ID: your NetSuite account identifier;
  • NetSuite Client ID: the client ID from your NetSuite account;
  • NetSuite Client Secret: the client secret from your NetSuite account;
  • NetSuite Token Id: the token ID from your NetSuite account;
  • NetSuite Token Secret: the token secret from your NetSuite account;
  • Custom RESTlet Endpoint: The endpoint created from the custom RESTlet script.

Enable actions and syncs

Here is a list of syncs and actions that Lago uses with NetSuite. Some are mandatory, while others are optional:

  • Accounts: Fetch account data from NetSuite (mandatory);
  • Customers: Syncs or fetch customer data from NetSuite (mandatory);
  • Items and Tax Items: Fetch item and tax item data from NetSuite (mandatory);
  • Invoices: Syncs invoice data to NetSuite (mandatory);
  • Sales Orders: Syncs sales order data to NetSuite (optional);
  • Credit Notes: Syncs credit note data to NetSuite (optional); and
  • Payments: Syncs payment data to NetSuite (optional).

Connect Lago to NetSuite

Mapping items between Lago and NetSuite

To sync invoices, credit notes, sales orders, and payments to NetSuite, Lago establishes a one-to-one relationship between Lago objects and NetSuite objects. Follow these steps to map an item:

  • Access a NetSuite Connection in Lago: navigate to your connected NetSuite integration within the Lago platform;
  • Select the Item to map: click on the specific item in Lago that you wish to map to a corresponding NetSuite item;
  • Fetch Items from NetSuite: Lago will automatically retrieve the relevant items from your NetSuite instance;
  • Map the Item: choose the appropriate NetSuite item from the list provided by Lago; and
  • Click ‘Save’ to finalize the mapping.

Mapping a fallback item (mandatory)

The fallback item is a dummy item used as a backup in case the mapping of other objects fails. To ensure continuous data synchronization between Lago and NetSuite, this fallback item will be used whenever there is a mapping issue.

This mapping follows a one-to-many structure, meaning that a single fallback item can be used to handle multiple mapping issues.

Map a fallback item between Lago and NetSuite

Mapping a tax item (mandatory)

To override the tax amount for an invoice, sales order, or credit note, you need to map a single tax item from NetSuite. This mapped item will be used to assign the correct tax amount.

This mapping follows a one-to-many structure, meaning that a single tax item can be mapped to override all tax amounts issued by Lago.

Map a tax item between Lago and NetSuite

Mapping default objects

Coupons, credit notes, subscription fees, minimum commitments, and prepaid credits require a one-to-many mapping. Each of these objects must be mapped to a single default item from your NetSuite instance. Lago will use this mapped item whenever any of these objects appear on the final invoice sent to NetSuite.

This mapping follows a one-to-many structure, meaning a single item can handle multiple mappings for coupons, credit notes, subscription fees, minimum commitments, and prepaid credits.

Map default items between Lago and NetSuite

Mapping custom objects

Billable metrics and add-ons require a one-to-one mapping. Each billable metric, used for usage-based billing, must represent a specific SKU in your NetSuite instance. You need to map each of these individually. Lago will use the mapped items whenever any of these metrics or add-ons appear on the final invoice sent to NetSuite.

This mapping follows a one-to-one structure, meaning each billable metric or add-on must be mapped to a specific NetSuite item.

Map custom items between Lago and NetSuite

Customers synchronization

When creating or updating a Lago customer, you can choose to link it to a NetSuite customer.

The first option is to automatically create a new customer from Lago to NetSuite. Follow these steps:

  1. Create or update a new Lago customer;
  2. Select the targeted NetSuite connection;
  3. Check the box labeled ‘Create this customer automatically in NetSuite’;
  4. Choose a NetSuite subsidiary from the list (Lago will fetch the list of subsidiaries from your NetSuite instance); and
  5. Save and create this new customer.

If the customer is successfully created in NetSuite, a new field will be displayed in the Lago customer view, providing a direct link to the corresponding NetSuite customer.

Customer creation from Lago to NetSuite happens in real-time with only a few seconds of delay.

Lago customer integrated with NetSuite

The second option is to import an existing NetSuite customer to a Lago customer. Follow these steps:

  1. Create or update a Lago customer;
  2. Select the targeted NetSuite connection;
  3. Ensure the box labeled ‘Create this customer automatically in NetSuite’ is unchecked;
  4. Paste the NetSuite customer ID in the appropriate field; and
  5. Save and create this new customer.

Here is the list of fields that is currently synced to NetSuite:

LagoNetSuite
customertype
customer.namecompanyname
customer.netsuite_subsidiarysubsidiary
customer.idcustbody_lago_id
customer.emailemail
customer.phonephone
customer.external_salesforce_idcustentity_lago_sf_id

Invoices synchronization

If a Lago customer is linked to a NetSuite customer, Lago syncs invoices to NetSuite Invoices in real-time.

It’s important to note the following:

  • Each fee issued by Lago is synced as a line item on a NetSuite invoice;
  • The Lago fee units are synced to NetSuite as quantity;
  • The Lago fee precise_unit_amount is synced to NetSuite as rate;
  • Lago overrides the total tax amount of a NetSuite invoice using the tax item, as NetSuite does not support tax details at the line item level; and
  • Any discounts on an invoice (coupon, credit note, or prepaid credits) are synced as negative line items on the NetSuite invoice.

If the invoice is successfully created in NetSuite, a new field will be displayed in the Lago invoice view, providing a direct link to the corresponding NetSuite invoice.

Invoice creation from Lago to NetSuite happens in real-time with only a few seconds of delay.

Sync Lago invoices to NetSuite

Here is the list of fields that is currently synced to NetSuite:

LagoNetSuite
invoicetype
invoice.lago_idtranid
customer.netsuite_internal_identity
trueistaxable
taxitem.idtaxitem
invoice.taxes_amount_centstaxamountoverride
invoice.numberotherrefnum
invoice.lago_idcustbody_lago_id
invoice.fee.idlineItems.item
invoice.fee.account_codelineItems.account
invoice.fee.unitslineItems.quantity
invoice.fee.precise_unit_amountlineItems.rate

Sales Orders synchronization

If a Lago customer is linked to a NetSuite customer and the Sales Orders action is enabled in your Lago-NetSuite connection, Lago syncs invoices to NetSuite Sales Orders in real-time.

Note that the same fields used to sync invoices are also used to sync sales orders.

Here is the list of fields that is currently synced to NetSuite:

LagoNetSuite
salesordertype
invoice.lago_idtranid
customer.netsuite_internal_identity
trueistaxable
taxitem.idtaxitem
invoice.taxes_amount_centstaxamountoverride
invoice.numberotherrefnum
invoice.lago_idcustbody_lago_id
invoice.fee.idlineItems.item
invoice.fee.account_codelineItems.account
invoice.fee.unitslineItems.quantity
invoice.fee.precise_unit_amountlineItems.rate

Credit Notes synchronization

If a Lago customer is linked to a NetSuite customer, Lago syncs credit notes to NetSuite Credit Memos in real-time.

It’s important to note the following:

  • Each fee refunded by Lago is synced as a line item on a NetSuite Credit Memo;
  • Lago overrides the total tax amount of a NetSuite credit memo using the tax item, as NetSuite does not support tax details at the line item level; and
  • Any discounts on an credit note (like coupon, for instance) are synced as line items on the NetSuite Credit Memo.

If the credit note is successfully created in NetSuite, a new field will be displayed in the Lago credit note view, providing a direct link to the corresponding NetSuite Credit Memo.

Credit note creation from Lago to NetSuite happens in real-time with only a few seconds of delay.

Here is the list of fields that is currently synced to NetSuite:

LagoNetSuite
creditmemotype
invoice.lago_idtranid
customer.netsuite_internal_identity
trueistaxable
taxitem.idtaxitem
invoice.taxes_amount_centstaxamountoverride
invoice.numberotherrefnum
invoice.lago_idcustbody_lago_id
invoice.fee.idlineItems.item
invoice.fee.account_codelineItems.account
invoice.fee.unitslineItems.quantity
invoice.fee.precise_unit_amountlineItems.rate

Payments synchronization

If a Lago invoice is tied to a NetSuite invoice, Lago automatically syncs payments occurring in Lago to NetSuite, updating in-real time the payment status of the invoice in NetSuite.

LagoNetSuite
customerpaymenttype
customer.netsuite_internal_idcustomer
invoice.netsuite_internal_idlineItems.doc
truelineItems.apply
invoice.total_amount_centslineItems.amount