> For the complete documentation index, see [llms.txt](https://docs.cashramp.co/cashramp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cashramp.co/cashramp/cashramp-api/queries.md).

# Queries

The Cashramp API provides read-only queries to fetch essential data like payment rails, exchange rates, and transaction status.

## Geography & Payment Rails

### Available Countries

```graphql
query {
  availableCountries {
    id
    name # "Nigeria"
    code # "NG"
  }
}
```

Returns every country that Cashramp currently supports.

***

### P2P Payment-Method Types

```graphql
query {
  p2pPaymentMethodTypes(
    country: "VHlwZXM6OkNvdW50cnktN2FhZjdlYjEtODIwYi00YzA4LWIyM2ItODFlN2FjMTQyYmI0"
  ) {
    id
    identifier # "mtn_momo_gh"
    label # "MTN Mobile Money"
    fields {
      label # "Phone Number"
      identifier # "phone_number"
      required # true
    }
  }
}
```

Render the `fields` array as input controls when you save a customer’s payout rail.

***

## Rates & Limits

### Indicative Market Rate

```graphql
query {
  marketRate(countryCode: "NG") {
    depositRate # Local-currency → USD
    withdrawalRate # USD → Local-currency
  }
}
```

{% hint style="warning" %}
These figures are **indicative only**. The final FX rate is locked when an agent picks up the payment request.
{% endhint %}

***

### Ramp Limits

```graphql
query {
  rampLimits {
    minimumDepositUsd
    minimumWithdrawalUsd
    maximumDepositUsd
    maximumWithdrawalUsd
    dailyLimitUsd
  }
}
```

***

## Assets

### Rampable Assets

```graphql
query {
  rampableAssets {
    name # "USD Coin"
    symbol # "USDC"
    networks # ["CELO", "OP", "BASE"]
    contractAddress # "0x..."
  }
}
```

List of stablecoins and networks currently supported for on-chain ramps.

***

### Withdrawable Assets

```graphql
query {
  withdrawableAssets(caller: default) { # or ramp
    symbol # "USDT" | "USDC" | "CUSD"
    name # "Tether USD"
    icon
    networks {
      network # "CELO"
      name # "Celo"
      contractAddress
      fee # USD network fee
      minWithdrawal
      maxWithdrawal
      precision
      addressRegex
    }
  }
}
```

The stablecoins you can send onchain, with each network's token contract, limits and fee.

| Argument | Type                  | Required | Description                                                                                                                                                                                                                                          |
| -------- | --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `caller` | `WithdrawalFeeCaller` | No       | `default` returns the fees [`withdrawOnchain`](https://docs.cashramp.co/cashramp/cashramp-api/withdraw-onchain.md) charges. `ramp` returns the fees charged when Cashramp delivers a deposit onchain (`onchainTransferInfo`). Defaults to `default`. |

See [Supported Assets](https://docs.cashramp.co/cashramp/introduction/supported-assets.md) for the full list of tokens and networks.

***

## Transaction Status

### Payment Request by Reference

```graphql
query {
  merchantPaymentRequest(reference: "test_ref_1") {
    id
    paymentType # deposit | withdrawal
    hostedLink
    amount
    currency
    reference
    metadata
    status # created | picked_up | completed | canceled
  }
}
```

Poll or verify a webhook by cross-checking the `status`.

***

### Onchain Withdrawal

```graphql
query {
  onchainWithdrawal(
    id: "VHlwZXM6Ok9uY2hhaW5UeC0zOWNjMTgwZi1hOGM0LTRmNzYtYmVkZC01YjU3M2M2NjEwNTg="
  ) {
    quantity
    symbol # "USDC"
    network # "OP"
    address
    txhash
    txhashUrl
    fee
    status # pending | completed | failed
    createdAt
  }
}
```

***

## Account Snapshot

```graphql
query {
  account {
    id
    accountBalance # USD-denominated
    depositAddress # Your Cashramp onchain deposit address
  }
}
```
