> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Create plan


`POST /v1/plans`

`interval` is one of `day`, `week`, `month`, `year`; unknown values are refused here rather than upstream. `intervalCount` is a positive integer, default 1.

One plan per unique `(amount, currency, interval, intervalCount)`: a matching request returns the existing plan with **200** — its `name` may differ from the one you sent. **201** means the plan was created.

Auth: a secret key with the `plans.create` permission. Returns `201` with Plan.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | Yes | A human-readable name. |
| `amount` | body | integer · integer · minor units | Yes | A non-negative integer in the currency’s minor unit. 4999 represents $49.99. |
| `currency` | body | string · ISO 4217 | Yes | A three-letter ISO 4217 currency code. |
| `interval` | body | string | Yes | How often the plan renews. |
| `intervalCount` | body | integer | No | Number of intervals between renewals. Defaults to 1. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/plans" \
  -H "Authorization: Bearer $MYELA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Standard monthly",
  "amount": 4999,
  "currency": "USD",
  "interval": "month",
  "intervalCount": 1
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/plans", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "name": "Standard monthly",
    "amount": 4999,
    "currency": "USD",
    "interval": "month",
    "intervalCount": 1
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import uuid
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/plans",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "name": "Standard monthly",
        "amount": 4999,
        "currency": "USD",
        "interval": "month",
        "intervalCount": 1
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique plan identifier. |
| `object` | "plan" | Stable resource discriminator. |
| `name` | string | Plan name. |
| `amount` | integer | Renewal amount in minor units. |
| `currency` | string | Three-letter currency code. |
| `interval` | string | Renewal interval. |
| `intervalCount` | integer | Intervals between renewals. |
| `createdAt` | string | ISO 8601 creation timestamp. |

```json
{
  "id": "plan_01JEXAMPLE",
  "object": "plan",
  "name": "Standard monthly",
  "amount": 4999,
  "currency": "USD",
  "interval": "month",
  "intervalCount": 1,
  "createdAt": "2026-08-10T20:49:51.653Z"
}
```

Source: https://docs.merchantservicedepot.com/api-reference/create-plan/
