# Queries

The Cashramp Bot API provides read-only queries to fetch agent profile data and account information.

**Endpoint:** `POST /cashramp/bot/graphql`\
**Auth:** `Authorization: Bearer {api_key}` (agent API key)

***

### Profile

```graphql
query {
  profile {
    # AgentProfile fields
  }
}
```

Returns the authenticated agent's profile — includes balances, rates, settings, deposit/withdrawal stats, TOTP info, etc.

***

### Order History

```graphql
query {
  orderHistory(
    page: 1
    perPage: 10
    filter: {
      orderId: "order_id"
      status: completed
      dateFrom: "2024-01-01"
      dateTo: "2024-12-31"
      paymentMethod: "bank_transfer"
    }
  ) {
    data {
      # P2PPayment fields
    }
    pagination {
      # Pagination fields
    }
  }
}
```

<table><thead><tr><th width="160">Argument</th><th width="192.1640625">Type</th><th width="94">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>page</code></td><td><code>Int!</code></td><td><strong>Yes</strong></td><td>The page number to fetch.</td></tr><tr><td><code>perPage</code></td><td><code>Int</code></td><td>No</td><td>Number of results per page. Defaults to <code>10</code>.</td></tr><tr><td><code>filter</code></td><td><code>OrderHistoryFilter</code></td><td>No</td><td>Optional filters to narrow results.</td></tr></tbody></table>

#### OrderHistoryFilter Fields

<table><thead><tr><th width="163.5390625">Field</th><th width="201.95703125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>orderId</code></td><td><code>String</code></td><td>Filter by a specific order ID</td></tr><tr><td><code>status</code></td><td><code>P2PPaymentStatus</code></td><td>Filter by payment status</td></tr><tr><td><code>dateFrom</code></td><td><code>ISO8601Date</code></td><td>Start of date range</td></tr><tr><td><code>dateTo</code></td><td><code>ISO8601Date</code></td><td>End of date range</td></tr><tr><td><code>paymentMethod</code></td><td><code>String</code></td><td>Filter by payment method</td></tr></tbody></table>

Returns a `PaginatedP2PPayments` object containing a `data` array of `P2PPayment` records and a `pagination` object.

***

### Withdrawal Info

```graphql
query {
  withdrawalInfo(symbol: "USDC") {
    symbol
    name
    icon
    networks
  }
}
```

<table><thead><tr><th width="160">Argument</th><th width="104">Type</th><th width="94">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>symbol</code></td><td><code>String!</code></td><td><strong>Yes</strong></td><td>The asset symbol to fetch withdrawal info for (e.g. <code>"USDC"</code>, <code>"ETH"</code>).</td></tr></tbody></table>

Returns a `WithdrawalInfo` object — includes the asset `symbol`, `name`, `icon`, and supported `networks`.
