\documentclass[fleqn]{article}
\usepackage{amsmath}
\usepackage{multimedia}
\usepackage[utf8]{inputenc}
\usepackage{framed,color,ragged2e}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor}
\usepackage{relsize}
\usepackage{graphicx}
\usepackage{tikz,eurosym,calc}
\usetikzlibrary{tikzmark}
\usetikzlibrary{shapes,arrows,arrows.meta}
\usetikzlibrary{positioning,fit,patterns}
\usetikzlibrary{calc}
\usepackage{pgf-umlsd}
\usepackage{relsize}

\pagestyle{empty}
\begin{document}

\begin{sequencediagram}
    \newinst{customer}{Customer}
    \newinst[4]{ex}{Exchange}
    \newinst[4]{kyc}{KYC Provider}
    \postlevel
    \mess[0]{customer}{POST: payment request}{ex}
    \mess[0]{ex}{POST: initiate KYC}{kyc}
    \mess[0]{kyc}{KYC-Start-URL}{ex}
    \mess[0]{ex}{KYC-Start-URL}{customer}
    \postlevel
    \mess[0]{customer}{GET: KYC-Start-URL}{kyc}
    \mess[0]{kyc}{KYC Web Form}{customer}
    \mess[0]{customer}{POST: KYC data}{kyc}
    \mess[0]{kyc}{redirect URL or pending}{customer}
    \postlevel
    \begin{sdblock}{alternative}{}
    \mess[0]{customer}{GET: redirect URL}{ex}
    \mess[0]{ex}{Thanks!}{customer}
    \end{sdblock}
    \prelevel
    \prelevel
    \prelevel
    \prelevel
    \prelevel
    \begin{sdblock}{alternative}{}
      \mess[0]{kyc}{Async validation finished Webhook}{ex}
      \mess[0]{ex}{Thanks!}{kyc}
    \end{sdblock}
    \postlevel
    \mess[0]{ex}{GET: KYC status?}{kyc}
    \mess[0]{kyc}{KYC data}{ex}
    \mess[0]{customer}{POST: payment request}{ex}
    \mess[0]{ex}{normal response}{customer}
\end{sequencediagram}

\end{document}

    
