Cancel the billing plan for a specified client account.

Only authorized technology partners have access to partner endpoints. To make authorized calls to partner endpoints, you must include your API key in the x-api-key header and the JSON Web Token (JWT) in the Authorization header. The JWT automatically expires in one hour (3,600 seconds) and cannot be refreshed. You must re-authenticate each time a JWT expires.

Make a PUT call to the /partner/accounts/{encoded_account_id}/status/cancel endpoint to cancel a billing plan for a specified client account under your partner account.

The response body includes the date that the client account is canceled (effective_date) and the reason for canceling the client account (if a code was specified in the request body). For example:

{
   "effective_date": "2020-07-09T22:09:15.000Z",
   "reason_id": 1
}

To get canceled client accounts, make a GET call to the /partner/accounts endpoint and locate accounts with "billing_status": "Canceled") in the response results. For example:

{
   "encoded_account_id": "a07e1lxbq0e0",
   "subscriber_count": 0,
   "organization_name": "my_partner_child56",
   "site_owner_name": "my_partner_child83",
   "billing_status": "Canceled"
}

To reactivate a canceled client account, make a PUT call to the partner/accounts/{encoded_account_id}/plan endpoint and include the plan_type to assign to the account (cannot be TRIAL). The response body results show the updated billing plan details for the client account, including the change in billing_status from Canceled to Open.

Parameters

The following header parameters are required:

  • x-api-key: Enter the API key associated with your application.
  • Authorization: Enter the JWT to use.

The client’s encoded account ID {encoded_account_id} is required as a path parameter. In the request body, you can optionally specify a future cancellation date (effective_date in ISO format) as the date and time to cancel the client account, and the reason (reason_code) that for canceling the account. By default, if no effective_date is specified or a past date and time is specified, the system uses the current date and time. You can specify one of the following reasons (reason_code) for canceling the account:

  • 1 Cost Too High
  • 2 Using A Competitive Service
  • 3 Not Doing Email Marketing
  • 11 Something Missing Or Not Working
  • 12 Doing It In-House
  • 14 Poor Results
  • 21 Too Difficult To Use
  • 27 Canceled Online by Customer
  • 30 Dissatisfied With Billing Policies

If the specified client account or technology partner account does not exist, the system returns a 404 error response code. If the client account exists under a different technology partner account, the system returns a 400 error response.

Example PUT (cancel) Client Account Billing Plan Request

GET https://api.cc.email/v3/partner/accounts/{encoded_account_id}/plan

 <?php
 
 $request = new HttpRequest();
 $request->setUrl('https://api.cc.email/v3/partner/accounts/x07x1lxtr5d0/status/cancel');
 $request->setMethod(HTTP_METH_PUT);
 
 $request->setHeaders(array(
   'cache-control' => 'no-cache',
   'x-api-key' => '4x1xc312-342x-436x-97x3-0f7f502218f1',
   'Authorization' => '"xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx',
   'Accept' => '*/*',
   'Content-Type' => 'application/json'
 ));
 
 $request->setBody('{
    "effective_date": "2020-03-03T22:09:15.000Z",
    "reason_id": 1
 
 }');
 
 try {
   $response = $request->send();
 
   echo $response->getBody();
 } catch (HttpException $ex) {
   echo $ex;
 }
 <?php
 
 
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n   \"effective_date\": \"2020-03-03T22:09:15.000Z\",\n   \"reason_id\": 1\n\n}");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/partner/accounts/x07x1lxtr5d0/status/cancel")
  .put(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "*/*")
  .addHeader("Authorization", ""xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx")
  .addHeader("x-api-key", "4x1xc312-342x-436x-97x3-0f7f502218f1")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

curl -X PUT \
  https://api.cc.email/v3/partner/accounts/x07x1lxtr5d0/status/cancel \
  -H 'Accept: */*' \
  -H 'Authorization: "xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-api-key: 4x1xc312-342x-436x-97x3-0f7f502218f1' \
  -d '{
   "effective_date": "2020-03-03T22:09:15.000Z",
   "reason_id": 1

}'

View it! Although technology partner endpoints cannot be tested using our API Reference Tester, response samples and schema are available to view for this endpoint.