Prerequisites
In Lago:- Create a Lago organization to manage your billing and invoicing.
- Create a billable metric to track the usage of your customers.
- Create a metered product on that metric, price it with a rate card, and add it to a plan.
- Create a customer and a contract for that customer.
- Create a Hightouch account.
- Create a data source (ideally, product usage of your customer).
- Create an HTTP Request destination.
Send usage from Hightouch to Lago
Create a data source
First, create a source in Hightouch:- Navigate to the Sources tab.
- Add a new source.
- Choose and set up a data source available in Hightouch (a database, a warehouse or a spreadsheet, for instance).

Hightouch Sources
Use the HTTP Request destination
Lago uses Hightouch’s HTTP Request destination to ingest usage:- Go to the Destinations tab.
- Select the HTTP Request destination.
- Define your Headers. Lago requires
Authorization(secret,Bearer __YOUR_API_KEY__) andContent-Type: application/json. - Save the destination.

Hightouch HTTP Request Destination
Create a sync
Go to the Syncs tab and create a new sync from your source to the HTTP Request destination.- Configure when to trigger the event (row added, row deleted, row updated).
- Define
POSTas the HTTP method. - Define the target URL:
https://api.getlago.com/api/v2/events(orhttps://api.eu.getlago.com/api/v2/eventsfor EU-hosted organizations). - Send data as
JSONand use the JSON editor. - Define rate limits, if applicable.
Example JSON payload
You define the JSON payload sent to Lago. Hightouch supports the Liquid template language to insert variables from your source:"{{ row.variable }}", where variable is the column name in your source.
The payload follows the events schema of POST /api/v2/events. Each event targets a contract through external_contract_id:
transaction_id and code are required. code must match a billable metric code. external_contract_id must match the external_id of the contract you bill. timestamp is a Unix timestamp in seconds and defaults to the request time. Adapt properties to your billable metric.Test and activate your sync
Test the sync with a data sample. The event should appear in Lago’s events list, or throughGET /api/v2/events. Once ready, activate the sync and define the periodic trigger.

Hightouch Test Sync with Lago
Hightouch to Lago demo video
This video was recorded with the legacy v1 events payload. Its Hightouch setup steps still apply. Use the V2 URL and payload above.
Ingest usage
How events target a contract.
Ingest a batch of events
POST /api/v2/events/batch reference.