# List channels

`GET https://api.weavpayments.com/v1/channels`

Every channel and whether your account can use it now (allowed by Weav and switched on by you).

It also shows your payment limits. `maintenance` is always `null` for now. Creating a payment on a channel that is off returns `422` with code `4220101`.

## Headers

- `Authorization` (string, required): `Bearer` plus your API key. See [Authentication](https://docs.weavpayments.com/authentication).

## Responses

### 200 OK

All channels.

What `data` holds:

- `payment_limits` (array of objects): The smallest and largest payment you can create, per currency. Null means no limit.
  - `currency` (string): ISO 4217. PHP today; more as they're enabled for your account. One of: `PHP`.
  - `min_amount` (number | null)
  - `max_amount` (number | null)
- `channels` (array of objects)
  - `channel` (string): The value you send when creating a payment. One of: `QR_PH`, `GCASH`, `MAYA`, `CARD`, `PAY_AND_GO`, `PALAWANPAY`, `BAYAD`.
  - `name` (string)
  - `is_enabled` (boolean): Whether new payments can use it (allowed by Weav and switched on by you).
  - `apps` (array of objects): QR Ph only. The bank and e-wallet apps you can send as `qr_ph_app`. Empty for other channels.
    - `code` (string)
    - `name` (string)
  - `maintenance` (object | null): Always null for now. Scheduled maintenance windows aren't shown here yet.

```json
{
    "code": "2000000",
    "success": true,
    "message": "OK",
    "data": {
        "payment_limits": [
            {
                "currency": "PHP",
                "min_amount": 0.01,
                "max_amount": 50000.0
            }
        ],
        "channels": [
            {
                "channel": "QR_PH",
                "name": "QR Ph",
                "is_enabled": true,
                "apps": [
                    {
                        "code": "BDO",
                        "name": "BDO Pay"
                    },
                    {
                        "code": "CHINABANK",
                        "name": "Chinabank"
                    },
                    {
                        "code": "GOTYME",
                        "name": "GoTyme"
                    },
                    {
                        "code": "LANDBANK",
                        "name": "LANDBANK"
                    },
                    {
                        "code": "METROBANK",
                        "name": "Metrobank"
                    },
                    {
                        "code": "PNB",
                        "name": "PNB"
                    },
                    {
                        "code": "RCBC",
                        "name": "RCBC"
                    },
                    {
                        "code": "ROBINSONS_BANK",
                        "name": "Robinsons Bank"
                    },
                    {
                        "code": "SECURITY_BANK",
                        "name": "Security Bank"
                    },
                    {
                        "code": "UNIONBANK",
                        "name": "UnionBank"
                    },
                    {
                        "code": "GRABPAY",
                        "name": "GrabPay"
                    },
                    {
                        "code": "SHOPEEPAY",
                        "name": "ShopeePay"
                    }
                ],
                "maintenance": null
            },
            {
                "channel": "GCASH",
                "name": "GCash",
                "is_enabled": true,
                "apps": [],
                "maintenance": null
            },
            {
                "channel": "MAYA",
                "name": "Pay with Maya",
                "is_enabled": true,
                "apps": [],
                "maintenance": null
            },
            {
                "channel": "CARD",
                "name": "Credit or debit card",
                "is_enabled": false,
                "apps": [],
                "maintenance": null
            },
            {
                "channel": "PAY_AND_GO",
                "name": "Pay & Go",
                "is_enabled": true,
                "apps": [],
                "maintenance": null
            },
            {
                "channel": "PALAWANPAY",
                "name": "PalawanPay",
                "is_enabled": true,
                "apps": [],
                "maintenance": null
            },
            {
                "channel": "BAYAD",
                "name": "Bayad",
                "is_enabled": true,
                "apps": [],
                "maintenance": null
            }
        ]
    }
}
```

### 401 Unauthorized

Missing, malformed or unknown API key (code 4010000).

```json
{
    "code": "4010000",
    "success": false,
    "message": "Missing or invalid API key."
}
```

### 403 Forbidden

The key can't make this request (code 4030000): an address outside the key's IP allowlist, a live key before your live mode is on, or an account that isn't active. A live key sent from a browser is refused (code 4030001): keep live keys on your server.

```json
{
    "code": "4030000",
    "success": false,
    "message": "Requests with this key must come from an address on its allowlist."
}
```

## Examples

cURL:

```shell
curl -X GET https://api.weavpayments.com/v1/channels \
    -H "Authorization: Bearer $WEAV_API_KEY"
```

Node.js:

```js
const url = 'https://api.weavpayments.com/v1/channels';
const response = await fetch(url, {
    method: 'GET',
    headers: {
        Authorization: `Bearer ${process.env.WEAV_API_KEY}`,
    },
});

const result = await response.json();
```

JavaScript:

```js
import axios from 'axios';

const response = await axios.request({
    method: 'get',
    url: 'https://api.weavpayments.com/v1/channels',
    headers: {
        Authorization: `Bearer ${process.env.WEAV_API_KEY}`,
    },
    // Read error answers too: their body has the error code.
    validateStatus: () => true,
});

const result = response.data;
```

PHP:

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(config('services.weav.key'))
    ->get('https://api.weavpayments.com/v1/channels');

$result = $response->json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.weavpayments.com/v1/channels",
    headers={
        "Authorization": f"Bearer {os.environ['WEAV_API_KEY']}",
    },
    timeout=30,
)

result = response.json()
```

Go:

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
)

func main() {
    req, err := http.NewRequest("GET", "https://api.weavpayments.com/v1/channels", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer "+os.Getenv("WEAV_API_KEY"))

    res, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()

    result, err := io.ReadAll(res.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println(res.Status, string(result))
}
```

Rust:

```rust
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let key = std::env::var("WEAV_API_KEY")?;

    let response = reqwest::blocking::Client::new()
        .get("https://api.weavpayments.com/v1/channels")
        .bearer_auth(key)
        .send()?;

    let status = response.status();
    let result: serde_json::Value = response.json()?;
    println!("{status} {result:#}");
    Ok(())
}
```

Java:

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class WeavExample {
    public static void main(String[] args) throws Exception {
        String url = "https://api.weavpayments.com/v1/channels";
        HttpRequest request =
                HttpRequest.newBuilder()
                        .uri(URI.create(url))
                        .header("Authorization", "Bearer " + System.getenv("WEAV_API_KEY"))
                        .GET()
                        .build();

        HttpResponse<String> response =
                HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```
