pay_with_x402
Pay for a paid sermon or bundle per-call in USDC on Base using the x402 protocol — the AGENT-NATIVE rail, no SoapBox account, API key, or prepaid credits required (https://github.com/coinbase/x402). 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 USDC on Base to that payTo, then call again with x_payment set to a base64-encoded JSON payload carrying your broadcast Base tx hash ({"txHash":"0x..."}) — SoapBox verifies the on-chain transfer, records the sale (church keeps 70%), and returns the transcript. 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..."} for an on-chain Base USDC transfer, or an EIP-3009 authorization for a facilitator). Omit entirely on step 1 to receive the HTTP-402 payment requirements. |