Authorization payment flow¶
- The client requests a protected resource.
- The server returns HTTP 402 with
PAYMENT-REQUIRED. - The client selects an allowed requirement, signs one exact XRPL Payment, and
retries once with
PAYMENT-SIGNATUREif the body is replayable. - The resource server asks the facilitator to verify the payload.
- If valid, the protected handler runs. Its complete response is buffered.
- Only a successful 2xx/3xx handler response is submitted for settlement.
- The facilitator reserves the transaction hash, submits once, and waits for a validated ledger result.
- The server releases the buffered response with
PAYMENT-RESPONSEonly after settlement succeeds.
Invalid payments never run the handler. Handler errors and 4xx/5xx responses are never settled. Pending settlement retries reuse the same envelope; an unsafe handler is recovered from Redis rather than executed twice.