---
title: "Create Subscription"
method: POST
path: "/admin/payers/{user_id}/subscription"
tags: ["subscriptions"]
---

# Create Subscription

`POST /admin/payers/{user_id}/subscription`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/admin/payers/{user_id}/subscription`
- Auth: none declared

Record a subscription window. **Overlaps are refused by the database.**

The EXCLUDE constraint is what makes "the current subscription" a well-defined
question: two windows covering one instant would be two answers with nothing to say
which binds.

## Path parameters

- `user_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- SubscriptionIn: Record a subscription window. **Recording, not billing** — no money moves here.
  - `plan_code` string, required
  - `price_amount` union, required
    - number
    - string
  - `list_price_amount` union
    - number
    - string
  - `discount_amount` union
    - number
    - string
  - `billing_interval` string
  - `promo_code` string, nullable
  - `referral_code` string, nullable
  - `monthly_limit` integer, required
  - `valid_from` string, date-time, required
  - `valid_to` string, date-time, nullable
  - `note` string, nullable

## Response `201`

Successful Response

- SubscriptionOut
  - `id` string, required
  - `payer_user_id` string, required
  - `plan_code` string, required
  - `price_amount` string, required
  - `list_price_amount` string, required
  - `discount_amount` string, required
  - `currency` string, required
  - `billing_interval` string, required
  - `promo_code` string, nullable
  - `referral_code` string, nullable
  - `monthly_limit` integer, required
  - `valid_from` string, date-time, required
  - `valid_to` string, date-time, nullable
  - `note` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zeno-works/apis/zeno-api.md) · [All operations](https://skmtc.dev/zeno-works/apis/zeno-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zeno-works/apis/zeno-api/revisions/1eb93dde146c?raw)
