Square API & Webhook

Hi, everyone:

Upper management requires me to use Square instead of Stripe, and I have found less resources for it. So I am hoping someone with Square experience can help me out.

I am completely new to the concept of webhooks, and I have read up and YouTubed on the subject.

Let me tell you my scenario:
Currently, my eCommerce app has a shopping cart that sends customers to the Square Checkout page when they want to pay via online-checkout/payment-links . What I need is for Square to notify my app when the customers have successfully completed payment. Once the customer has successfully payment, my app needs to add the customers’ name to a list within the app and send a confirmation email.

So far, I am able to using the sandbox testing environment to send the user to a checkout session via payment links and a successful payment can be successfully tested. A webhook has also been successfully connected to my Bubble app, so I am receiving data from Square.

However, for me to add the user to a list on the app and send that user a confirmation email, I believe I would need Square to return the Customer ID. A Square representative told me that in the sandbox environment, that is not a parameter the webhook can return (it will in production). So now I’m thinking I am stuck because I am not sure how to build out and test the actions after receiving the data from Square without the most crucial parameter.

Any small suggestion to help me make progress would be greatly appreciated.

Thank you.

When you make the API call to Square, the action should respond with some form of unique id you can use it subsequent steps, could you store that in your Bubble database, then confirm the webhook also sends that same id and find it that way?

It may be like an id of the order or payment link, but anything to save so you can identify it later.

1 Like

The webhook returns Event ID, Data ID, Application ID, Location ID, Order ID, and an unidentified ID…

Maybe Order ID or the unidentified ID is something also found in the webhook

Hello @cinji18 have you found a solution because I have the same problem as you?