Hi there. I developed a (back-end) accounting and ...
# support
d
Hi there. I developed a (back-end) accounting and ERP system called Beanie (https://bean.ie/ - which is free, by the way). It currently integrates with Shopify, but I'd like to add support for Solidus. As it happens, Beanie is written in RoR as well, and has an extensive API, so I'm trying to decide on the best way forward - some sort of ETL which sits between the two, add Solidus API support to Beanie, or Beanie API support to Solidus. Any thoughts?
g
There's a pretty decent guide on creating new solidus extensions: https://guides.solidus.io/developers/extensions/writing-extensions If videos are more your speed:

https://www.youtube.com/watch?v=2THP9PMfUHQ

(a couple years old but still walks through the same general steps as the written guide)
d
Great! Thanks, I'll have a read of that. (and then watch the video 😀)
c
I also recommend taking a look at the Solidus Event system, I think it maybe a good option for something like an ERP integration if you want to do things in realtime. There aren’t many built-in events but adding new custom events is fairly trivial https://guides.solidus.io/developers/events/overview
d
Thanks for that link. I'll take a look. I think I need to do a lot more research to figure out the best method of integration.
c
Having done a few ERP integrations in Solidus it really depends on what the ERP APIs look like. With systems like Netsuite that aren’t very good (or get expensive) with high-throughput we’ve used the Solidus APIs for fetching batches of completed orders on a set interval https://solidus.stoplight.io/docs/solidus/6509ce1d573db-list-orders. Other systems which are better at ingesting data in realtime we’ve opted for queuing a job to sync each order after it’s been completed, and that’s where the event system could come in handy. On the other end, for receiving data from an ERP in Solidus, I recommend looking at the
solidus_webhooks
gem https://github.com/solidusio-contrib/solidus_webhooks. It provides a good abstraction for introducing webhook handlers.
d
As the ERP is Rails-based, there's a pretty extensive API by default. I removed JSON support for some objects, like the company configuration itself, but pretty much everything has a REST interface. For the Shopify integration though, it would poll the Shopify API frequently, and pull any new customers, creating Beanie customers for each one. Likewise, orders. For products it was a bit trickier. Any product in Beanie marked for "online sale" would be pushed to Shopify if it didn't already exist there, and if it found a Shopify product which didn't exist in Beanie, it would create it on the Beanie side. Right now, I think I'm favouring doing something similar with Solidus. I did run into API "token bucket" issues with Shopify, and it's a nuisance to have to poll it, but it works. The customer who wanted the Shopify integration has a traditional business which they run on Beanie, but they also have a store "brand" and they wanted one inventory ordering and management system, as well as a way of seeing total sales, not just the non-online stuff. I'll deffo look at the webhooks stuff, too.
👍🏼 1
c
Yeah, following the same pattern you did with Shopify makes sense. The two data models are not too different, though the Solidus one is quite a bit more fleshed out 😉
If you have any questions when you get more into building the extension feel free to post them in this channel, there are lots of people here who have done similar things 🙂
d
😀 Yeah, I've been working through some examples. Joining the dots between the DB schema and what you see in the views. I am coming around to the poll approach, but I'd like to dig into the webhooks a bit to stop having to do so much polling. Thanks for all the pointers.
👍🏼 1
c
No problem, I am excited for the possibility of having a prebuilt ERP integration for Solidus, so happy to help 😄