Verify signed x402 receipt (official offer-receipt format)
verify_x402_receiptVerify a signed receipt in the official x402 offer-receipt extension format (docs.x402.org/extensions/offer-receipt, npm @x402/extensions). Accepts {format:"jws", signature} artifacts (JWS with EdDSA/Ed25519 or ES256/P-256), checks structure, required payload fields (version/network/resourceUrl/payer/issuedAt), cryptographic signature, optional freshness window, and optional expected values. Public key resolves automatically from did:key/did:web/did:jwk kid, or pass public_key_jwk directly. Read-only, no cost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expect | No | Optional assertions: {resourceUrl?, payer?, network?} — verification fails if the payload contradicts them. | |
| receipt | Yes | Signed receipt artifact, e.g. {"format":"jws","signature":"<JWS compact serialization>"} | |
| public_key_jwk | No | Optional JWK to verify with. Omit to resolve from the kid (did:key:z... Ed25519, did:web, did:jwk). | |
| max_age_seconds | No | Freshness window for issuedAt (default 3600; pass 0 to skip the freshness gate). |