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

Request

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

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

initialPurchaseDevicestring

Device or sales channel reported by the app store for the initial purchase. The value is stored in lower case with leading and trailing whitespace removed.

Minimum length: 1, maximum length: 50, counted on the value as sent, including surrounding spaces.

Must contain at least one non-whitespace character.

Response

201

Changes

No recorded changes to this operation across all 1 revision of this API.