---
title: "Create subscription"
method: POST
path: "/subscriptions"
---

# Create subscription

`POST /subscriptions`

Use this endpoint to create [externally-managed subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions) - subscriptions whose lifecycle is managed outside of Cleeng. <br><br> You can create [multiple subscriptions for the same offer and customer](https://developers.cleeng.com/docs/externally-managed-subscriptions#multiple-subscriptions-per-offer) with this endpoint. But the endpoint prevents duplicate subscriptions with the same external ID and source. It only allows new subscriptions if there isn't already an active subscription from the same source and with the same external ID. <br><br> **Important** <br> This endpoint can only be used for creating subscriptions (offers with recurring payments). It **cannot be used for one-time payment offers** such as passes, live events (previously called live pay-per-view), or one-time purchase (previously called TVOD). (For more information on offers, see [What is a Cleeng offer?](https://publisher.support.cleeng.com/hc/en-us/articles/360012552919-What-is-a-Cleeng-offer)).

## Headers

- `Content-Type` string

## Request body

- object
  - `customerId` integer, required — The identifier of Cleeng customer. Minimum: `100000000`, maximum: `999999999`.
  - `offerId` string, required — The identifier of Cleeng offer. It must be `offerId` of a subscription offer.
  - `paymentMethodId` integer, required — The identifier of the payment method configured for externally-managed subscriptions; provided by Cleeng.
  - `externalId` string, required — The external identifier of a subscription. The identifier must be unique for a given payment method (i.e. you can't have two identical identifiers for the same payment method).
  - `expiresAt` integer — Expiration time in UNIX timestamp format. If not provided, the subscription will have its expiration date set in the following way: it will be pushed from the current time by offer cycle length.
  - `inTrial` boolean — Subscription trial status. The default value is `false`.
  - `externalProperties` object — Any properties of a subscription.
    - `property1` string — Example property
  - `paymentId` integer — The identifier of Cleeng payment. (Payment must be created with the same `paymentMethodId` as specified here).

## Response `201`

201

## Other responses

- `400` — 400
- `409` — Conflict
- `422` — 422

---

[API](https://skmtc.net/cleeng/apis/mediastore-api.md) · [All operations](https://skmtc.net/cleeng/apis/mediastore-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cleeng/mediastore-api/versions/00cbfe7998a4/schema)
