# Create subscription group

`POST https://rcur.app/api/v2/subscription-groups`

## Request body

Name is required. Plans is optional and can be set later.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no |  |
| `description` | string | no | Only for yourself, customers do not see it |
| `plans` | array of objects | no | The complete list of templates in the group, in the order customers see them |
| `plans[].template_id` | string | yes | Id of a subscription template |
| `plans[].plan_name` | string | no | Name shown in the customer portal when switching, the template name when empty |
| `plans[].plan_description` | string | no | Text shown in the customer portal when switching |

## Example request

```bash
curl -X POST https://rcur.app/api/v2/subscription-groups \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Groentebox",
  "description": "string",
  "plans": [
    {
      "template_id": "aB3dE5fG7h",
      "plan_name": "Klein",
      "plan_description": "string"
    }
  ]
}'
```

## Responses

### 201 Subscription group created

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `name` | string | yes |  |
| `description` | string | no | Only for yourself, customers do not see it |
| `plans` | array of SubscriptionTemplates | yes | The templates a subscription of the group can be switched between, in the order customers see them |
| `plans[].id` | string | yes |  |
| `plans[].name` | string | yes | Name of the template |
| `plans[].description` | string | no | Description the subscriptions made from the template get |
| `plans[].currency` | string | yes |  |
| `plans[].group_id` | string | no | The subscription group the template is in |
| `plans[].plan_name` | string | no | Name shown in the customer portal when switching |
| `plans[].plan_description` | string | no | Text shown in the customer portal when switching |
| `plans[].rules` | array of SubscriptionRules | yes |  |
| `plans[].rules[].id` | string | yes |  |
| `plans[].rules[].amount` | string | yes |  |
| `plans[].rules[].currency` | string | yes | One of: `AED`, `AUD`, `BGN`, `BRL`, `CAD`, `CHF`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `ILS`, `ISK`, `JPY`, `MXN`, `MYR`, `NOK`, `NZD`, `PHP`, `PLN`, `RON`, `SEK`, `SGD`, `THB`, `TWD`, `USD`, `ZAR`. |
| `plans[].rules[].interval` | string | yes | One of: `day`, `week`, `month`, `year`. |
| `plans[].rules[].interval_amount` | integer | yes |  |
| `plans[].rules[].day` | integer | yes |  |
| `plans[].rules[].times` | integer | no |  |
| `plans[].rules[].times_done` | integer | yes |  |
| `created_at` | string | yes |  |

```json
{
    "id": "xY1zA2bC3d",
    "name": "Groentebox",
    "description": null,
    "plans": [
        {
            "id": "aB3dE5fG7h",
            "name": "Groentebox klein",
            "description": "Groentebox klein, wekelijks",
            "currency": "EUR",
            "group_id": "xY1zA2bC3d",
            "plan_name": "Klein",
            "plan_description": null,
            "rules": [
                {
                    "id": "rule_abc123",
                    "amount": "29.99",
                    "currency": "EUR",
                    "interval": "month",
                    "interval_amount": 1,
                    "day": 1,
                    "times": 12,
                    "times_done": 3
                }
            ]
        }
    ],
    "created_at": "2026-10-31 10:00:00"
}
```

### 422 Validation error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | integer | yes |  |
| `error` | string | yes |  |
| `fields` | object | no |  |

```json
{
    "status": 422,
    "error": "Could not process request. Some fields contain invalid data",
    "fields": {
        "email": [
            "The email field is required."
        ]
    }
}
```
