v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Revive subscription

This endpoint is used to revive terminated externally-managed subscriptions (EMS) - subscriptions whose life cycle is managed outside of Cleeng. <br><br> A terminated externally managed subscription is revived by creating a new subscription based on the terminated one. <br><br> The data is copied from the terminated subscription (e.g. original purchase date, payment details), however, the old expiration date will be overriden if a new one is provided.<br><br> Note: You can only revive terminated subscriptions. <br><br> For subscription revival subscription resource payload should be returned in response with non-empty replacedBy property.

post/subscriptions/{subscriptionId}/revive

Path parameters

subscriptionIdinteger required

Subscription identifier in Cleeng.

Headers

Content-Typestring
X-Publisher-Tokenstring required

Request body

expirationDateinteger required

Expiration time in UNIX timestamp format.

paymentIdinteger

The identifier of Cleeng payment.

Response

200

subscriptionIdinteger
paymentDetailsIdinteger
publisherIdinteger
customerIdinteger
statusstring
dateFrominteger
dateTointeger
nextPaymentActionstring
nextPaymentActionDateinteger
subscriptionExternalIdstring
offerIdstring
paymentCountrystring
{"stackTrail":"paths:/subscriptions/{subscriptionId}/revive:post:responses:200:content:application/json:schema:properties:ipAddress","oasType":"schema","type":"unknown"}
inTrialboolean
{"stackTrail":"paths:/subscriptions/{subscriptionId}/revive:post:responses:200:content:application/json:schema:properties:couponCode","oasType":"schema","type":"unknown"}
pendingSwitchIdstring
externalPropertiesobject
paymentMethodIdinteger
isExternallyManagedboolean
sourcestring
{"stackTrail":"paths:/subscriptions/{subscriptionId}/revive:post:responses:200:content:application/json:schema:properties:terminationType","oasType":"schema","type":"unknown"}

Example response

{
  "subscriptionId": 222222222,
  "paymentDetailsId": 876543210,
  "publisherId": 111111111,
  "customerId": 123456789,
  "status": "active",
  "dateFrom": 1696502765,
  "dateTo": 1700912767,
  "nextPaymentAction": "capture",
  "nextPaymentActionDate": 1700912767,
  "subscriptionExternalId": "CustomExternalId",
  "offerId": "S123456789_PL",
  "paymentCountry": "PL",
  "inTrial": true,
  "pendingSwitchId": "1ab23c45-4678-9123-d4ef-5g678h91ijk1",
  "paymentMethodId": 987654321,
  "isExternallyManaged": true,
  "replacedBy": {
    "subscriptionId": 333333333,
    "reason": "revival"
  },
  "originatedFrom": {
    "subscriptionId": 111111111,
    "reason": "string"
  },
  "source": "samsung",
  "renewalCycle": {
    "unit": "month",
    "amount": 3
  }
}