{
  "openapi": "3.1.0",
  "info": {
    "title": "Adam Hale: School Signals and AI Safety Evidence (USDC on Base)",
    "version": "1.0.0",
    "description": "School Signals (UK school edtech contract renewals, buyer briefs and the England snapshot) and the DfE AI safety evidence toolkit, sold for canonical USDC on Base (eip155:8453, token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) paid straight to 0x491Fcf30a5aa0483B3cd8C0041d21801F195B3AF. No account, no API key.",
    "contact": {
      "name": "Adam Hale",
      "email": "adam.hale@atomicmail.ai",
      "url": "https://pay.adamhaleworks.workers.dev/"
    },
    "x-guidance": "Paid in canonical USDC on Base (eip155:8453) to 0x491Fcf30a5aa0483B3cd8C0041d21801F195B3AF, two ways. (1) x402 v2 scheme exact: GET a /x402/v1/* route; an unpaid call returns 402 with the terms in the PAYMENT-REQUIRED header and body; retry with a PAYMENT-SIGNATURE header (e.g. @x402/fetch). For the 149 and 295 USDC files, raise your client's per-payment cap (many clients cap automatic payments around 1 USDC). (2) Plain transfer for the files: POST /api/orders {\"product\":\"<id>\"} returns an order-specific exact amount; send it as one USDC transfer on Base, then POST /api/orders/{id}/claim {\"tx_hash\":\"0x...\"}. School Signals queries are validated before payment: unknown or ambiguous buyers (409 with candidates), invalid filters (400) and empty results (404) are never charged. Find buyer ids free at GET /api/school-signals/search?q=. Each transaction hash is accepted once. Downloads are signed links valid 48 hours, re-issued from the order for 30 days. Payment goes straight to the seller's own wallet. There is no merchant of record, card processor or platform in between, and payments on Base are irreversible."
  },
  "externalDocs": {
    "description": "Guides, prices and terms",
    "url": "https://pay.adamhaleworks.workers.dev/"
  },
  "servers": [
    {
      "url": "https://pay.adamhaleworks.workers.dev"
    }
  ],
  "x-x402": {
    "x402Version": 2,
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "payTo": "0x491Fcf30a5aa0483B3cd8C0041d21801F195B3AF",
    "facilitators": [
      "https://facilitator.payai.network",
      "https://facilitator.xpay.sh"
    ]
  },
  "paths": {
    "/x402/v1/school-renewals": {
      "get": {
        "operationId": "schoolRenewals",
        "summary": "School edtech contract renewals",
        "description": "Use when you need upcoming edtech contract renewals at English state schools, academy trusts or councils buying for schools: incumbent supplier, published value, end date, extension options, estimated re-procurement window and the official Contracts Finder / Find a Tender link. Filter by category, region, supplier or buyer. Queries with no matching contract are answered 404 before any payment. Price: 0.03 USDC on Base. Partial coverage: only notices published on Contracts Finder or Find a Tender are included, and many school purchases are never published. Re-procurement windows are estimates (contract end minus 9 to 3 months), not published dates. Check the official notice before acting.",
        "tags": [
          "x402",
          "school-signals"
        ],
        "parameters": [
          {
            "name": "ending_within_months",
            "in": "query",
            "required": false,
            "description": "Contracts ending between today and this many months ahead (1-24, default 12).",
            "schema": {
              "type": "string"
            },
            "example": "6"
          },
          {
            "name": "include_recently_ended",
            "in": "query",
            "required": false,
            "description": "true to also include contracts that ended in the last 6 months (re-procurement may be under way).",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "One of the 13 edtech categories, e.g. 'MIS & school administration software' or its slug 'mis-school-administration-software'.",
            "schema": {
              "type": "string"
            },
            "example": "MIS & school administration software"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "English region, e.g. 'South East'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "supplier",
            "in": "query",
            "required": false,
            "description": "Incumbent supplier name contains this text (3-80 characters).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "buyer",
            "in": "query",
            "required": false,
            "description": "Limit to one buyer: id from /api/school-signals/search (school:<URN>, trust:<UID>, org:<slug>).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.03"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Answer (charged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "snapshot": {
                    "as_of": "2026-10-14",
                    "sources": [
                      {
                        "name": "Contracts Finder (Cabinet Office), via the Open Contracting Data Registry",
                        "url": "https://www.contractsfinder.service.gov.uk/"
                      },
                      {
                        "name": "Find a Tender (Cabinet Office), via the Open Contracting Data Registry",
                        "url": "https://www.find-tender.service.gov.uk/"
                      },
                      {
                        "name": "DfE Get Information about Schools (GIAS)",
                        "url": "https://get-information-schools.service.gov.uk/Downloads"
                      },
                      {
                        "name": "DfE open academies and academy projects in development",
                        "url": "https://www.gov.uk/government/publications/open-academies-and-academy-projects-in-development"
                      }
                    ],
                    "licence": {
                      "name": "Open Government Licence v3.0",
                      "url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
                      "attribution": "Contains public sector information licensed under the Open Government Licence v3.0."
                    },
                    "coverage_warning": "Partial coverage: only notices published on Contracts Finder or Find a Tender are included, and many school purchases are never published. Re-procurement windows are estimates (contract end minus 9 to 3 months), not published dates. Check the official notice before acting."
                  },
                  "filters": {
                    "ending_within_months": 6,
                    "include_recently_ended": false,
                    "category": "MIS & school administration software",
                    "region": null,
                    "supplier": null,
                    "buyer": null,
                    "window": {
                      "from": "2026-10-18",
                      "to": "2027-04-18"
                    }
                  },
                  "total_matches": 13,
                  "returned": 13,
                  "cap": 25,
                  "results": [
                    {
                      "buyer": {
                        "id": "trust:17050",
                        "name": "ESTEEM MULTI-ACADEMY TRUST",
                        "kind": "trust",
                        "region": "East Midlands",
                        "local_authority": null
                      },
                      "category": "MIS & school administration software",
                      "title": "Procurement of Management Information System",
                      "incumbent": "ARBOR EDUCATION PARTNERS LIMITED",
                      "published_value_gbp": 99992.85,
                      "awarded_value_gbp": 99992.85,
                      "estimated_value_gbp": 99992.85,
                      "award_date": "2023-10-24",
                      "contract_start": "2024-01-01",
                      "contract_end": "2026-12-31",
                      "contract_end_basis": "published end date",
                      "months_to_end": 2.4,
                      "extension": {
                        "possible": false,
                        "max_extension_end": null,
                        "note": null
                      },
                      "estimated_reprocurement_window": {
                        "start": "2026-03-31",
                        "end": "2026-09-30",
                        "basis": "estimate: contract end minus 9 to 3 months, not a published date"
                      },
                      "procurement_method": "Call-off from a framework agreement",
                      "frameworks_mentioned": "CCS G-Cloud",
                      "possible_later_notice": null,
                      "source": {
                        "publisher": "Contracts Finder",
                        "notice_type": "compiled",
                        "published": "2023-11-23",
                        "notice_url": "https://www.contractsfinder.service.gov.uk/Notice/25299b4e-8ee9-42bb-84ea-4619a80f3011",
                        "record_api_url": "https://www.contractsfinder.service.gov.uk/api/rest/2/get_published_notice/json/25299b4e-8ee9-42bb-84ea-4619a80f3011"
                      }
                    },
                    {
                      "buyer": {
                        "id": "trust:16158",
                        "name": "PALLADIAN ACADEMY TRUST",
                        "kind": "trust",
                        "region": "South West",
                        "local_authority": null
                      },
                      "category": "MIS & school administration software",
                      "title": "CA14158 - The Palladian Academy Trust - Management Information System via the G Cloud RM1557.13 Lot 2",
                      "incumbent": "Arbor Education Partners",
                      "published_value_gbp": 135937.79,
                      "awarded_value_gbp": 135937.79,
                      "estimated_value_gbp": null,
                      "award_date": "2024-11-04",
                      "contract_start": "2025-02-28",
                      "contract_end": "2027-01-31",
                      "contract_end_basis": "published end date",
                      "months_to_end": 3.4,
                      "extension": {
                        "possible": false,
                        "max_extension_end": null,
                        "note": null
                      },
                      "estimated_reprocurement_window": {
                        "start": "2026-04-30",
                        "end": "2026-10-31",
                        "basis": "estimate: contract end minus 9 to 3 months, not a published date"
                      },
                      "procurement_method": "Open procedure",
                      "frameworks_mentioned": "CCS (framework not named)",
                      "possible_later_notice": null,
                      "source": {
                        "publisher": "Contracts Finder",
                        "notice_type": "compiled",
                        "published": "2024-11-04",
                        "notice_url": "https://www.contractsfinder.service.gov.uk/Notice/05b2537e-6107-4f84-9d34-e2701a6b5f67",
                        "record_api_url": "https://www.contractsfinder.service.gov.uk/api/rest/2/get_published_notice/json/05b2537e-6107-4f84-9d34-e2701a6b5f67"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired in the PAYMENT-REQUIRED header (base64) and the body. X-Result-Count gives the number of matching rows.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown buyer, or no matching published evidence. Refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Ambiguous buyer name; candidates listed. Refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/x402/v1/school-buyer-brief": {
      "get": {
        "operationId": "schoolBuyerBrief",
        "summary": "School, trust or council buyer brief",
        "description": "Use when you need a source-linked brief on one English school (URN), academy trust (GIAS group UID) or council buying for schools: trust hierarchy, published edtech contracts with incumbents and values, upcoming renewals with estimated re-procurement windows, live tenders, recent trust changes and official links. Unknown or ambiguous buyers (409 with candidates) and buyers with no published evidence are answered before any payment; find ids free with /api/school-signals/search. Price: 0.20 USDC on Base. Partial coverage: only notices published on Contracts Finder or Find a Tender are included, and many school purchases are never published. Re-procurement windows are estimates (contract end minus 9 to 3 months), not published dates. Check the official notice before acting.",
        "tags": [
          "x402",
          "school-signals"
        ],
        "parameters": [
          {
            "name": "buyer",
            "in": "query",
            "required": true,
            "description": "school:<URN>, trust:<GIAS group UID>, org:<slug> (from the free search), a URN, or an exact name.",
            "schema": {
              "type": "string"
            },
            "example": "trust:15710"
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.20"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Answer (charged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "snapshot": {
                    "as_of": "2026-10-14",
                    "sources": [
                      {
                        "name": "Contracts Finder (Cabinet Office), via the Open Contracting Data Registry",
                        "url": "https://www.contractsfinder.service.gov.uk/"
                      },
                      {
                        "name": "Find a Tender (Cabinet Office), via the Open Contracting Data Registry",
                        "url": "https://www.find-tender.service.gov.uk/"
                      },
                      {
                        "name": "DfE Get Information about Schools (GIAS)",
                        "url": "https://get-information-schools.service.gov.uk/Downloads"
                      },
                      {
                        "name": "DfE open academies and academy projects in development",
                        "url": "https://www.gov.uk/government/publications/open-academies-and-academy-projects-in-development"
                      }
                    ],
                    "licence": {
                      "name": "Open Government Licence v3.0",
                      "url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
                      "attribution": "Contains public sector information licensed under the Open Government Licence v3.0."
                    },
                    "coverage_warning": "Partial coverage: only notices published on Contracts Finder or Find a Tender are included, and many school purchases are never published. Re-procurement windows are estimates (contract end minus 9 to 3 months), not published dates. Check the official notice before acting."
                  },
                  "buyer": {
                    "id": "trust:15710",
                    "name": "ACTIVATE LEARNING EDUCATION TRUST",
                    "kind": "trust",
                    "region": "South East",
                    "local_authority": null,
                    "hierarchy": {
                      "trust_type": "Multi-academy trust",
                      "open": true,
                      "schools": 5,
                      "pupils": 1840,
                      "local_authorities": 5,
                      "main_region": "South East",
                      "regions": [
                        "London",
                        "South East",
                        "South West"
                      ],
                      "schools_gained_12m": 0,
                      "schools_lost_12m": 0,
                      "sponsor_pipeline_schools": 0,
                      "companies_house_number": "08707909",
                      "gias_url": "https://get-information-schools.service.gov.uk/Groups/Group/Details/15710",
                      "companies_house_url": "https://find-and-update.company-information.service.gov.uk/company/08707909"
                    }
                  },
                  "summary": {
                    "published_contracts": 20,
                    "with_named_incumbent": 17,
                    "renewals_next_12_months": 3,
                    "live_tenders": 0,
                    "trust_changes": 0,
                    "scope_note": "Includes contracts let by the trust's schools themselves."
                  },
                  "incumbents": [
                    {
                      "supplier": "European Electronique",
                      "contracts": 3,
                      "categories": [
                        "IT managed services & support",
                        "Networks, Wi-Fi & connectivity"
                      ],
                      "latest_end": "2027-08-31"
                    },
                    {
                      "supplier": "Apogee Corporation Limited",
                      "contracts": 2,
                      "categories": [
                        "Print & MFD"
                      ],
                      "latest_end": "2027-04-30"
                    },
                    {
                      "supplier": "Academia Ltd",
                      "contracts": 1,
                      "categories": [
                        "Devices & end-user hardware"
                      ],
                      "latest_end": "2019-08-31"
                    }
                  ],
                  "upcoming_renewals": {
                    "window": {
                      "from": "2026-04-18",
                      "to": "2028-10-18"
                    },
                    "total": 6,
                    "results": [
                      {
                        "buyer": {
                          "id": "trust:15710",
                          "name": "ACTIVATE LEARNING EDUCATION TRUST",
                          "kind": "trust",
                          "region": "South East",
                          "local_authority": null
                        },
                        "scope": "trust",
                        "category": "Cloud, licences & productivity",
                        "title": "CA12695 - ITS4042SU: Software Licence Resellers Agreement for Colleges",
                        "incumbent": "Insight Direct UK Ltd",
                        "published_value_gbp": null,
                        "awarded_value_gbp": null,
                        "estimated_value_gbp": null,
                        "award_date": "2023-11-15",
                        "contract_start": "2023-10-01",
                        "contract_end": "2026-09-30",
                        "contract_end_basis": "published end date",
                        "months_to_end": -0.6,
                        "extension": {
                          "possible": false,
                          "max_extension_end": null,
                          "note": null
                        },
                        "estimated_reprocurement_window": {
                          "start": "2025-12-30",
                          "end": "2026-06-30",
                          "basis": "estimate: contract end minus 9 to 3 months, not a published date"
                        },
                        "procurement_method": "Open procedure",
                        "frameworks_mentioned": null,
                        "possible_later_notice": "https://www.contractsfinder.service.gov.uk/Notice/5c945dfa-aa32-4c67-9e6a-58fb22d74e07",
                        "source": {
                          "publisher": "Contracts Finder",
                          "notice_type": "compiled",
                          "published": "2023-11-15",
                          "notice_url": "https://www.contractsfinder.service.gov.uk/Notice/a0d3893f-4e39-4da2-a928-67a6e6593606",
                          "record_api_url": "https://www.contractsfinder.service.gov.uk/api/rest/2/get_published_notice/json/a0d3893f-4e39-4da2-a928-67a6e6593606"
                        }
                      }
                    ]
                  },
                  "other_contracts": {
                    "total": 14,
                    "results": [
                      {
                        "buyer": {
                          "id": "trust:15710",
                          "name": "ACTIVATE LEARNING EDUCATION TRUST",
                          "kind": "trust",
                          "region": "South East",
                          "local_authority": null
                        },
                        "scope": "trust",
                        "category": "Cloud, licences & productivity",
                        "title": "Customer Relationship Management System",
                        "incumbent": "RIBBONFISH LIMITED",
                        "published_value_gbp": 803724,
                        "awarded_value_gbp": 803724,
                        "estimated_value_gbp": null,
                        "award_date": "2025-12-15",
                        "contract_start": null,
                        "contract_end": "2030-11-19",
                        "contract_end_basis": "derived from the published duration",
                        "months_to_end": 49,
                        "extension": {
                          "possible": false,
                          "max_extension_end": null,
                          "note": null
                        },
                        "estimated_reprocurement_window": {
                          "start": "2030-02-19",
                          "end": "2030-08-19",
                          "basis": "estimate: contract end minus 9 to 3 months, not a published date"
                        },
                        "procurement_method": "Restricted procedure",
                        "frameworks_mentioned": null,
                        "possible_later_notice": null,
                        "source": {
                          "publisher": "Find a Tender",
                          "notice_type": "compiled",
                          "published": "2025-12-15",
                          "notice_url": "https://www.find-tender.service.gov.uk/Notice/083058-2025",
                          "record_api_url": "https://www.find-tender.service.gov.uk/api/1.0/ocdsRecordPackages/ocds-h6vhtk-04daf0"
                        }
                      }
                    ]
                  },
                  "live_tenders": {
                    "total": 0,
                    "results": []
                  },
                  "trust_changes": {
                    "total": 0,
                    "results": []
                  },
                  "source_links": [
                    {
                      "name": "GIAS record",
                      "url": "https://get-information-schools.service.gov.uk/Groups/Group/Details/15710"
                    },
                    {
                      "name": "Companies House",
                      "url": "https://find-and-update.company-information.service.gov.uk/company/08707909"
                    }
                  ],
                  "caps": {
                    "upcoming": 25,
                    "contracts": 50,
                    "tenders": 10,
                    "changes": 25,
                    "incumbents": 10,
                    "candidates": 5
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired in the PAYMENT-REQUIRED header (base64) and the body. X-Result-Count gives the number of matching rows.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown buyer, or no matching published evidence. Refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Ambiguous buyer name; candidates listed. Refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/x402/v1/school-signals-england-snapshot": {
      "get": {
        "operationId": "schoolSignalsEnglandSnapshot",
        "summary": "School Signals England snapshot (2026-10-14)",
        "description": "Immutable School Signals England snapshot (2026-10-14): XLSX + 9 CSVs (renewals, contracts, live tenders, trust changes, trusts, schools, incumbents, frameworks, DfE buying options), data dictionary, methodology, SHA-256 manifest; 12-month internal-use licence for up to 3 named users. Delivered by a signed download link. Price: 295 USDC on Base.",
        "tags": [
          "x402",
          "files"
        ],
        "parameters": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "295"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Signed download link and file hash (charged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "order": "<18-character order id>",
                  "product": "dfe-ai-safety-toolkit",
                  "download": {
                    "url": "https://pay.adamhaleworks.workers.dev/download/dfe-ai-safety-toolkit?o=<order>&exp=<unix time>&sig=<HMAC>",
                    "expires_at": "<48 hours after payment>"
                  },
                  "file": {
                    "name": "DfE-AI-Safety-Evidence-Toolkit-USDC.zip",
                    "bytes": "<size>",
                    "sha256": "<published on the guide page>"
                  },
                  "order_url": "https://pay.adamhaleworks.workers.dev/orders/<order>"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired in the PAYMENT-REQUIRED header (base64) and the body. X-Result-Count gives the number of matching rows.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Delivery unavailable; refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/x402/v1/dfe-ai-safety-toolkit": {
      "get": {
        "operationId": "dfeAiSafetyToolkit",
        "summary": "DfE AI safety evidence toolkit",
        "description": "DfE Generative AI product safety standards evidence toolkit: 87-row evidence matrix over 13 areas, risk register, DPIA input pack, data-flow register, 68-test release test set, complaints workflow, procurement summary template and worked sample, with SHA-256 manifest. Not certification or legal advice. Delivered by a signed download link. Price: 149 USDC on Base. Not certification, accreditation, legal advice, a DPIA, data protection officer sign-off, safeguarding assurance or a safety guarantee, and not endorsed by the DfE.",
        "tags": [
          "x402",
          "files"
        ],
        "parameters": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "149"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Signed download link and file hash (charged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "order": "<18-character order id>",
                  "product": "dfe-ai-safety-toolkit",
                  "download": {
                    "url": "https://pay.adamhaleworks.workers.dev/download/dfe-ai-safety-toolkit?o=<order>&exp=<unix time>&sig=<HMAC>",
                    "expires_at": "<48 hours after payment>"
                  },
                  "file": {
                    "name": "DfE-AI-Safety-Evidence-Toolkit-USDC.zip",
                    "bytes": "<size>",
                    "sha256": "<published on the guide page>"
                  },
                  "order_url": "https://pay.adamhaleworks.workers.dev/orders/<order>"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired in the PAYMENT-REQUIRED header (base64) and the body. X-Result-Count gives the number of matching rows.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Delivery unavailable; refused before payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/school-signals/search": {
      "get": {
        "operationId": "schoolSignalsSearch",
        "summary": "Find a school, trust or council (free)",
        "description": "Free lookup of buyer ids with evidence counts, to use before paying for a brief or a filtered renewals query. Up to 10 results.",
        "tags": [
          "free",
          "school-signals"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Name (3-120 characters), URN or GIAS group UID.",
            "schema": {
              "type": "string"
            },
            "example": "ACTIVATE LEARNING"
          }
        ],
        "responses": {
          "200": {
            "description": "Candidates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "query": "ACTIVATE LEARNING",
                  "snapshot_date": "2026-10-14",
                  "total_matches": 1,
                  "results": [
                    {
                      "id": "trust:15710",
                      "name": "ACTIVATE LEARNING EDUCATION TRUST",
                      "kind": "trust",
                      "region": "South East",
                      "local_authority": null,
                      "evidence": {
                        "published_contracts": 20,
                        "renewals_next_12_months": 3,
                        "live_tenders": 0,
                        "trust_changes": 0
                      },
                      "brief_available": true
                    }
                  ],
                  "note": "Free lookup. Use a result's id as `buyer` in school-buyer-brief or school-renewals. Counts include the trust's contracts for schools in a trust."
                }
              }
            }
          },
          "400": {
            "description": "Invalid query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/school-signals/coverage": {
      "get": {
        "operationId": "schoolSignalsCoverage",
        "summary": "Snapshot date, counts, categories and regions (free)",
        "tags": [
          "free",
          "school-signals"
        ],
        "responses": {
          "200": {
            "description": "Coverage.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Product manifest with prices and payment terms (free)",
        "tags": [
          "free"
        ],
        "responses": {
          "200": {
            "description": "Products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/orders": {
      "post": {
        "operationId": "createTransferOrder",
        "summary": "Create a plain-transfer order for a file (free)",
        "description": "Returns an order with an order-specific exact USDC amount (list price plus at most 0.009999 USDC), the token contract, chain id and recipient. Valid 24 hours.",
        "tags": [
          "orders"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product": {
                    "type": "string",
                    "enum": [
                      "school-signals-england-snapshot",
                      "dfe-ai-safety-toolkit"
                    ]
                  }
                },
                "required": [
                  "product"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Unknown product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many orders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Order status; a fresh signed download link when paid",
        "tags": [
          "orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No such order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/orders/{id}/claim": {
      "post": {
        "operationId": "claimTransferOrder",
        "summary": "Submit the Base transaction hash that paid an order",
        "description": "Verifies on Base: chain id 8453, successful status, a canonical USDC Transfer log to the recipient for exactly the order amount, block time inside the order window, 10 confirmations, and that the hash was never used before.",
        "tags": [
          "orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  }
                },
                "required": [
                  "tx_hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paid; includes the download link."
          },
          "202": {
            "description": "Not found yet or not enough confirmations; retry."
          },
          "409": {
            "description": "Transaction already used, or order already paid."
          },
          "422": {
            "description": "Payment not accepted; `result.checks` shows which check failed."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}