Update customer's subscription

Changed on

Use /customers/:customerId/subscriptions endpoint to update customer's subscription. With this endpoint, customers can unsubscribe plans with cancellation reasons or resubscribe plans. Resubscribe is possible if the billing period is pending. In case of unsubscribing with cancellation reason you will see them in the subscribers report in Cleeng Dashboard.

patch/customers/{customerId}/subscriptions

Request

  • Base URL
    https://mediastoreapi-sandbox.cleeng.com
  • URL
    https://mediastoreapi-sandbox.cleeng.com/customers/{customerId}/subscriptions
  • Auth
    API key in header Authorization

Path parameters

customerIdstring required

Customer identifier at Cleeng

Request body

offerIdstring required

ID of subscription to update, e.g. S123123123_US

statusstring required

New subscription status. One of: active, cancelled, terminated

cancellationReasonstring

Customer cancellation reason (value depends on your implementation). Max 100 characters. In case of subscription is being terminated reason will be stored in the subscribers report

Response

200

Example response

{
  "responseData": {
    "offerId": "S582933670_ZW",
    "status": "cancelled",
    "expiresAt": 1587035728
  }
}

Changes