# Get available plans

- Sandbox: `GET https://sandbox.payme.io/api/public/plans`
- Production: `GET https://live.payme.io/api/public/plans`

## Credentials

- Header `Authorization: Bearer <token>`

Retrieve all available plans for the authenticated partner. Free trial and No Cost plans are excluded.

## Parameters

This endpoint takes no path, query or header parameters.

## Code samples

### curl

```bash
curl -X GET 'https://sandbox.payme.io/api/public/plans' \
  -H 'Authorization: Bearer <YOUR_TOKEN>'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/public/plans", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_TOKEN>",
  },
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.get(
    "https://sandbox.payme.io/api/public/plans",
    headers={
        "Authorization": "Bearer <YOUR_TOKEN>",
    },
)

print(response.text)
```

### PHP

```php
<?php

$ch = curl_init('https://sandbox.payme.io/api/public/plans');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <YOUR_TOKEN>',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — Plans retrieved successfully (success)

| Field | Type | Description |
| --- | --- | --- |
| `payload` | object |  |
| `payload.items` | array |  |
| `payload.items[].id` | string | Unique identifier for the plan |
| `payload.items[].name` | string | Display name of the plan |
| `payload.items[].price` | number | Plan price in the partner's currency |

```json
{
  "payload": {
    "items": [
      {
        "id": "90abd0eb-c374-4a2b-829e-681fba0cdbee",
        "name": "PaturBasic",
        "price": 39.9
      },
      {
        "id": "29b1f228-c779-4de3-bb99-aa8e34f29ddc",
        "name": "PaturPremium",
        "price": 105
      },
      {
        "id": "3d653770-6376-40a5-b98e-17c598f1d7d8",
        "name": "MursheBasic",
        "price": 39.9
      },
      {
        "id": "c2249657-fe98-49ae-950a-3bdf28cdbfee",
        "name": "MurshePremium",
        "price": 228
      }
    ]
  }
}
```

### 401 — Unauthorized (error)

| Field | Type | Description |
| --- | --- | --- |
| `error` | string |  |
| `error_description` | string |  |

```json
{
  "error": "unauthorized_client",
  "error_description": "Client authentication failed"
}
```
