---
title: "Update subscription"
method: PATCH
path: "/subscriptions/{subscriptionId}"
---

# Update subscription

`PATCH /subscriptions/{subscriptionId}`

## Request

- Base URL: `https://api.sandbox.cleeng.com/3.1`
- URL: `https://api.sandbox.cleeng.com/3.1/subscriptions/{subscriptionId}`
- Auth: API key in header `X-Publisher-Token`

Use this endpoint to update an existing subscription, for example apply a coupon or to update payment details.

## Path parameters

- `subscriptionId` string, required

## Headers

- `Content-Type` string

## Request body

- object
  - `status` 'active' | 'stopped' | 'terminated': Subscription status. <span style="color:red">**Deprecated**</span> <br> To change subscription status, use the following endpoints: <br> - [Activate subscription](https://developers.cleeng.com/reference/activate-subscription) <br> - [Cancel subscription](https://developers.cleeng.com/reference/cancel-subscription) <br> - [Terminate subscription](https://developers.cleeng.com/reference/terminate-subscription)
  - `couponCode` string: Coupon code
  - `expiresAt` integer: Expiration time in unix timestamp. <br><br> For <<glossary:Cleeng-managed subscriptions>> this value can't be in the past and it can't be earlier than the originally set value. (You can't shorten a Cleeng-managed subscription.) <br><br> For <<glossary:externally-managed subscriptions>>, these restrictions do not apply, and external systems that manage such subscriptions have full control over the expiration date.
  - `paymentDetailsId` integer: The identifier of Cleeng payment details connected to Cleeng customer. If you change this parameter, next renewals will be done with the new payment details ID.
  - `inTrial` boolean: Subscription trial status.
  - `externalProperties` object
    - `property1` string: Example property
  - `subscriptionExternalId` string: An external identifier of an **externally-managed subscription**. - Max length: 512 characters - Must not be empty string - Must be unique per customer and platform - cannot duplicate an external ID already used by another active, stopped or paused subscription of the same customer on the same platform (terminated subscriptions are not considered) - Nullable: no

## Response `200`

200

## Other responses

- `404`: Not Found
- `409`: Conflict
- `422`: 422

---

[API](https://skmtc.dev/cleeng/apis/api-31.md) - [All operations](https://skmtc.dev/cleeng/apis/api-31/llms.txt) - [OpenAPI document](https://skmtc.dev/cleeng/apis/api-31/revisions/df55396cda4f?raw)
