# MPP-CoDi demo API > Paid HTTP API using the Machine Payments Protocol (HTTP 402) with method="codi": Mexican CoDi payments through pey. A human approves each CoDi payment in their bank app. ## Endpoints - GET https://pey-mpp.exe.xyz/api/taco?antojo=... : AI taco recipe. charge $1.00 MXN (or session $1.00 MXN/call) - GET https://pey-mpp.exe.xyz/api/tipo-de-cambio : USD/MXN demo quote. session $0.10 MXN/call, deposit $5.00 MXN - POST https://pey-mpp.exe.xyz/api/corrido {"nombre","hazana"} : personalized corrido. charge $2.00 MXN - POST https://pey-mpp.exe.xyz/mcp : the same tools over MCP (-32042 challenges, _meta org.paymentauth/credential) - GET https://pey-mpp.exe.xyz/openapi.json : discovery (x-payment-info) ## How to pay (method="codi") 1. Call an endpoint. You get 402 + WWW-Authenticate: Payment method="codi" intent="charge"|"session" request=. 2. Decode request: amount (centavos), currency "mxn", methodDetails.qrPayload (render it as a QR for a human), methodDetails.qrId. Send header Codi-Phone: <10 digits> to also get a push request on the payer's phone. 3. Retry with Authorization: Payment , "payload": {"qrId": "..."}})> every 3 s. While the human hasn't approved you get 402 payment-action-required with the same challenge and Retry-After. 4. 200 + Payment-Receipt (base64url JSON): reference = pey transaction id, trackingKey = Banxico clave de rastreo. Session: payload {"action":"open","sessionId":hex(sha256(secret)),"qrId"} once, then {"action":"bearer","sessionId","secret"} per call; on 402 session/insufficient-balance pay the new QR and send {"action":"topUp","sessionId","qrId"}. CoDi through pey can't refund: unspent balance is not returned.