[{"data":1,"prerenderedAt":110},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fpayments":3},{"id":4,"title":5,"body":6,"description":100,"extension":101,"icon":102,"meta":103,"navigation":104,"order":105,"path":106,"seo":107,"stem":108,"__hash__":109},"docs\u002Fdocs\u002Fpayments.md","x402 payments",{"type":7,"value":8,"toc":91},"minimark",[9,14,23,42,46,53,57,60,63,67,70,74],[10,11,13],"h2",{"id":12},"the-payment-flow","The payment flow",[15,16,17,18,22],"p",{},"The API uses the HTTP ",[19,20,21],"code",{},"402 Payment Required"," status as a negotiation mechanism:",[24,25,26,30,33,36,39],"ol",{},[27,28,29],"li",{},"Your client sends the intended request without payment proof.",[27,31,32],{},"The server returns acceptable payment requirements, including asset, amount, network, and payee.",[27,34,35],{},"The client checks the requirement against its policy and signs a payment authorization.",[27,37,38],{},"It retries the same request with the payment payload.",[27,40,41],{},"The server verifies and settles the payment before returning the resource.",[10,43,45],{"id":44},"set-a-maximum-payment","Set a maximum payment",[15,47,48,49,52],{},"Treat payment requirements as untrusted input. A production client should compare the challenge\nagainst ",[19,50,51],{},"\u002Fv1\u002Fpricing",", enforce a hard maximum amount, allow only expected networks and assets, and\nverify the payee.",[10,54,56],{"id":55},"safe-retries","Safe retries",[15,58,59],{},"Network failures can occur after a payment is accepted but before the response reaches your client.\nx402labs supports payment identifiers so a compatible retry can replay the cached response\ninstead of charging twice.",[15,61,62],{},"Preserve your client's payment identifier across a retry. Do not create a new payment authorization\nuntil you know the original attempt cannot be recovered.",[10,64,66],{"id":65},"keep-keys-out-of-the-browser","Keep keys out of the browser",[15,68,69],{},"This documentation site never asks for or stores wallet secrets. Run paid calls from a trusted agent,\nbackend, CLI, or wallet-aware runtime. A browser playground is intentionally not included.",[10,71,73],{"id":72},"public-metadata","Public metadata",[75,76,77,82,88],"ul",{},[27,78,79,81],{},[19,80,51],{}," exposes current route prices and networks.",[27,83,84,87],{},[19,85,86],{},"\u002Fopenapi.json"," exposes request and response contracts.",[27,89,90],{},"x402 Bazaar metadata lets compatible discovery systems index paid resources.",{"title":92,"searchDepth":93,"depth":93,"links":94},"",2,[95,96,97,98,99],{"id":12,"depth":93,"text":13},{"id":44,"depth":93,"text":45},{"id":55,"depth":93,"text":56},{"id":65,"depth":93,"text":66},{"id":72,"depth":93,"text":73},"Learn the challenge, signing, settlement, and safe retry flow used by paid routes.","md","lucide:wallet-cards",{},true,3,"\u002Fdocs\u002Fpayments",{"title":5,"description":100},"docs\u002Fpayments","okoMDad86fNMPmsDQB59Eagbdvur-51tWtoc7mjQhgk",1787093955739]