Add ability to provide external_id of customer instead of external_subscription_id when creating an event.
J
Jeffrey Koehler
The need to provide an external subscription ID with every event when I have multiple different subscriptions for different users means that I have to query lago for the currently active subscription type. This causes a lot of back and forth for each event.
I would instead like to provide the external ID of the user in the event, and no subscription ID, and have lago determine what subscription (potentially plural) to apply the metric to based on the metric code.
This would vastly simplify having different user levels (IE a "pro" or "enterprise" user might get decreased per-event usage rates, as opposed to a "basic" user)
J
Jeremy Denquin
Hello Jeffrey,
Thanks for your request.
Initially, we included both external_customer_id and external_subscription_id in the events. However, we removed external_customer_id a few months ago for several reasons.
The main reason is that, for us, an event should always be tied to a subscription. For large volumes of events, having to recompute the associated subscription from a customer ID didn’t make sense. We strongly believe that we should not be the source of truth for event/subscription mapping.
For your use case, I recommend leveraging our batch events endpoint:
Store the external_subscription_id in your system for each customer.
When sending events, you can easily build an array of events (even identical ones, if needed), each with its corresponding external_subscription_id.
I understand this might not be a perfect fit, but we aim to provide the best experience for as many use cases as possible without compromising the overall design.
Feel free to reach out in our Slack Community channel if you need any assistance!