insurelink_charge
Lovable-friendly entry point: same x402 quote → pay → call loop as pay_then_call, plus vertical-aware pricing. Pass vertical (logistics, legal, oracles, banking, fintech, healthcare, insurance, government, defense, …) and the upstream x402 server re-prices each accepts[] entry by tier (standard 1× / regulated 1.5× / sovereign 2.5× / defense 3×). Pass attestation: "pio:<id>" (or fedramp:/soc2:) for a 20% compliance discount on regulated+ tiers. The signed receipt envelope is tagged source: "lovable" and includes a vertical: { claimed_slug, attestation, quoted: { tier, multiplier, attested, ... } } block recording the tier the upstream actually quoted — that is the audit trail for tier billing. Returns { paid, upstream_status, response, signed_context: { envelope, envelope_json, envelope_sha256, signature, signer, scheme: 'EIP-191' } }. Pass idempotency_key to safely retry without double-settling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Target paid endpoint. | |
| body | No | Raw request body. JSON-encode before passing. | |
| mode | No | `quote_only` returns the 402 quote without settling. Default `pay_and_call`. | |
| method | No | HTTP method. Default GET. | |
| headers | No | Extra request headers (Content-Type, Authorization, etc.). | |
| purpose | No | Free-form audit string included in the signed receipt. | |
| vertical | No | Industry/sector slug. Drives the per-vertical pricing tier in accepts[] (standard 1× / regulated 1.5× / sovereign 2.5× / defense 3×). Forwarded to upstream as `vertical` body field and `x-vertical` header. | |
| attestation | No | Third-party compliance attestation in the form `pio:<id>` / `fedramp:<id>` / `soc2:<id>`. Grants a 20% discount on regulated/sovereign/defense tiers. Forwarded as `attestation` body field and `x-attestation` header. Recorded in the signed envelope so verifiers can audit the claimed compliance. | |
| agent_wallet | No | Calling agent wallet (logged in the signed receipt for downstream attribution). | |
| idempotency_key | No | Client-supplied idempotency key. If provided, repeated calls with the same key return the cached response and never settle a second payment. A subsequent call with the same key but a different request payload is rejected with `idempotency_key_conflict`. Keys are retained for 24h. | |
| max_amount_usdc | No | Refuse to settle if the 402 quote exceeds this USDC amount. Default 10. | |
| x_payment_header | No | Base64-encoded X-PAYMENT header (caller pre-builds settlement payload). Required unless mode='quote_only'. |