Header Contract¶
The stack speaks MPP HTTP over three standard headers:
WWW-Authenticate: Payment ...Authorization: Payment <token>Payment-Receipt: <token>
Challenge¶
Unpaid requests receive 402 Payment Required with one or more WWW-Authenticate: Payment headers. Each challenge includes:
idrealmmethod="xrpl"intent="charge"orintent="session"request- optional
digest,expires,description, andopaque
The request value is base64url-encoded canonical JSON. For XRPL charge routes it contains:
amountcurrencyrecipientmethodDetails.networkmethodDetails.invoiceId
For session routes it contains:
amountcurrencyrecipientmethodDetails.networkmethodDetails.sessionIdmethodDetails.unitAmountmethodDetails.minPrepayAmount
In this release, fixed-price session routes require methodDetails.unitAmount to match amount.
Authorization¶
Paid retries send:
Authorization: Payment <base64url-jcs-credential>
The credential contains the selected challenge plus a method-specific payload:
charge:signedTxBlobsession open:action="open"andsignedTxBlobsession use:action="use"andsessionTokensession top_up:action="top_up",sessionToken, andsignedTxBlobsession close:action="close"andsessionToken
Receipt¶
Successful paid responses include:
Payment-Receipt: <base64url-jcs-receipt>
Receipts include common fields such as:
methodtimestampreferenceintentnetworkpayerrecipient
Charge receipts also include invoiceId, txHash, settlementStatus, asset, and amount.
Session receipts may include sessionId, sessionToken, spentTotal, availableBalance, prepaidTotal, and lastAction.