Our food system is broken

Bananas wrapped in plastic?

Air-mailed thousands of miles from the other side of the World?

No thanks

Give me a bunch of locally-grown, wonky carrots any day! 🥕

Our mission

We want to help local, sustainable growers compete with the giant supermarkets, and hopefully, gradually, change the way we consume fresh produce.

One way we plan to do this is to give our vegetable-growing-friends better planning and data tools.

The problem

When growing and selling vegetables, your inventory changes on a daily-basis through the season.

Managing a fluid inventory such as this can be time consuming when it comes to setting up the items you'll be selling via Square POS. Lots of different items, prices and measurements.

If the farmer is using MarketGardenPro, we already have all this crop data, so we wanted to make an easier way for them to get ready to sell at the weekly farmer's market using Square.

The solution

This integration offers a "one-click" sync operation whereby all their crops are setup in the user's Square Item Library ready for sale.

Sync products to Square

When one of these items sells as is paid for via Square, either on their MarketGardenPro online store, or in person with their Square POS Terminal, we reconcile the sale with the crops they grew giving the farmer insight in to their overall productivity and profitability.

Crop sales data

How we built it

We used Square's Oauth API to initially allow the user to grant our application authorization and make requests on their behalf.

We then use the Catalog API to sync the users crops with their Square account, and a mixture or webhooks and the Payment/Order APIs to capture the sales.

This was built on top of our existing Laravel application, but we used Square's PHP SDK for many parts of the request building which made things much easier!

Challenges we ran into

Square accounts may be "vanilla" with no measurements configured, or the user may have a variety of measurements setup already.

In MarketGardenPro, we mainly deal with weights when it comes to sales. So we had to make sure the correct MeasurementUnit exists for each item synced.

Also, what if a user logged in to Square manually and edited a previously "synced" item?

Or deleted it? And then, logged back in to our application and synced again?

We had to carefully think through the correct sequence of whether to create, upsert or delete, using the Catalog API to check each item, at either side of the process.

Are we happy with what we have built?

Yes!

We feel this feature allows farmers to focus on preparing their crops for sale, rather than how they will sell them.

This gives them a one-click-and-you're-ready-to-go capability, and we hope to start giving them real sales data they can now reconcile directly with what they grow.

Along with our other features we hope we can help them to be more efficient, and subsequently, get a better share of the overall food market.

Built With

Share this project:

Updates