> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Call an x402 Endpoint

Use B3OS to pay for and call an x402 protected resource from a workflow.

Use this recipe when a workflow needs to call an API that requires x402 payment before returning a response.



## Pattern

```text
trigger -> prepare request -> call x402 protected resource -> process response -> notify or continue
```

**x402 protected call**

**Trigger**
  **Prepare request**
  **Wallet policy**
  **x402 call**
  **Process response**
  **start**
  **policy inputs**
  **approved payment**
  **request payload**
  **response**

## Action

Use the x402 action when you want a workflow node to handle payment and request execution.

```json
{
  "type": "call-x402-protected-resource",
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  },
  "payload": {
    "url": "https://api.example.com/protected-resource",
    "method": "GET",
    "headers": {},
    "body": {}
  },
  "children": ["process_response"]
}
```

**Review payment policy**

x402 calls can spend value. Use a dedicated wallet, explicit limits, and monitoring before enabling fully automated
  production calls.

## API Surfaces

| Task | Endpoint |
| --- | --- |
| List endpoints | ` GET /v1/x402-endpoints ` |
| Create an endpoint | ` POST /v1/x402-endpoints ` |
| Probe endpoint requirements | ` POST /v1/x402-endpoints/probe ` |
| Execute a paid call | ` POST /v1/x402-endpoints/execute ` |
| Test an endpoint | ` POST /v1/x402-endpoints/test ` |

## Related

**[x402 action reference](/actions/reference/generated/call-x402-protected-resource)**

Action schema for workflow node usage.
  **[x402 API reference](/api/reference/post-v1-x402-endpoints-execute)**

Exact REST request and response shape for paid endpoint execution.