---
title: "Close Subscription"
method: PUT
path: "/admin/payers/{user_id}/subscription/{subscription_id}"
tags: ["subscriptions"]
---

# Close Subscription

`PUT /admin/payers/{user_id}/subscription/{subscription_id}`

## 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/{subscription_id}`
- Auth: none declared

Close an open window, or move its end. **The remedy the 409 already names.**

Without it the first window recorded for a payer is open-ended for ever: every later
window is refused by the EXCLUDE constraint with a body saying "close the current one
first", and nothing in the API could. A plan upgrade, a promo retirement and a price
rise — the three things this table exists for — were all impossible after the first
record.

## Path parameters

- `user_id` string, required
- `subscription_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- SubscriptionClose: Move a window's end. The remedy the overlap 409 names — and, before this, did not exist anywhere in the API.
  - `valid_to` string, date-time, required

## Response `200`

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)
