-
Notifications
You must be signed in to change notification settings - Fork 616
Open
Description
specs/transports/http.md provides the following example of a failure:
HTTP/1.1 402 Payment Required
Content-Type: application/json
X-PAYMENT-RESPONSE: eyJzdWNjZXNzIjpmYWxzZSwiZXJyb3JSZWFzb24iOiJpbnN1ZmZpY2llbnRfZnVuZHMiLCJ0cmFuc2FjdGlvbiI6IiIsIm5ldHdvcmsiOiJiYXNlLXNlcG9saWEiLCJwYXllciI6IjB4ODU3YjA2NTE5RTkxZTNBNTQ1Mzg3OTFiRGJiMEUyMjM3M2UzNmI2NiJ9
{
"x402Version": 1,
"error": "Payment failed: insufficient funds",
"accepts": [...]
}According to the specification, the status line should be:
HTTP/1.1 402 Payment Failed
and not:
HTTP/1.1 402 Payment Required
Therefore, the corrected example should be
HTTP/1.1 402 Payment Failed
Content-Type: application/json
X-PAYMENT-RESPONSE: eyJzdWNjZXNzIjpmYWxzZSwiZXJyb3JSZWFzb24iOiJpbnN1ZmZpY2llbnRfZnVuZHMiLCJ0cmFuc2FjdGlvbiI6IiIsIm5ldHdvcmsiOiJiYXNlLXNlcG9saWEiLCJwYXllciI6IjB4ODU3YjA2NTE5RTkxZTNBNTQ1Mzg3OTFiRGJiMEUyMjM3M2UzNmI2NiJ9
{
"x402Version": 1,
"error": "Payment failed: insufficient funds",
"accepts": [...]
}Metadata
Metadata
Assignees
Labels
No labels