Skip to main content

HTTP 402: Payment Required

Early Draft

This specification is at an early draft stage. Ideas are open for change and debate. A lot of the content was developed with the help of Claude AI.

HTTP 402: Payment Required

Concept

HTTP 402 was defined in RFC 2616 (1999) as a reserved status code for future payment systems, but was never standardized. Vera uses it to trigger a native browser payment dialog, a clean, JavaScript-free alternative to overlay paywalls.

Response Format

HTTP/1.1 402 Payment Required
Content-Type: text/html; charset=utf-8

X-Vera-Access: {"model":"choice","options":[...]}

<!-- Article teaser as preview -->
<html>...</html>

The Vera browser intercepts the 402 before rendering and shows a native payment dialog based on the X-Vera-Access header. Standard browsers receive the teaser HTML normally.

X-Vera-Access Header

{
"model": "ppr",
"publisher": "some-publisher.news",
"article_id": "federal-election-2025",
"options": [
{
"type": "ppr",
"price": 0.49,
"currency": "EUR",
"label": "Buy this article"
},
{
"type": "subscription",
"key": "spiegel",
"label": "Subscribe to Some Publisher+"
},
{
"type": "ad_supported",
"label": "Read with ads"
}
]
}

Access Models (Vera Browser)

ppr: Pay per Read

{"model": "ppr", "publisher": "handelsblatt.com",
"options": [{"type": "ppr", "price": 0.49, "currency": "EUR"}]}

Browser behavior: Native dialog showing price and Vera wallet balance. One-tap purchase. Automatic request retry with updated token.

subscription: Subscription required

{"model": "subscription", "publisher": "some-publisher.news",
"options": [{"type": "subscription", "key": "spiegel"}]}

choice: Subscription OR Pay per Read OR ads

{
"model": "choice",
"publisher": "other-publisher.news",
"options": [
{"type": "ppr", "price": 0.99, "currency": "EUR"},
{"type": "subscription", "key": "zeit"},
{"type": "ad_supported"}
]
}

vera_exclusive: Vera users only

{"model": "vera_exclusive", "publisher": "some-publisher.news",
"message": "This content is exclusively available to Vera users."}

Standard browsers receive a separate 403 response or redirect.

Browser-Side 402 Flow

User clicks link
|
v
Vera sends request (with X-Vera-Token if logged in)
|
v
Server responds 402 + X-Vera-Access
|
v
Vera intercepts response before rendering
|
v
Vera renders native payment dialog
(in browser chrome, no JavaScript access possible)
|
v
User selects action
|
+-- PPR chosen -> wallet debit -> token refresh -> retry -> 200
+-- Sub chosen -> subscription flow -> token refresh -> retry -> 200
+-- Cancelled -> stay on teaser