Payment flow
This is the canonical flow we use across all platforms. It’s the same x402 flow but wrapped by Gx402 middleware patterns so every client behaves the same.1) Create (client → backend)
- Client requests
POST /create-paymentwith{ itemId, amount, userAddress, metadata }. - Server creates a
paymentSessionand builds a deterministic payload (paymentId, amount, timestamp, chainId, optional nonce). - Server may optionally call x402’s create endpoint to register the session — not required if you only need a client-sign flow.
