How Lane Works

Four simple steps to enable agent commerce

Merchant hosts lane.txt
Publish manifest at /.well-known/lane.txt with payment config
Agent fetches & runs playbook
Agent reads manifest and optionally executes cart operations
Agent posts Payment Command
Single POST to Lane with payment details and quote ID
Merchant receives webhook
Lane confirms payment and sends webhook for fulfillment

Payment Flow Sequence

sequenceDiagram
    participant A as Agent
    participant M as Merchant
    participant L as Lane
    participant S as Stripe
    
    A->>M: GET /.well-known/lane.txt
    M->>A: manifest (quote_id, amount, etc)
    
    Note over A,M: Optional playbook steps
    A->>M: POST /api/cart/add
    M->>A: cart_id
    A->>M: GET /api/cart/summary
    M->>A: final_amount
    
    A->>L: POST /ai-pay (payment command)
    L->>S: tokenize card
    S->>L: payment_method_id
    L->>S: create & confirm payment_intent
    S->>L: payment succeeded
    L->>M: webhook (payment confirmation)
    L->>A: success response