Checkout with a Payment Provider
A sequence diagram of checkout: the client confirms an order, the API calls the payment provider, and a webhook confirms payment.
Opens in the editor. No signup. Export SVG, PNG, or an embed link.
title: Checkout with a Payment Provider
theme: minimal
type: sequence
participant client "Client"
participant api "API"
participant psp "Payment provider"
client -> api : "confirm order"
api -> psp : "create payment"
psp --> api : "payment id"
api --> client : "redirect to pay"
psp -> api : "webhook: paid"
api --> psp : "200 OK"About this template
A sequence diagram of checkout with a payment provider. The client confirms an order, the API creates a payment, and the client is redirected to pay. Later, the provider calls the API with a "paid" webhook, and the API acknowledges it with 200 OK.
The key point is that the order is confirmed by the webhook, not by the browser redirect. Users can close the tab before returning, but the webhook still arrives.
Rename "Payment provider" to the provider you use, and add steps such as marking the order as paid or sending a receipt email if your flow has them.