A Better Metrc Integration

by | Jul 16, 2020


CK: Thanks for taking time out of your busy week to give us an inside look at the Leaf Trade & Metrc Integration. To start, can you share more about your role at Leaf Trade?


HH: For sure. My formal title is Senior Engineer. I spend most of my time uniting back-end functionality with user experience. I’m kind of the user experience guru — leading the effort to constantly modernize and update our platform to make things as functional and seamless as possible. 


Recently, I’ve been focused on integrating with Metrc. That’s been a lot of integrating third-party services into our app and creating the ability for external users to import their data into their Leaf Trade storefront. We’re really using some cutting-edge techniques to allow data import into our platform, without having to harangue and work with really unreliable external systems. 


Ultimately, we don’t want growers to worry about making sure that they’re compliant on their side, and we can handle all the nitty-gritty importing, reviewing, and smoothing out all that data (without it being a pain in the butt). 


CK: How is Leaf Trade’s team approaching development in chasing this goal?


HH: One of the reasons I’m most excited about working with this team is how deep the team’s experience is in using open-source technologies. We’re based on open-source technology, so we’re bringing in industry best practices from both within and outside cannabis. In my mind, it’s almost one of our unfair advantages — we just haven’t seen this kind of expertise at other groups working in space.


The team is also really open-minded about using new technologies or trying new ideas. If it works, we go for it. If it doesn’t, we try something else. It’s a collaborative, fast-moving environment where the team is experienced enough to make their own decisions independently.


CK: Tell us more about building the Metrc integration. What challenges did you encounter? What excited you most?


HH: It’s really not as straightforward to build this as you’d hope. That’s only compounded by working in the supply chain industry — you have to do many third-party integrations to make things more efficient for your customer and drive value for them. For each one, there’s a host of new considerations: you have to do error handling, data can go missing, you might get throttled when asking for too much information, you might encounter network errors, or need to serialize/de-serialize data… the list is extensive. 


Creating a great product also meant making one of the most complex UIs I’ve ever dealt with. Usually, a form is static and you input data, valid or not. For this, we’ve created a truly dynamic form that builds off of external data in a tabular approach.


This project was particularly energizing, though, as we incorporated really cutting-edge technological solutions to solve our problem. For example — Lambda calculus was invented in 1930, but has only recently been incorporated into programming as things have shifted from an object orientation to functional approach. Even though the math behind it is old, functional programming really lets us solve problems in truly flexible and elegant ways.


CK: Why do you think the Metrc integration is so important to our customers? What’s next to improve it even more?


HH: Imagine you’re a grower and you’re required to input all your inventory and sales data into state systems. It’s a ton of work that currently is really duplicative across a variety of systems. We want to make it simple — import from Metrc into Leaf Trade, review, and get back to doing your job.


Our end goal: give us your API keys and you don’t need to worry about it anymore.


Coming up, we’ve got a daily job that imports from third parties into our system (vs. just pulling imports manually). Longer-term, we’re going up and down to really integrate with anything that a grower might need to integrate with.


From what I can tell there are not a lot of companies in this space highly focused on integrations, and the ones that are are more of an afterthought, which is something that I think really sets Leaf Trade apart from the rest.


If you or anyone at your company is interested in a demo of the Leaf Trade + Metrc integration, please click here to submit your request.