Webhook or cURL Request in Terminal API


I’m developing an app in swift in which I want to use Square Terminal for transactions.
but according to the Terminal API documentation, there are two ways to receive the data from Terminal cURL request and get the response and the other is Webhook.

So which one is better to approach in swift? Or How should I Proceed for getting the response of the transaction from Square Terminal.

Hi @emanNick welcome to the forums!

Basically webhooks will allow you to just “listen”, so it’s generally preferred. Without webhooks, you would have to manually poll the endpoint to check for the status. To be clear the cURL command is just an example of one way of doing a HTTP request; you can do the requests from any server-side language that allows HTTP requests (which is pretty much most languages). cURL tends to be the most generic as it’s easy to translate across languages (and some, like PHP, use cURL directly), but it’s definitely not the only way.