API or webhook? How to choose an integration pattern
Choose between requests, event notifications, and scheduled checks based on how quickly your workflow needs new information.
Start with the business moment
A support dashboard needs the latest order status when an agent opens it. A fulfillment team needs to know when a paid order arrives. Both workflows use the same order information, but the trigger and the expected response are different.
Write down what starts the action, who depends on it, and how long they can wait. An integration that tolerates an overnight delay can be much simpler to operate than one that must react while a customer is on the phone.
Use an API request for an answer now
An application can call an API when it needs to look up or change a record. For example, an agent can select an order and request its current delivery details without importing every order into the support platform.
Decide what the user should see when the request fails. A time-stamped last known status may be useful for reading. A change such as cancelling an order needs a clear confirmation before the interface tells the agent it went through.
Use a webhook when the source knows first
A webhook is a notification sent by another application when something happens. It can tell your system that an order was paid so the warehouse can create a packing task without checking the payment system every few minutes.
Plan for delayed and repeated notifications. Check whether the provider includes enough information to act, or whether you should fetch the current order after receiving the notification. The right choice depends on how complete and reliable the event data is.
Plan how to catch up
A scheduled check works well when fresh information is only needed at certain times, such as a daily invoice export. It can also help an event-driven flow catch records missed during a service interruption.
Choose a primary path and a way to recover. State whether recovery can safely repeat prior work, how you will identify unfinished records, and who will investigate when the source and destination disagree.