> ## 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 x402 Endpoint

Call an x402 pay-per-use API endpoint. Payment is handled automatically using your connected wallet — no manual steps needed.

![Call x402 Endpoint logo](https://cdn.b3.fun/b3os-icons/x402.svg)
Built-in action X402 wallet

Call an x402 pay-per-use API endpoint. Payment is handled automatically using your connected wallet — no manual steps needed.

**Review wallet and value movement**

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-endpoint` |
| Category | X402 |
| Connector | `wallet` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `x402`, `payment`, `api`, `pay-per-call` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `endpointId` | `string` | Yes | The ID of the x402 endpoint to call \(from the endpoint registry\) |
| `maxPrice` | `string` | No | Optional override for maximum allowed price \(in token's smallest unit\). If not specified, uses the endpoint's default max price. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | Whether the request succeeded or failed |
| `statusCode` | `number` | No | HTTP status code from the response |
| `resource` | `object` | No | The fetched resource data \(parsed JSON response from the endpoint\). Access nested fields with &#123;&#123;nodeId.result.resource.fieldName&#125;&#125; |
| `paymentDetails` | `object` | No | Payment transaction details |
| `requestDetails` | `object` | No | Details of the request that was made |
| `responseHeaders` | `object` | No | Response headers from the resource server |
| `error` | `string` | No | Error message if failed |

## Examples

**Workflow node**

```json
{
  "type": "call-x402-endpoint",
  "payload": {
    "endpointId": "x402_abc123"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/call-x402-endpoint/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "endpointId": "x402_abc123"
  }
}'
```

**Use expressions for dynamic values**

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.