{"openapi":"3.1.0","info":{"title":"x402 Digital Vending Machine","version":"2.0.0"},"servers":[{"url":"https://www.x402digitalvendingmachine.store"}],"paths":{"/v1/schema-gate":{"post":{"summary":"Validate and canonicalize JSON against buyer-committed acceptance criteria","description":"The unpaid request commits the exact input, schema, acceptance predicates, order, and idempotency key. On the paid retry the facilitator verifies first, evaluates the committed predicates, and settles a completed ACCEPT or REJECT evaluation. ACCEPT includes canonical output; REJECT withholds output and includes failed checks. Both include a durable ES256 receipt. Malformed requests and failures before settlement are free. If delivery fails after settlement, the same order recovers without another charge.","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"Base64-encoded canonical x402 v2 PaymentPayload. Required only on the paid retry.","schema":{"type":"string","contentEncoding":"base64"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaGateRequest"}}}},"responses":{"200":{"description":"Paid ACCEPT or REJECT evaluation and signed receipt"},"400":{"description":"Field-level validation error"},"402":{"description":"Canonical x402 challenge bound to the order and acceptance commitment"},"409":{"description":"Order, idempotency, or payment replay conflict"},"503":{"description":"Payment, receipt signing, or durable delivery unavailable"}},"x-x402":{"x402Version":2,"accepts":[{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount":"10000","asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","payTo":"E2PxHWFSwzt6a3osZRQeT16tsb7BPLfXEMuDfjnZuhFD","maxTimeoutSeconds":600,"extra":{"feePayer":"CjNFTjvBhbJJd2B5ePPMHRLx1ELZpa8dwQgGL727eKww","memo":"issued-per-request-in-PAYMENT-REQUIRED","challengeId":"issued-per-request-in-PAYMENT-REQUIRED"}}]}}},"/v1/orders/{order_id}":{"get":{"summary":"Recover an order with its opaque bearer token","responses":{"200":{"description":"Order state or recovered result"},"202":{"description":"Order still processing"},"404":{"description":"Unknown order or invalid recovery token"}}}},"/.well-known/receipt-key.json":{"get":{"summary":"ES256 receipt verification key","responses":{"200":{"description":"Public JSON Web Key Set"}}}}},"components":{"schemas":{"PaymentRequirements":{"type":"object","properties":{"scheme":{"type":"string","const":"exact"},"network":{"type":"string","const":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"},"amount":{"type":"string","const":"10000"},"asset":{"type":"string","const":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"},"payTo":{"type":"string","const":"E2PxHWFSwzt6a3osZRQeT16tsb7BPLfXEMuDfjnZuhFD"},"maxTimeoutSeconds":{"type":"integer","const":600},"extra":{"type":"object","properties":{"feePayer":{"type":"string","const":"CjNFTjvBhbJJd2B5ePPMHRLx1ELZpa8dwQgGL727eKww"},"memo":{"type":"string","description":"One-time memo bound to the challenge and request body."},"challengeId":{"type":"string","format":"uuid","description":"One-time challenge identifier bound to the memo and request body."}},"required":["feePayer","memo","challengeId"]}},"required":["scheme","network","amount","asset","payTo","maxTimeoutSeconds","extra"]},"PaymentPayload":{"type":"object","properties":{"x402Version":{"type":"integer","const":2},"resource":{"type":"object","additionalProperties":true},"accepted":{"$ref":"#/components/schemas/PaymentRequirements"},"payload":{"type":"object","properties":{"transaction":{"type":"string","contentEncoding":"base64","description":"Partially signed Solana versioned transaction serialized as base64."}},"required":["transaction"]}},"required":["x402Version","resource","accepted","payload"]},"PaymentRequired":{"type":"object","properties":{"x402Version":{"type":"integer","const":2},"error":{"type":"string"},"resource":{"type":"object","additionalProperties":true},"accepts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentRequirements"}},"extensions":{"type":"object","additionalProperties":true}},"required":["x402Version","resource","accepts","extensions"]},"SchemaGateRequest":{"type":"object","additionalProperties":false,"properties":{"order_id":{"type":"string","minLength":1,"maxLength":128},"idempotency_key":{"type":"string","minLength":8,"maxLength":128},"input":{"description":"A JSON value or JSON-encoded string"},"target_schema":{"type":"object","description":"Bounded supported JSON Schema subset; $ref is rejected"},"acceptance_criteria":{"type":"object","additionalProperties":false,"properties":{"canonical_json":{"const":true},"required_fields":{"type":"array","items":{"type":"string"}},"forbidden_patterns":{"type":"array","items":{"type":"string","description":"Literal substring, not regular expression"}},"max_output_bytes":{"type":"integer","minimum":2,"maximum":100000},"normalizer_version":{"const":"schema-gate-c14n-v1"}},"required":["canonical_json","required_fields","forbidden_patterns","max_output_bytes","normalizer_version"]},"acceptance_commitment":{"type":"string","pattern":"^(sha256:[a-f0-9]{64}|[a-fA-F0-9]{64})$","description":"Canonical form is sha256:<64 lowercase hex characters>; bare legacy hex is normalized."},"expires_at":{"description":"Optional RFC 3339 timestamp or epoch seconds, at most 24 hours ahead"}},"required":["order_id","idempotency_key","input","target_schema","acceptance_criteria","acceptance_commitment"]}}}}