Cancel the Billing Plan for a Client Account
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:
1Cost Too High2Using A Competitive Service3Not Doing Email Marketing11Something Missing Or Not Working12Doing It In-House14Poor Results21Too Difficult To Use27Canceled Online by Customer30Dissatisfied 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
https://api.cc.email/v3/partner/accounts/{encoded_account_id}/planOkHttpClient 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", "{access_token}")
.addHeader("x-api-key", "4x1xc312-342x-436x-97x3-0f7f502218f1")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Although technology partner endpoints cannot be tested using our API Reference Tester, response samples and schema are available to view for this endpoint.