v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Terminate subscription

Use this endpoint to terminate a subscription.

post/subscriptions/{subscriptionId}/terminate

Path parameters

subscriptionIdinteger required

Subscription identifier in Cleeng.

Headers

Content-Typestring

Request body

terminationType'paymentCancel' | 'userCancel' | 'publisherCancel' | 'policyViolation' required

One of following: <br> - paymentCancel - when terminating as a result of failed payment <br> - userCancel - when terminating as a result of user cancellation <br> - publisherCancel - when the decision to cancel comes from a publisher <br> - policyViolation - when terminating as a result of policy violation . <br><br> These values are used to drive churn analytics in the Cleeng dashboard.

Response

200

subscriptionIdinteger
paymentDetailsIdinteger
publisherIdinteger
customerIdinteger
statusstring
dateFrominteger
dateTointeger
nextPaymentActionstring
nextPaymentActionDateinteger
{"stackTrail":"paths:/subscriptions/{subscriptionId}/terminate:post:responses:200:content:application/json:schema:properties:subscriptionExternalId","oasType":"schema","type":"unknown"}
offerIdstring
paymentCountrystring
ipAddressstring
inTrialboolean
couponCodestring
pendingSwitchIdstring
externalPropertiesobject
paymentMethodIdinteger
isExternallyManagedboolean
sourcestring
terminationTypestring

Example response

{
  "subscriptionId": 1999999999,
  "paymentDetailsId": 999999999,
  "publisherId": 999999999,
  "customerId": 999999999,
  "status": "terminated",
  "dateFrom": 1,
  "dateTo": 1,
  "nextPaymentAction": "capture",
  "nextPaymentActionDate": 1,
  "offerId": "string",
  "paymentCountry": "string",
  "ipAddress": "string",
  "inTrial": true,
  "couponCode": "string",
  "pendingSwitchId": "1fa12f34-1234-1234-b1fc-1c123f12afa1",
  "isExternallyManaged": true,
  "replacedBy": {
    "subscriptionId": 1999999999,
    "reason": "string"
  },
  "originatedFrom": {
    "subscriptionId": 1999999999,
    "reason": "string"
  },
  "source": "string",
  "renewalCycle": {
    "unit": "month",
    "amount": 3
  },
  "terminationType": "publisherCancel"
}