v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Create subscription

Use this endpoint to create externally-managed subscriptions - subscriptions whose lifecycle is managed outside of Cleeng. <br><br> You can create multiple subscriptions for the same offer and customer 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?).

post/subscriptions

Headers

Content-Typestring

Request body

customerIdinteger required

The identifier of Cleeng customer. Minimum: 100000000, maximum: 999999999.

offerIdstring required

The identifier of Cleeng offer. It must be offerId of a subscription offer.

paymentMethodIdinteger required

The identifier of the payment method configured for externally-managed subscriptions; provided by Cleeng.

externalIdstring 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).

expiresAtinteger

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.

inTrialboolean

Subscription trial status. The default value is false.

paymentIdinteger

The identifier of Cleeng payment. (Payment must be created with the same paymentMethodId as specified here).

Response

201