pay_with_x402
Pay for a paid sermon or bundle per-call in USDC on Base using the x402 protocol. This is the only TOOL here that buys SoapBox faith content: the prepaid marketplace-credit tools were retired on 2026-07-15 and their endpoints now answer HTTP 410. (A person can instead buy on the item's web_url in a browser.) No SoapBox account or API key is required — the payment IS the credential (https://github.com/coinbase/x402). SoapBox is the Merchant of Record: the church keeps 70% of net and SoapBox takes 30%. This is a content SALE, never a donation — donations go 100% to the church via give_to_church. Works for a single sermon (sermon_id) or a whole series (bundle_id). Two-step, exactly per spec: (1) call with just the sermon_id (or bundle_id) and NO payment to get back the HTTP-402 payment requirements — the USDC amount, asset, network ('base'), and SoapBox's payTo receive address. (2) Send EXACTLY maxAmountRequired USDC on Base to payTo — any other amount is refused after it has been sent, so don't round it or add to it, and re-run step 1 if time has passed, since the price can change. Sign the 402's onchainPayment.message (your tx hash in lower case, and the item) with the wallet that paid, then call again with x_payment set to base64 of {"txHash":"0x...","signature":"0x..."} — SoapBox checks the on-chain transfer came from the signing wallet, records the sale (church keeps 70%), and returns the transcript. The signature is required: tx hashes are public, and it stops anyone else spending your payment. Idempotent per tx hash. Gasless EIP-3009 'exact' payments via an x402 facilitator are also accepted in the same x_payment field.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundle_id | No | The bundle to pay for. Provide exactly one of sermon_id or bundle_id. | |
| sermon_id | No | The sermon to pay for. Provide exactly one of sermon_id or bundle_id. | |
| x_payment | No | Step 2 only: a base64-encoded JSON x402 payment payload (e.g. base64 of {"txHash":"0x...","signature":"0x..."} for an on-chain Base USDC transfer, signed by the paying wallet as the 402's onchainPayment says, or an EIP-3009 authorization for a facilitator). Omit entirely on step 1 to receive the HTTP-402 payment requirements. |