> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veroreceipts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sequence Diagram

> The full flow of Vero, from payment intent, to viewing the receipt in your card issuer app.

## Flow Diagram

```mermaid theme={null}
sequenceDiagram
    participant User as User
    participant Issuer as Card Issuer App
    participant Vero as Vero API
    participant POS as Merchant POS
    participant Gateway as Payment Gateway

    Note over User,Gateway: Onboarding (One-time)
    User->>Issuer: Enable Vero
    Issuer->>Vero: POST /onboarding/generate-keys
    Vero-->>Issuer: keyId, publicKey, privateKey
    Issuer->>Issuer: Store privateKey securely
    Issuer->>Vero: POST /onboarding/register
    Vero-->>Issuer: userId

    Note over User,Gateway: Purchase
    User->>POS: Tap card
    POS->>Vero: POST /payments/{gateway}/create
    Vero->>Vero: Encrypt receipt
    Vero->>Gateway: Create payment
    Gateway-->>Vero: paymentId
    Vero-->>POS: paymentId

    Note over User,Gateway: View Receipt
    User->>Issuer: Tap "View Receipt"
    Issuer->>User: Biometric/PIN
    User->>Issuer: Consent
    Issuer->>Vero: POST /keys/grant-access
    Vero-->>Issuer: accessToken
    Issuer->>Vero: POST /payments/decrypt
    Vero-->>Issuer: Decrypted receipt
    Issuer-->>User: Display receipt
```
