
The short answer: with a synchronous request, your site asks and waits until it has the final answer, as when it reads the status of an order. With an asynchronous request, the API answers straight away with “received, processing” and the result arrives later, by another route. Mobile payments, payments by reference or bank transfer, and SMS delivery are asynchronous by nature: they depend on a person confirming on a phone, a bank or a mobile network, and no server should sit waiting for that. This is for anyone wiring payments, SMS or other APIs into a site.
What is usually synchronous, and what is not
| Situation | Type | Why |
| Looking up an order, a customer, a balance | Synchronous | The answer already exists on the other side: it just has to be read. |
| A payment the customer confirms on the phone (with a PIN or a code) | Asynchronous | The API accepts the request, but the outcome depends on the customer accepting, declining or letting it time out. |
| A payment by reference or bank transfer | Asynchronous | The customer pays when they pay, sometimes long after leaving the site. |
| A card payment on the operator’s page | Looks synchronous | The customer sees the outcome at once, but the confirmation you can trust is the notice the operator sends to your server. See callback URL or return URL. |
| Sending an SMS | Asynchronous | The API accepts the message and returns an identifier. Whether it was delivered or failed is only known later, from the delivery report that comes back from the network. |
| An export, a large report, a video conversion | Asynchronous | It takes time. The API returns a job identifier and tells you (or lets you ask) when it is done. |
Handling an asynchronous response
|
|
|
|
|
|
| Do not make PHP wait for the confirmation inside the visitor’s request (a loop with sleep() that keeps asking the API). Every waiting visitor ties up a process, the request runs into the maximum execution time, and the customer ends up on an error page. See PHP limits and entry processes. |
| The page that “updates by itself” is a little JavaScript that asks your server for the order status every so often (never the API directly, which would expose the key). Your server answers with what it already knows, which is whatever the callback or the scheduled task left there. |
|
Payments stay pending on your site while the operator says they are paid? Open a ticket with the time of one payment and the callback address you configured, and we will check whether the operator’s request reached the hosting. Open a support ticket |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 321,75 MT/mo (3-year plan, with coupon) See plans |











