<diagrampadding="20"><columngap="14"align="center"><textclass="title"label="Checkout, with the branches drawn"/><sequencegap="74"><actorid="ui"label="Browser"/><actorid="api"label="Checkout"/><actorid="pay"label="Payments"/><actorid="db"label="Orders"/><messagefrom="ui"to="api"label="POST /checkout"activate="true"/><framekind="loop"label="each line item"><messagefrom="api"to="db"label="reserve stock"/><messagefrom="db"to="api"label="held"dash="4 3"head="open"/></frame><framekind="alt"label="card authorised"><messagefrom="api"to="pay"label="authorise"activate="true"/><messagefrom="pay"to="api"label="approved"dash="4 3"head="open"deactivate="true"/><framekind="opt"label="saved card"><messagefrom="api"to="db"label="store token"/></frame><messagefrom="api"to="db"label="INSERT order"/><messagefrom="api"to="ui"label="201 Created"dash="4 3"head="open"/><elselabel="declined"/><noteover="api pay"label="the hold is released on the way out"/><messagefrom="api"to="ui"label="402 Payment Required"dash="4 3"head="open"deactivate="true"/></frame></sequence></column><style>
.title { font-size: 15px; font-weight: 700; fill: var(--sv-title); }
</style></diagram>