Webstore Order Webhook Capture

Hello, I’m trying to decide if square is the right tool for my store to use. We currently want to host the store on a square site, and use the Webhooks-api to trigger events on our own server in order for us to capture the data and send it off to our supplier. As I’m reading through the API docs, I see that order.created and order.updated are only ever triggered when I hit one of square’s endpoints. However, since I would like events to spawn from my square hosted store, this doesn’t leave the option open for me to trigger these events. Is there a way to listen to webstore purchases?

Hi @thisisorenda welcome to the forums!

If by hosted Square store, you’re meaning the Square Online store, then it does trigger order webhooks, as it uses the Orders API in the backend. You can also list for payment webhooks instead, if you prefer. Please let me know if I misunderstood or if you have additional questions!

This is great to know that Square Online triggers order.created but how can I create a test order for the sandbox store? There is no Square Online interface. I want to create a real order so I can use the Order API to retrieve the order info. Do I need to learn how to create an order via the order API in order to test retrieving one or is there an easier way?

:wave: Unfortunately, there isn’t a sandbox for the Square Online Store. You would have to test production orders from the Online Store. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

Thanks Bryan for this info. I notice in a Square Online store, a user can attach customer notes to an order. Is this surfaced via the Order API at all? I notice there’s a metadata field. Would it be included there by any chance?

It wouldn’t be in the metadata. That is used if you were creating orders with the API. It will be in the order notes: :slightly_smiling_face:

Thanks Bryan for your quick reply, but I don’t see a notes attribute in the Order resource documentation: Order Object - Square API Reference – Are we talking about the same thing? This is the resource returned by the Retrieve Order endpoint: https://developer.squareup.com/explorer/square/orders-api/retrieve-order

The workflow I’m trying to implement:

  1. Get notified via a web hook for a new order on the Square Online store. I understand the order.created event is fired for Square Online.
  2. Retrieve the order info via the order ID in the response body of the web hook notification, including item names and customer notes.

I noticed there is a note field for at order.line_items[].note—in Square Online this doesn’t appear to map to anything. Does it?

Do you have an example order_id from an Online Store order that you are trying to get the notes for?

Thanks Bryan, I do not have an order yet, the store is not yet active, I’m still evaluating it to see if Square makes sense to use. Your sandbox environment doesn’t allow me to create Square Online orders so I’m unable to create one. Lack of proper support for web hooks for Square Online transactions is a deal breaker for me. Are you able to answer this question without a sample order from my store? The data modelling on your end should be the same and it should not make a difference.

How can I get the order notes from the API?