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
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
| Shape | Symbol | Connections |
|---|---|---|
| Customer | Actor | → ATM(Card and PIN), ATM(Amount) · ← ATM, ATM |
| ATM | Participant and lifeline | → Bank server(Authenticate), Bank server(Withdraw), Customer(Cash), Customer(Insufficient funds) · ← Customer, Bank server, Customer, Bank server, Bank server |
| Bank server | Participant and lifeline | → ATM(Result), ATM(Approved), ATM(Declined) · ← ATM, ATM |
Symbols used here
| Symbol | Meaning |
|---|---|
| Participant and lifeline | A box on top and a dashed line below. |
| Actor | A human participant; a stick figure. |
| Synchronous message | A call that waits; solid line, filled head. |
| Reply | The answer; dashed line, open head. |
| Combined fragment | loop, alt and opt boxes. |
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