<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.43 (Ruby 3.4.9) -->
<?rfc tocindent="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-nottingham-httpbis-402-00" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.1 -->
  <front>
    <title abbrev="402 (Payment Required)">The 402 (Payment Required) HTTP Status Code</title>
    <seriesInfo name="Internet-Draft" value="draft-nottingham-httpbis-402-00"/>
    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization>Cloudflare</organization>
      <address>
        <postal>
          <postalLine>Melbourne</postalLine>
          <postalLine>Australia</postalLine>
        </postal>
        <email>mnot@mnot.net</email>
        <uri>https://mnot.net/</uri>
      </address>
    </author>
    <date year="2026" month="August" day="30"/>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 36?>

<t>This specification defines semantics for the 402 (Payment Required) HTTP status code.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-nottingham-httpbis-402/"/>.
      </t>
      <t>
         information can be found at <eref target="https://projects.mnot.net/I-D/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/mnot/I-D/labels/402"/>.</t>
    </note>
  </front>
  <middle>
    <?line 40?>

<section anchor="introduction">
      <name>Introduction</name>
      <t><xref section="15.5.3" sectionFormat="of" target="HTTP"/> says that "The 402 (Payment Required) status code is reserved for future use." To accommodate emerging experimental uses of this status code, <xref target="payment"/> defines the status code and establishes guidelines for its use.</t>
      <section anchor="notational-conventions">
        <name>Notational Conventions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
        <?line -18?>

</section>
    </section>
    <section anchor="payment">
      <name>402 Payment Required</name>
      <t>The 402 (Payment Required) status code indicates that the resource requires payment before it will satisfy the request, and that no acceptable payment has been made.</t>
      <t>This status code does not indicate the form of the payment, what it covers (e.g., one request, a period of access, or a set of resources), or whether an earlier payment was attempted and found unacceptable.</t>
      <t>Therefore, a server generating a 402 response <bcp14>SHOULD</bcp14> indicate how a payment can be made, so that clients can make a payment and retry the request. This might be done using header fields (<xref section="6.3" sectionFormat="of" target="HTTP"/>) and/or the response content (<xref section="6.4" sectionFormat="of" target="HTTP"/>).</t>
      <t>Any server can generate this status code, including an intermediary (<xref section="3.7" sectionFormat="of" target="HTTP"/>) that requires payment for forwarding the request.</t>
      <t>A 402 (Payment Required) response is not heuristically cacheable (<xref section="15.1" sectionFormat="of" target="HTTP"/>).</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA should update the Hypertext Transfer Protocol (HTTP) Status Code Registry to refer the entry for the 402 status code to this document upon publication.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>HTTP does not authenticate the sender of a response beyond what the underlying connection provides, and a 402 (Payment Required) response can be generated by an intermediary (<xref section="3.7" sectionFormat="of" target="HTTP"/>) as readily as by the origin server. An attacker who can insert or modify responses can therefore substitute their own payment information and have the payment directed to them, or can demand payment where none was required. Clients <bcp14>SHOULD NOT</bcp14> act upon payment information in a response that was not received over an authenticated connection (see <xref section="4.3.4" sectionFormat="of" target="HTTP"/>).</t>
      <t>More generally, a resource can demand an arbitrary amount for any request, and can demand payment again after one has been made; clients that pay without direct human involvement need constraints on how much, how often, and to whom they will pay.</t>
      <t>Payment requirements often depend on who is asking and what they have already paid, so 402 (Payment Required) responses might carry client-specific information -- amounts owed, transaction references, or identifiers for the payer. Servers need to prevent such responses being stored and reused for other clients by a shared cache, either by making them uncacheable or by using Vary (<xref section="12.5.5" sectionFormat="of" target="HTTP"/>); note that Vary can only be keyed on request header fields, so a requirement that depends on state not carried in the request cannot be expressed that way.</t>
      <t>Making a payment can also link a client's requests to a payment instrument, and thereby to a person, so a client that is otherwise unidentified should treat the decision to pay as one that discloses identity.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="HTTP">
        <front>
          <title>HTTP Semantics</title>
          <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
          <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
          <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
          <date month="June" year="2022"/>
          <abstract>
            <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.</t>
            <t>This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="97"/>
        <seriesInfo name="RFC" value="9110"/>
        <seriesInfo name="DOI" value="10.17487/RFC9110"/>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <?line 95?>



  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA5VX7XLbxhX9j6fY0j8qdwiKlOXEZjJJVckde8aUVEvuTCaT
ySyAS2IrYBfeXYhBNXmXPkueLOfuAiQoK3X7xwYXi/tx7rnnXqVpmnjlK1qK
25LE6fxEHF3LribtxQf61CpLxXPx9vb2Wtx46Vsnzk1BicwyS/fLP7ifFCbX
sobNwsq1T7XxXulNKeu09L7JlEvxYTqfJ4X0uHUyP/kqnb9KX8yTHAcbY7ul
cL5IEtXYpfC2df5kPn89P0nuqNsaWyzFO+3JavLpBbtIEuelLn6WldEw2JFL
XC2t//lTazy5pdAmadRS/OhNPhX4R+kCIU+FM9ZbWjs8dXX/4K3K8So3dSP7
B84Pr5SulKafkuSedEvLRIjScJoTTsstj48ba/5FuXezGjnPEN7xu/TieIKL
lhozurhRvmyzGUwf89VwrZIZVe4Y0EySJF5IlXMtpeFNQDtJZOtLY+E7hVWB
kJDdaiY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