v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Transfer subscription

Use this endpoint to transfer externally-managed subscriptions (EMS) - subscriptions whose life cycle is managed outside of Cleeng. <br><br> Subscription is transferred if there is already an active subscription in Cleeng that belongs to a customer with a different email address. Then a new subscription is created for the "new customer" (the one using the new email address) and the subscription assigned to the "old customer" (the one using the old email address) is terminated. <br><br> Note: For subscription transfer subscription resource payload should be returned in response with non-empty replacedBy property.

post/subscriptions/{subscriptionId}/transfer

Path parameters

subscriptionIdinteger required

Subscription identifier in Cleeng.

Headers

Content-Typestring

Request body

customerIdinteger

The identifier of Cleeng customer.

Response

200

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

Example response

{
  "subscriptionId": 222222222,
  "publisherId": 111111111,
  "customerId": 123456789,
  "status": "active",
  "dateFrom": 1696502765,
  "dateTo": 1700912767,
  "nextPaymentAction": "capture",
  "nextPaymentActionDate": 1700912767,
  "subscriptionExternalId": "CustomExternalId",
  "offerId": "S123456789_PL",
  "paymentCountry": "PL",
  "inTrial": true,
  "pendingSwitchId": "1fa12f34-1234-1234-b1fc-1c123f12afa1",
  "paymentMethodId": 987654321,
  "isExternallyManaged": true,
  "replacedBy": {
    "subscriptionId": 333333333,
    "reason": "transferred"
  },
  "originatedFrom": {
    "subscriptionId": 111111111,
    "reason": "string"
  },
  "source": "samsung",
  "renewalCycle": {
    "unit": "month",
    "amount": 3
  }
}