Call x402 Resource
Access an x402 pay-per-use API with automatic crypto payment. Signs payment off-chain using your wallet — no manual approval needed. Supports USDC and other permit-enabled tokens.
Catalog action Integrations wallet
Access an x402 pay-per-use API with automatic crypto payment. Signs payment off-chain using your wallet — no manual approval needed. Supports USDC and other permit-enabled tokens.
This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.
At a Glance
| Field | Value |
|---|---|
| Action ID | call-x402-protected-resource |
| Category | Integrations |
| Connector | wallet |
| Requires gas | No |
| Funds movement | None declared |
| Tags | x402, payment, http, api, blockchain, integration |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
resourceUrl | string | Yes | The URL of the x402-protected resource to access |
method | string | No | HTTP method to use (default: "GET") |
body | object | No | Request body for POST/PUT/PATCH requests (will be JSON stringified) |
headers | object | No | Custom HTTP headers to include in the request (string key-value pairs) |
queryParams | object | No | URL query parameters to append to the resourceUrl (string key-value pairs) |
timeout | number | No | Request timeout in milliseconds (default: 30000) |
facilitatorUrl | string | No | Facilitator URL (optional, defaults to B3OS facilitator) |
preferredToken | string | No | Preferred payment token address (e.g., B3 token address) |
preferredNetwork | string | No | Preferred network for payment (e.g., "base", "ethereum") |
maxAmountPerRequest | string | Yes | Maximum amount willing to pay per request (in wei/smallest token unit) |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
status | string | Yes | - |
statusCode | number | No | HTTP status code from the response |
resource | object | string | No | The fetched resource data (parsed JSON or raw text) |
responseHeaders | object | No | Response headers from the resource server |
paymentDetails | object | No | Payment details (always present when hadPayment is true). Contains information about the payment that was made by the facilitator. |
requestDetails | object | No | Details of the request that was made |
error | string | No | Error message if failed |
Examples
json{ "type": "call-x402-protected-resource", "payload": { "resourceUrl": "https://example.com/webhook", "maxAmountPerRequest": "1000000" }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}
bashcurl -X POST "https://api.b3os.org/v1/actions/call-x402-protected-resource/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "resourceUrl": "https://example.com/webhook", "maxAmountPerRequest": "1000000" }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
