flowlensgram / Beta

PLANTUML EXAMPLE / CHECKOUT

Checkout sequence diagram: payment success and failure.

An order needs more than a successful payment. This example shows how a storefront, Order API, payments service and warehouse coordinate an inventory reservation—and release it when payment is declined.

Open, explore and edit without an account. This prepared example uses no AI credits.

The complete checkout flow.

The customer places an order through the storefront. The Order API checks availability and reserves inventory before creating a payment. The alt fragment describes two possible outcomes.

Checkout sequence diagram: reserve inventory, create payment, confirm the reservation on success or release it on payment decline.
The same PlantUML source is included below and opens in the editor. This is a simplified example for discussion, not a complete payment-system design.

Follow both outcomes.

Payment succeeds

The payments service reports payment.succeeded. The Order API confirms the warehouse reservation and returns an order confirmation to the storefront. The customer sees a thank-you message.

Payment is declined

The payments service reports payment.failed. The Order API releases the reservation and asks the storefront to offer a payment retry. The diagram does not yet model what happens during that retry.

The PlantUML source.

group collects the reservation steps. alt and else separate payment outcomes. You can copy this source or download it as a .puml file.

@startuml
autonumber
actor "Customer" as User
participant "Storefront" as Web
participant "Order API" as API
participant "Payments" as Pay
participant "Warehouse" as Stock
User -> Web : Place order
Web -> API : POST /orders
API -> Stock : Check availability
Stock --> API : Items available
group Inventory reservation
API -> Stock : Reserve items
Stock --> API : reservation_id
end
API -> Pay : Create payment
alt Payment succeeded
Pay --> API : payment.succeeded
API -> Stock : Confirm reservation
API --> Web : Order confirmed
Web --> User : Thank you for your order!
else Payment declined
Pay --> API : payment.failed
API -> Stock : Release reservation
API --> Web : Offer payment retry
end
@enduml

Use the example in a review.

  1. Open the example. Locate Create payment in the diagram and follow it to the source.
  2. Collapse the inventory reservation group. Discuss the payment outcomes without hiding the original source.
  3. Focus on Order API. Trace its interactions with payments and the warehouse.
  4. Expand the details again. Add the missing decisions to your own copy and export the updated source.

Questions this diagram leaves open.

  • What should happen if inventory is unavailable or a reservation expires?
  • What happens if the payment result arrives late or the same event arrives twice?
  • Can a reservation be released twice, and how is that operation made safe?
  • Does a payment retry reuse the order and reservation, or create new ones?

These are review questions, not implemented guarantees. Add the branches your actual system needs.

Try the flow in the editor.

Explore the prepared diagram, edit the source and export your version.

Cookies & privacy

Privacy preferences

This visit uses local mode without product analytics.

We are not requesting permission to collect analytics now. You can save a refusal or withdraw an earlier permission here.

Necessary data

Required for features

Account sign-in and privacy choices, and locally saved diagrams. Used as you interact with the corresponding features.

What stays in your browser

Rejecting analytics does not delete diagrams or sign you out. You can remove local diagrams in the library. The policy lists storage entries and their durations.

Cookies, local data and durations

Usage analytics

Off

With your permission, usage events are sent to PostHog (EU) to help improve the site.

Data, provider and retention

We collect allowlisted editor, sign-in, plan and AI interactions; fixed page categories; page duration; and only utm_source, utm_medium and utm_campaign labels restricted to 64 letters, digits, hyphens or underscores. Do not put personal data in campaign labels. We discard full URLs, other query parameters, referrers, advertising click IDs, original IP addresses and user agents. After consent, this tab stores a random visit identifier and the first valid campaign labels in sessionStorage. A visit expires after 30 minutes without a tracked event or 24 hours at most. Events pass through our server to PostHog EU under a random identifier separate from your account, with a minimal technical profile for deletion. No account linking, device fingerprinting, automatic click collection or session replay. Your choice lasts 180 days on this browser and origin. Withdrawal immediately stops new events, clears visit/campaign storage and requests deletion of linked history; queued is not confirmed erasure. Necessary sign-in and local diagrams continue to work. Earlier identifiers may remain only to complete deletion.

Privacy policy

Your choice lasts 180 days in this browser. You can change it in Cookies & privacy.

Turning analytics off immediately stops new events and requests deletion of linked history. Your diagrams are kept.

IP Geolocation by DB-IP