{"openapi":"3.1.0","info":{"title":"PayAI Hosted Checkout API","version":"2026-10-15","summary":"Stripe Checkout for stablecoins, with x402 for AI agents.","description":"Create a checkout session, send the buyer its `url`, and get paid in USDC, USDT or USDG.\nPeople pay on the hosted page. AI agents pay the same url with x402 (HTTP 402).\nThe money goes straight to the merchant payout wallet. PayAI never holds funds.\n\nAll amounts are integers in USD cents. Request bodies can be JSON or Stripe form encoding.\nLive keys (`payai_ck_live_`) use mainnets. Test keys (`payai_ck_test_`) use testnets.\nAgent docs: https://staging.checkout.payai.network/llms.txt. MCP server: https://staging.checkout.payai.network/mcp."},"externalDocs":{"description":"Developer docs","url":"https://staging.checkout.payai.network/docs"},"servers":[{"url":"https://staging.checkout.payai.network"}],"security":[{"bearerAuth":[]},{"basicAuth":[]}],"tags":[{"name":"Checkout Sessions","description":"Payment links. One session is one payment."},{"name":"Payments","description":"Succeeded payments (PayAI extension)."},{"name":"Webhook Endpoints","description":"Where PayAI sends events."},{"name":"Keys","description":"Agent sign-up."},{"name":"x402","description":"The session url for buyer agents."}],"paths":{"/v1/checkout/sessions":{"post":{"operationId":"CreateCheckoutSession","tags":["Checkout Sessions"],"summary":"Create a checkout session","description":"Creates a payment link. Send the `url` in the response to the buyer. With an `Idempotency-Key`, a retry with the same body returns the first session.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionCreateParams"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CheckoutSessionCreateParams"}}}},"responses":{"200":{"description":"The new checkout session.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}},"get":{"operationId":"ListCheckoutSessions","tags":["Checkout Sessions"],"summary":"List checkout sessions","description":"Newest first. Use `starting_after` with the last id for the next page.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartingAfter"},{"$ref":"#/components/parameters/EndingBefore"},{"name":"status","in":"query","description":"Only sessions with this status.","schema":{"type":"string","enum":["open","complete","expired"]}}],"responses":{"200":{"description":"A page of checkout sessions.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/checkout/sessions/{id}":{"get":{"operationId":"RetrieveCheckoutSession","tags":["Checkout Sessions"],"summary":"Get a checkout session","parameters":[{"$ref":"#/components/parameters/SessionId"},{"name":"expand[]","in":"query","description":"Send `line_items` to include the line items.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string","enum":["line_items"]}}}],"responses":{"200":{"description":"The checkout session.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/checkout/sessions/{id}/expire":{"post":{"operationId":"ExpireCheckoutSession","tags":["Checkout Sessions"],"summary":"Expire a checkout session","description":"Only `open` sessions can be expired. Nobody can pay the session after this. Sends `checkout.session.expired`.","parameters":[{"$ref":"#/components/parameters/SessionId"}],"responses":{"200":{"description":"The expired checkout session.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/checkout/sessions/{id}/line_items":{"get":{"operationId":"ListCheckoutSessionLineItems","tags":["Checkout Sessions"],"summary":"List the line items of a checkout session","description":"A session has at most 100 items, so the list is one page.","parameters":[{"$ref":"#/components/parameters/SessionId"}],"responses":{"200":{"description":"The line items.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineItemList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/payments":{"get":{"operationId":"ListPayments","tags":["Payments"],"summary":"List succeeded payments","description":"PayAI extension. Newest first.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartingAfter"}],"responses":{"200":{"description":"A page of payments.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhook_endpoints":{"post":{"operationId":"CreateWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Create a webhook endpoint","description":"The response has the signing `secret` (whsec_...). Store it. No other response shows it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateParams"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateParams"}}}},"responses":{"200":{"description":"The new endpoint, with its secret.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}},"get":{"operationId":"ListWebhookEndpoints","tags":["Webhook Endpoints"],"summary":"List webhook endpoints","responses":{"200":{"description":"All endpoints of this mode.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhook_endpoints/{id}":{"get":{"operationId":"RetrieveWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Get a webhook endpoint","parameters":[{"$ref":"#/components/parameters/WebhookEndpointId"}],"responses":{"200":{"description":"The endpoint.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}},"delete":{"operationId":"DeleteWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Delete a webhook endpoint","description":"Also drops its pending deliveries.","parameters":[{"$ref":"#/components/parameters/WebhookEndpointId"}],"responses":{"200":{"description":"The endpoint is deleted.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedWebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/keys":{"post":{"operationId":"CreateApiKey","tags":["Keys"],"summary":"Agent sign-up: get a checkout key","description":"Exchanges a JWT signed with a PayAI facilitator key (`payai_sk_...`) for a checkout key on the same PayAI account. Get a facilitator key in the merchant portal or from its x402 vend endpoint. JWT format: https://docs.payai.network/x402/facilitators/authentication Each account can create 10 keys per hour.","security":[{"facilitatorJwt":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateParams"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateParams"}}}},"responses":{"200":{"description":"The new key. `secret` is shown only here.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/c/{id}":{"get":{"operationId":"PayCheckoutSession","tags":["x402"],"summary":"The session url (hosted page and x402)","description":"A browser page load (`Accept: text/html`) gets the hosted payment page. Any other request gets x402 v2: without a payment header, HTTP 402 with `PAYMENT-REQUIRED`. Sign one entry of `accepts` and repeat the request with `PAYMENT-SIGNATURE` (or `X-PAYMENT`). POST works the same way. No API key is necessary. The facilitator pays the gas. CORS is allowed for browser-based agents.","security":[],"parameters":[{"name":"id","in":"path","required":true,"description":"The checkout session id.","schema":{"type":"string"}},{"name":"PAYMENT-SIGNATURE","in":"header","description":"Base64 JSON of an x402 v2 PaymentPayload for one entry of `accepts`.","schema":{"type":"string"}},{"name":"X-PAYMENT","in":"header","description":"Same as PAYMENT-SIGNATURE (x402 v1 header name).","schema":{"type":"string"}}],"responses":{"200":{"description":"Paid. The JSON receipt; or, for `Accept: text/html`, the hosted page.","headers":{"PAYMENT-RESPONSE":{"description":"Base64 JSON of SettlementResponse.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Receipt"}},"text/html":{"schema":{"type":"string"}}}},"202":{"description":"The network has not confirmed the payment yet. Send GET without a payment header until the answer is 200.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Processing"}}}},"400":{"description":"The payment header is not an x402 payment payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerError"}}}},"402":{"description":"Payment required, or the signed payment failed (then `error` and `code` give the reason). No money moved.","headers":{"PAYMENT-REQUIRED":{"description":"Base64 JSON of PaymentRequired (the same as the body).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"404":{"description":"No session has this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerError"}}}},"409":{"description":"Another payment for this session is in progress, the session is already paid, or the signature was used before.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/X402Processing"},{"$ref":"#/components/schemas/BuyerError"}]}}}},"410":{"description":"The session expired. Ask the merchant for a new link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerError"}}}},"429":{"description":"Too many requests from this IP address.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerError"}}}},"503":{"description":"The checkout cannot take payments now, or the payment service is busy. No money moved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerError"}}}}}}}},"webhooks":{"checkout.session.completed":{"post":{"operationId":"CheckoutSessionCompletedEvent","summary":"A session was paid","description":"Verify `PayAI-Signature` before you trust the body. Answer 2xx within 10 seconds. PayAI retries failed deliveries for about 3 days.","parameters":[{"name":"PayAI-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the whsec_ secret>`. Stripe format.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Received. Any 2xx status stops the retries."}}}},"checkout.session.expired":{"post":{"operationId":"CheckoutSessionExpiredEvent","summary":"A session expired","description":"Verify `PayAI-Signature` before you trust the body. Answer 2xx within 10 seconds. PayAI retries failed deliveries for about 3 days.","parameters":[{"name":"PayAI-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the whsec_ secret>`. Stripe format.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Received. Any 2xx status stops the retries."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A checkout key: `payai_ck_live_...` or `payai_ck_test_...`."},"basicAuth":{"type":"http","scheme":"basic","description":"The checkout key as the user name and an empty password (curl `-u payai_ck_...:`)."},"facilitatorJwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"A short EdDSA JWT signed with a PayAI facilitator key (kid = key id, iss \"payai-merchant\"). See https://docs.payai.network/x402/facilitators/authentication."}},"parameters":{"SessionId":{"name":"id","in":"path","required":true,"description":"The checkout session id (cs_live_... or cs_test_...).","schema":{"type":"string"}},"WebhookEndpointId":{"name":"id","in":"path","required":true,"description":"The webhook endpoint id (we_...).","schema":{"type":"string"}},"Limit":{"name":"limit","in":"query","description":"Number of results, 1 to 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},"StartingAfter":{"name":"starting_after","in":"query","description":"The id of the last object of the previous page. Returns older objects.","schema":{"type":"string"}},"EndingBefore":{"name":"ending_before","in":"query","description":"The id of the first object of the previous page. Returns newer objects. Do not send it with starting_after.","schema":{"type":"string"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","description":"A unique key, up to 255 characters. A retry with the same key and body returns the first result.","schema":{"type":"string","maxLength":255}}},"headers":{"RequestId":{"description":"The id of this request. Give it to support.","schema":{"type":"string"}},"RetryAfter":{"description":"Seconds to wait before you try again.","schema":{"type":"integer"}}},"responses":{"BadRequest":{"description":"A parameter is missing or not valid.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"The key is missing, not valid or revoked.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No object has this id in this mode.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Too many requests. Wait and try again.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"A problem on our side. Try again.","headers":{"Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message"],"properties":{"type":{"type":"string","description":"invalid_request_error, authentication_error, idempotency_error or api_error.","examples":["invalid_request_error"]},"code":{"type":"string","examples":["parameter_missing"]},"message":{"type":"string","description":"A sentence that says what to change."},"param":{"type":"string","description":"The parameter at fault, in Stripe notation.","examples":["line_items[0][price_data][unit_amount]"]},"doc_url":{"type":"string","format":"uri"},"request_id":{"type":"string","examples":["req_8Hx2k9QmZr4aP1sT"]}}}}},"BuyerError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"type":{"type":"string"},"code":{"type":"string","examples":["session_expired","payment_processing","resource_missing"]},"message":{"type":"string"}}}}},"CheckoutSessionCreateParams":{"type":"object","required":["line_items"],"properties":{"mode":{"type":"string","enum":["payment"],"default":"payment"},"line_items":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/LineItemParams"}},"success_url":{"type":"string","format":"uri","maxLength":5000,"description":"The page for the buyer after payment. `{CHECKOUT_SESSION_ID}` becomes the session id."},"cancel_url":{"type":"string","format":"uri","maxLength":5000,"description":"The page for a buyer who cancels."},"client_reference_id":{"type":"string","maxLength":200,"description":"Your own order id."},"customer_email":{"type":"string","format":"email","maxLength":254},"metadata":{"type":"object","maxProperties":50,"propertyNames":{"maxLength":40},"additionalProperties":{"type":"string","maxLength":500},"description":"Your key-value pairs. The buyer does not see them. An empty value removes the key."},"expires_at":{"type":"integer","description":"Unix time in seconds, 30 minutes to 24 hours from now. Default: 24 hours from now."},"payment_method_types":{"type":"array","items":{"type":"string","enum":["crypto"]}},"expand":{"type":"array","items":{"type":"string","enum":["line_items"]}}}},"LineItemParams":{"type":"object","required":["price_data"],"properties":{"price_data":{"type":"object","required":["product_data"],"description":"Send unit_amount or unit_amount_decimal.","properties":{"currency":{"type":"string","enum":["usd"],"default":"usd"},"unit_amount":{"type":"integer","minimum":0,"maximum":99999999,"description":"Price of one unit in USD cents. 2500 is $25.00."},"unit_amount_decimal":{"type":"string","pattern":"^\\d+$","description":"The same as unit_amount, as a string of whole cents."},"product_data":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":250},"description":{"type":"string","maxLength":500},"images":{"type":"array","maxItems":8,"items":{"type":"string","format":"uri","description":"An https URL."}}}}}},"quantity":{"type":"integer","minimum":1,"maximum":999999,"default":1}}},"CheckoutSession":{"type":"object","required":["id","object","amount_total","currency","status","payment_status","url","livemode"],"properties":{"id":{"type":"string","examples":["cs_live_a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6"]},"object":{"const":"checkout.session"},"amount_subtotal":{"type":"integer","description":"USD cents."},"amount_total":{"type":"integer","description":"USD cents. The buyer pays this many cents in tokens."},"cancel_url":{"type":["string","null"]},"client_reference_id":{"type":["string","null"]},"created":{"type":"integer","description":"Unix time in seconds."},"currency":{"const":"usd"},"customer_email":{"type":["string","null"]},"expires_at":{"type":"integer","description":"Unix time in seconds."},"livemode":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"mode":{"const":"payment"},"payment_method_types":{"type":"array","items":{"const":"crypto"}},"payment_status":{"type":"string","enum":["unpaid","paid"]},"status":{"type":"string","enum":["open","processing","complete","expired"],"description":"open: waiting for payment. processing: the network is confirming a payment. complete: paid. expired: nobody can pay it."},"success_url":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri","description":"Send this to the buyer. People open it in a browser; agents pay it with x402. Null when complete or expired."},"payment":{"oneOf":[{"$ref":"#/components/schemas/Payment"},{"type":"null"}],"description":"PayAI extension. The succeeded payment, when paid."},"line_items":{"$ref":"#/components/schemas/LineItemList","description":"Only with expand[]=line_items."}}},"LineItem":{"type":"object","properties":{"id":{"type":"string","examples":["li_0b8a4c6e000040008000000000000001"]},"object":{"const":"item"},"amount_subtotal":{"type":"integer","description":"USD cents."},"amount_total":{"type":"integer","description":"USD cents."},"currency":{"const":"usd"},"description":{"type":"string","description":"The product name."},"quantity":{"type":"integer"},"price":{"type":"object","properties":{"object":{"const":"price"},"currency":{"const":"usd"},"unit_amount":{"type":"integer","description":"USD cents."},"product_data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"images":{"type":"array","items":{"type":"string"}}}}}}}},"Payment":{"type":"object","properties":{"id":{"type":"string","examples":["pay_0b8a4c6e000040008000000000000001"]},"object":{"const":"payment"},"status":{"type":"string","enum":["succeeded","processing","failed"]},"amount":{"type":"integer","description":"USD cents."},"currency":{"const":"usd"},"token":{"type":"string","enum":["USDC","USDT","USDG"]},"token_amount":{"type":"string","description":"The amount in the token's smallest unit."},"token_decimals":{"type":"integer","examples":[6]},"network":{"type":"string","description":"CAIP-2 network id.","examples":["eip155:8453"]},"network_name":{"type":"string","examples":["Base"]},"payer":{"type":["string","null"],"description":"The buyer wallet."},"pay_to":{"type":"string","description":"The merchant payout wallet."},"channel":{"type":"string","enum":["page","x402"],"description":"page: the hosted page. x402: an agent."},"transaction":{"type":["string","null"],"description":"The transaction hash or signature."},"transaction_url":{"type":["string","null"],"format":"uri","description":"A block explorer link."},"created":{"type":"integer"},"settled_at":{"type":["integer","null"]},"livemode":{"type":"boolean"},"checkout_session":{"type":"string","description":"The session id. Only in GET /v1/payments."}}},"WebhookEndpointCreateParams":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"A public URL. Live mode needs https. Test mode also allows http."},"enabled_events":{"type":"array","items":{"type":"string","enum":["checkout.session.completed","checkout.session.expired","*"]},"description":"Default: [\"*\"] (all events)."},"description":{"type":"string","maxLength":500}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","examples":["we_3kTq9ZxP0aB7cD2eF4gH6iJ8"]},"object":{"const":"webhook_endpoint"},"url":{"type":"string","format":"uri"},"enabled_events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["enabled","disabled"]},"livemode":{"type":"boolean"},"description":{"type":["string","null"]},"created":{"type":"integer"},"secret":{"type":"string","description":"The whsec_ signing secret. Only in the create response."}}},"DeletedWebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"webhook_endpoint"},"deleted":{"const":true}}},"Event":{"type":"object","required":["id","object","api_version","created","livemode","type","data"],"properties":{"id":{"type":"string","examples":["evt_9xQ2mT7kLp3RzW8vB1nC4dF6"],"description":"Use it to skip duplicate deliveries."},"object":{"const":"event"},"api_version":{"const":"2026-10-15"},"created":{"type":"integer"},"livemode":{"type":"boolean"},"type":{"type":"string","enum":["checkout.session.completed","checkout.session.expired"]},"data":{"type":"object","required":["object"],"properties":{"object":{"$ref":"#/components/schemas/CheckoutSession"}}}}},"ApiKeyCreateParams":{"type":"object","properties":{"livemode":{"type":"boolean","default":true,"description":"false makes a test key."},"name":{"type":"string","maxLength":100,"default":"Agent key"}}},"ApiKey":{"type":"object","required":["object","id","secret","livemode"],"properties":{"object":{"const":"api_key"},"id":{"type":"string"},"name":{"type":"string"},"livemode":{"type":"boolean"},"secret":{"type":"string","description":"payai_ck_live_... or payai_ck_test_.... Shown only here."},"payout_wallets":{"type":"object","description":"Where payments go. Null means no wallet for that family yet.","properties":{"evm":{"type":["string","null"]},"solana":{"type":["string","null"]}}},"created":{"type":"integer"}}},"CheckoutSessionList":{"type":"object","required":["object","url","has_more","data"],"properties":{"object":{"const":"list"},"url":{"type":"string","examples":["/v1/checkout/sessions"]},"has_more":{"type":"boolean","description":"True when there are more results after this page."},"data":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSession"}}}},"LineItemList":{"type":"object","required":["object","url","has_more","data"],"properties":{"object":{"const":"list"},"url":{"type":"string","examples":["/v1/checkout/sessions/{id}/line_items"]},"has_more":{"type":"boolean","description":"True when there are more results after this page."},"data":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}}}},"PaymentList":{"type":"object","required":["object","url","has_more","data"],"properties":{"object":{"const":"list"},"url":{"type":"string","examples":["/v1/payments"]},"has_more":{"type":"boolean","description":"True when there are more results after this page."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}}},"WebhookEndpointList":{"type":"object","required":["object","url","has_more","data"],"properties":{"object":{"const":"list"},"url":{"type":"string","examples":["/v1/webhook_endpoints"]},"has_more":{"type":"boolean","description":"True when there are more results after this page."},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"PaymentRequirements":{"type":"object","required":["scheme","network","amount","asset","payTo","maxTimeoutSeconds"],"properties":{"scheme":{"const":"exact"},"network":{"type":"string","description":"CAIP-2.","examples":["eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]},"amount":{"type":"string","description":"The total in the token's smallest unit.","examples":["25000000"]},"asset":{"type":"string","description":"The token contract (EVM) or mint (Solana)."},"payTo":{"type":"string","description":"The merchant payout wallet."},"maxTimeoutSeconds":{"type":"integer","examples":[300]},"extra":{"type":"object","description":"EVM: the EIP-712 domain { name, version }. Solana: { feePayer }.","additionalProperties":true}}},"PaymentRequired":{"type":"object","required":["x402Version","resource","accepts"],"properties":{"x402Version":{"const":2},"error":{"type":"string","description":"\"Payment required\", or why the signed payment failed."},"code":{"type":"string","description":"A failure code, when a signed payment failed.","examples":["insufficient_funds"]},"resource":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentRequirements"},"description":"One entry per token and network."}}},"PaymentPayload":{"type":"object","description":"Send it base64 encoded in PAYMENT-SIGNATURE.","required":["x402Version","accepted","payload"],"properties":{"x402Version":{"const":2},"resource":{"type":"object","additionalProperties":true},"accepted":{"$ref":"#/components/schemas/PaymentRequirements","description":"The entry of `accepts` that you pay, unchanged."},"payload":{"type":"object","additionalProperties":true,"description":"The scheme-specific signature."},"extensions":{"type":"object","additionalProperties":true}}},"SettlementResponse":{"type":"object","description":"The decoded PAYMENT-RESPONSE header.","properties":{"success":{"type":"boolean"},"transaction":{"type":"string"},"network":{"type":"string"},"payer":{"type":"string"}}},"PublicCheckoutSession":{"type":"object","description":"What buyers can see. It has no metadata, client_reference_id or customer_email.","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["open","processing","complete","expired"]},"payment_status":{"type":"string","enum":["unpaid","paid"]},"livemode":{"type":"boolean"},"merchant":{"type":"object","properties":{"name":{"type":"string"},"logo_url":{"type":["string","null"]},"brand_color":{"type":["string","null"]},"support_email":{"type":["string","null"]}}},"line_items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"images":{"type":"array","items":{"type":"string"}},"unit_amount":{"type":"integer"},"quantity":{"type":"integer"},"amount_total":{"type":"integer"}}}},"amount_total":{"type":"integer","description":"USD cents."},"currency":{"const":"usd"},"expires_at":{"type":"integer"},"success_url":{"type":["string","null"]},"cancel_url":{"type":["string","null"]},"accepts":{"type":"object","properties":{"evm":{"type":"boolean"},"svm":{"type":"boolean"}}},"payment":{"oneOf":[{"$ref":"#/components/schemas/Payment"},{"type":"null"}]}}},"X402Receipt":{"type":"object","required":["status","session"],"properties":{"status":{"const":"complete"},"session":{"$ref":"#/components/schemas/PublicCheckoutSession"}}},"X402Processing":{"type":"object","required":["status"],"properties":{"status":{"const":"processing"},"message":{"type":"string"},"url":{"type":"string","format":"uri","description":"Poll this URL with GET until it answers 200."}}}}}}