Create subscription

Use this endpoint to create externally-managed subscriptions. The life cycle of externally-managed subscriptions is managed outside of Cleeng so it is up to a broadcaster to notify Cleeng about subscription status changes (e.g. subscription termination).

🚧

Important

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 pay-per-view, or TVOD. (For more information on offers, see What is a Cleeng offer?).

Response description

ResponseTypeDescription
subscriptionIdintegerSubscription identifier in Cleeng.
publisherIdintegerThe identifier of broadcaster (publisher) in Cleeng.
customerIdintegerThe identifier of Cleeng customer.
statusstringThe current status of a subscription. Allowed values: active, stopped, terminated.
dateFromintegerStart of a subscription period (in UNIX timestamp format).
dateTointegerEnd of a subscription period (in UNIX timestamp format).
subscriptionExternalIdstringThe external identifier of a subscription.
offerIdstringThe identifier of Cleeng offer, e.g. S123123123_US.
paymentCountrystringThe country of the last payment.
ipAddressstringThe last IP address of a customer.
inTrialbooleanSubscription trial status.
couponCodestringApplied coupon code.
coupon deprecatedobjectAn object with discountRate and usageLeft properties.
-discountRatenumberOffer discount, e.g. 0.1 means 10% discount. Allowed values: 0.01 - 1.
-usageleftintegerThe number of times left that a customer can enter the coupon code.
pendingSwitchIdstringThe identifier of a subscription switch (upgrade or downgrade) with status pending (the status of the switch between the subscription switch request and the actual switch processing).
paymentMethodIdintegerThe identifier of the payment method, provided by Cleeng.
paymentDetailsIdintegerThe identifier of Cleeng payment details connected to Cleeng customer. Here: null.
nextPaymentActionstringA kind of the next payment action, either authorisation or capture.
nextPaymentActionDateintegerThe date of the next payment action (authorisation or capture) (in UNIX timestamp format).
externalPropertiesobjectExternal properties that can be used to store additional metadata from the external system, ex. partnerID, externalProductId, partnerCode, etc.
isExternallyManagedbooleanWhether a subscription is externally-managed or not.
replacedByAn object with properties that refer to processes where one subscription replaces another one. Subscription resource payload will be returned in response with non-empty replacedBy property after a subscription revival and transfer.
- subscriptionIdintegerSubscription identifier in Cleeng. The identifier of a new subscription (transferred or revived).
- reasonstringReason for subscription replacement: transfer if a subscription has been transferred or revival if a subscription has been revived.
- dateintegerThe date of subscription replacement (in UNIX timestamp format).
originatedFromAn object with properties that refer to processes where one subscription replaces another one.
- subscriptionIdintegerSubscription identifier in Cleeng. The identifier of the previous subscription - the one that has been transferred or revived.
- reasonstringReason for subscription replacement: transfer if a subscription has been transferred or revival if a subscription has been revived.
- dateintegerThe date of subscription replacement (in UNIX timestamp format).
renewalCycleAn object with properties that refer to a subscription renewal cycle.
- completedintegerThe number of completed renewal cycles - it specifies how many times a given subscription has been renewed.

At subscription creation, the number defaults to zero and is further increased by one after each subscription renewal, including uses of 100% coupons.
- unitstringA unit of a subscription renewal cycle, one of day, week, month, year, season.
- amountintegerThe number of subscription renewal cycle units. The value is always >= 1.

For example, for a monthly subscription it is 1 (unit / amount: month / 1), for a 6-month subscription it is 6 (unit / amount: month / 6).
Language
Authorization
Header
Click Try It! to start a request and see the response here!