Webhook Event Object
Example Checkout Session Complete Event Object
Events notify you of noteworthy activity in your account. When an event occurs, we generate an Event object and send it to your registered webhook endpoint via a POST request.
Why use webhooks
Assuming you've set up webhook event notifications, when a customer clicks the "Pay" button on your app or website, a webhook connection between Copperx and your app informs your app of the payment's status. Specifically, when your webhook endpoint receives the checkout_session.completed
event, your webhook function can trigger backend actions, such as activating the premium plan for that particular user. Using an API for this process is similar to repeatedly calling the API every millisecond to ask if the payment was successful.
Webhook Event Statuses
checkout_session.completed
: Indicates that the user has successfully completed the checkout and payment has been processed.checkout_session.expired
: Occurs when the user fails to complete the payment within the allowed session time.checkout_session.canceled
: Triggered when the user cancels the checkout process, typically by clicking the back button or returning to the merchant's site.
Example
Here's an example of a data when Checkout Session is completed. This is one of the most useful webhook event that shows that the transaction is complete and you can activate plan for your user.
Last updated