Diagram Desk

ATM withdrawal sequence diagram

Customer, ATM and bank server during a withdrawal. The bank checks the PIN and balance; insufficient funds is an alt branch.

The diagram

ATMBank serverCard and PINAuthenticateResultAmountWithdrawApprovedCashDeclinedInsufficient fundsCustomeralt [Enough balance][Insufficient]
Sequence diagram · 3 shapes

Reading it step by step

  • 1. 'Customer' sends a request to 'ATM': 'Card and PIN'.
  • 2. 'ATM' sends a request to 'Bank server': 'Authenticate'.
  • 3. 'Bank server' replies to 'ATM': 'Result'.
  • 4. 'Customer' sends a request to 'ATM': 'Amount'.
  • 5. 'ATM' sends a request to 'Bank server': 'Withdraw'.
  • [alt: Enough balance]
  • 6. 'Bank server' replies to 'ATM': 'Approved'.
  • 7. 'ATM' replies to 'Customer': 'Cash'.
  • 8. 'Bank server' replies to 'ATM': 'Declined'.
  • 9. 'ATM' replies to 'Customer': 'Insufficient funds'.

Shape by shape

ShapeSymbolConnections
CustomerActor→ ATM(Card and PIN), ATM(Amount) · ← ATM, ATM
ATMParticipant and lifeline→ Bank server(Authenticate), Bank server(Withdraw), Customer(Cash), Customer(Insufficient funds) · ← Customer, Bank server, Customer, Bank server, Bank server
Bank serverParticipant and lifeline→ ATM(Result), ATM(Approved), ATM(Declined) · ← ATM, ATM

Symbols used here

SymbolMeaning
Participant and lifelineA box on top and a dashed line below.
ActorA human participant; a stick figure.
Synchronous messageA call that waits; solid line, filled head.
ReplyThe answer; dashed line, open head.
Combined fragmentloop, alt and opt boxes.

All sequence diagram symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# ATM withdrawal sequence diagram
sequenceDiagram
  actor C as Customer
  participant A as ATM
  participant B as Bank server
  C->>A: Card and PIN
  A->>B: Authenticate
  B-->>A: Result
  C->>A: Amount
  A->>B: Withdraw
  alt Enough balance
    B-->>A: Approved
    A-->>C: Cash
  else Insufficient
    B-->>A: Declined
    A-->>C: Insufficient funds
  end

More sequence diagram examples

All SeewolLabs tools