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

# List Payment Methods

> Fetch what payment methods are enabled for your account (crypto wallets, on-ramping, and fiat card).

# List Payment Methods

Use this endpoint to discover **what payment methods you can offer right now**.

When you call it, we return:

* Which method categories are enabled for your account (`crypto`, `ramping`, `fiat`)
* Your **crypto payment options** derived from your saved wallets (e.g. BTC, ETH, and stablecoins on ETH)
* Whether **on-ramping** is available and enabled
* Your **fiat card** method availability

This is perfect for powering your UI:

* show/hide crypto checkout
* show/hide “Buy crypto” (on-ramp) flows
* show/hide fiat card checkout

***

## Endpoint

`GET /api/payment-methods`

> This endpoint is protected. You must be authenticated.

***

## Authentication

This endpoint supports **two authentication methods**:

### 1) API Key (recommended for integrations)

Send your API key in the `x-api-key` header.

```bash theme={null}
curl -X GET "https://www.niftipay.com/api/payment-methods" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Accept: application/json"
```

### 2) Session cookie (browser / dashboard usage)

If you are authenticated via the dashboard.

> For browser calls, you usually don't need to add headers manually — the cookie is sent automatically.

***

## Response model

The response always includes:

* `enabled`: an array of enabled method categories for your account
* `methods`: crypto payment methods (derived from your wallets)
* `onRamping`: on-ramp availability (derived from environment configuration)
* `fiat`: fiat method availability (currently card)

### Enabled categories

`enabled` may include:

* `crypto` — enable crypto invoice checkout (wallet methods)
* `ramping` — enable on-ramp flows
* `fiat` — enable fiat card checkout

> If your account has no per-user settings stored, the system defaults to all categories enabled.

***

## Crypto methods: how they are built

When `crypto` is enabled, the API loads your saved wallets (`userWallet`) and derives display-friendly methods:

* For **BTC / LTC / SOL / XRP**: 1 method per wallet (asset = chain)
* For **ETH**: 3 methods per wallet:
  * `ETH`
  * `USDT` on ETH
  * `USDC` on ETH

Each crypto method includes:

| Field     | Type   | Notes                                                 |
| --------- | ------ | ----------------------------------------------------- |
| `chain`   | string | One of `BTC`, `LTC`, `ETH`, `SOL`, `XRP`.             |
| `asset`   | string | `BTC/LTC/ETH/SOL/XRP` or `USDT/USDC` (only on `ETH`). |
| `address` | string | The deposit address used at checkout.                 |
| `label`   | string | UI-friendly label (e.g. `USDT on ETH`).               |

***

## Fiat methods

When `fiat` is enabled, the API currently returns:

* `Card payment (fiat)` with `enabled: true`

Each fiat method includes:

| Field     | Type    | Notes                                              |
| --------- | ------- | -------------------------------------------------- |
| `kind`    | string  | Currently always `card`.                           |
| `label`   | string  | UI label.                                          |
| `enabled` | boolean | Whether fiat checkout is enabled for your account. |

***

# Examples

## Example 1 — Everything enabled (typical)

```bash theme={null}
curl -X GET "https://www.niftipay.com/api/payment-methods" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Example response

```json theme={null}
{
  "enabled": ["crypto", "ramping", "fiat"],
  "methods": [
    { "chain": "BTC", "asset": "BTC", "address": "bc1qexample...", "label": "BTC" },

    { "chain": "ETH", "asset": "ETH",  "address": "0xabc123...", "label": "ETH" },
    { "chain": "ETH", "asset": "USDT", "address": "0xabc123...", "label": "USDT on ETH" },
    { "chain": "ETH", "asset": "USDC", "address": "0xabc123...", "label": "USDC on ETH" },

    { "chain": "SOL", "asset": "SOL", "address": "SoLanaAddress...", "label": "SOL" }
  ],
  "onRamping": {
    "enabled": true
  },
  "fiat": [
    { "kind": "card", "label": "Card payment (fiat)", "enabled": true }
  ]
}
```

***

## Example 2 — Crypto disabled for this user

In this case, you might hide crypto checkout, but still show on-ramp and fiat checkout.

### Example response

```json theme={null}
{
  "enabled": ["ramping", "fiat"],
  "methods": [],
  "onRamping": {
    "enabled": true
  },
  "fiat": [
    { "kind": "card", "label": "Card payment (fiat)", "enabled": true }
  ]
}
```

***

## Example 3 — Ramping not configured

If on-ramping is not enabled for your account, `onRamping.enabled` will be `false`. You can hide the on-ramp section in your UI.

### Example response

```json theme={null}
{
  "enabled": ["crypto", "fiat"],
  "methods": [
    { "chain": "LTC", "asset": "LTC", "address": "ltc1qexample...", "label": "LTC" }
  ],
  "onRamping": {
    "enabled": false
  },
  "fiat": [
    { "kind": "card", "label": "Card payment (fiat)", "enabled": true }
  ]
}
```

***

## Example 4 — Fiat disabled for this user

In this case, you might hide card checkout and only allow crypto and/or ramping.

### Example response

```json theme={null}
{
  "enabled": ["crypto", "ramping"],
  "methods": [
    { "chain": "XRP", "asset": "XRP", "address": "rExample...", "label": "XRP" }
  ],
  "onRamping": {
    "enabled": true
  },
  "fiat": []
}
```
