Update the billing plan for a specified Constant Contact 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.

The billing plan determines which Constant Contact product features that the client account can access. If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older named plan_types and plan_types that use enum values will continue to be supported. Before updating a client account, you can view the current account details by making a GET call to the /partner/accounts/{encoded_account_id}/plan endpoint.

To update the billing plan type for a client account, make a PUT call to the /partner/accounts/{encoded_account_id}/plan endpoint and include the billing plan_type parameter to assign in the request body. To also update the plan group for the client account, include the plan_group_id parameter in the request body. If you don’t know the plan_group_id to use, contact our Constant Contact Partner API support team.

For example, the following request body updates the billing plan from TRIAL to GOLD and changes the billing date to the first (1) day of each month.

{
  "plan_type": "GOLD",
  "billing_day_of_month": "1"
}

The response body includes the billing plan changes and details for the specified client’s account. For example:


{
  "plan_type": "GOLD",
  "current_tiers": [
        {
            "usage_type": "CONTACTS",
            "current_usage": 1.00000,
            "tier": 1,
            "tier_min": 0.00000,
            "tier_max": 500.00000,
            "price": 20.00000,
            "currency_code": "USD"
        }
    ],
    "billing_status": "Open",
    "billing_day_of_month": 1
}

Request Body Parameters

plan_type

Use this parameter to change the current billing plan type (plan_type) to a different plan type. The plan type must be enabled in your partner billing plan group. The billing plan determines the Constant Contact product features that the client account can access and the total number of contacts permitted. Attempting to change to a plan that is currently not available within your partner plan group results in a 400 error response code. The following billing plan types are available:

  • TRIAL: A non-billed Trial account with an expiration date that allows clients to try limited Constant Contact product features.
  • BRONZE: A billable plan that provides basic email and marketing tools.
  • SILVER: A billable plan that provides all features available in the BRONZE plan, and adds some additional email campaign feature such as contact segmentation and social media advertisements.
  • GOLD: A billable plan that provides all available product features.

Changing the plan_type from TRIAL to another plan_type automatically changes the billing_status from Trial to Open.

plan_group_id

For client accounts using a single-billing plan, use this parameter to update a client account from a non-standard billing plan to a newer billing plan (plan_group_id). Note: The plan_group_id is not returned in the results.

  • If the specified plan_group_id does not exist under the client account’s plan group, the partners default plan_type is assigned.
  • If the specified plan_group_id does exist but does not match the client account’s current plan group, an error is returned.
  • If the plan_group_id parameter is not specified in the request, but the specified plan_type exists in the client account’s plan group, the plan_type is assigned.
  • If the plan_group_id parameter is not specified in the request and the specified plan_type does not exist in the client account plan group but does exist in the partner account plan group, the plan_type is assigned.

billing_day_of_month

Update the day of month in which to bill the client account. This property is required if a client account is not set up to use a single billing plan. You can choose to enter a specific day of the month or accept the default value, which is the day on which the plan_type value changes from a Trial plan to a different plan_type. For trial accounts, the value defaults to null. You can change the billing_day_of_month only when changing the plan_type value from TRIAL to a different plan_type, otherwise the value you enter is ignored. Valid values include 1 through and including 31.

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

Example PUT Billing Plan Details for a Client Account Request

The following header parameters are required:

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

In the request body, to change the billing plan for a client account, include the plan_type for standard billing plans or plan_group_id for non-standard billing plans. If the plan_type is currently set to TRIAL, you can also choose to change the day of month to bill the client account (billing_day_of_month).

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

 <?php
 
 $request = new HttpRequest();
 $request->setUrl('https://api.cc.email/v3/partner/accounts/{encoded_account_id}/plan');
 $request->setMethod(HTTP_METH_PUT);
 
 $request->setHeaders(array(
   'cache-control' => 'no-cache',
   'x-api-key' => '40a0b12-342b-436d-97c3-000000000000',
   'Authorization' => 'xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx',
   'Content-Type' => 'application/json',
   'Accept' => '*/*'
 ));
 
 $request->setBody('{
 "plan_type": "GOLD",
 "current_tiers": [],
 "billing_status": "Trial"
 }
 ');
 
 try {
   $response = $request->send();
 
   echo $response->getBody();
 } catch (HttpException $ex) {
   echo $ex;
 }
 
OkHttpClient client = new OkHttpClient();

        MediaType mediaType=MediaType.parse("application/json");
        RequestBody body=RequestBody.create(mediaType,"{\n\"plan_type\": \"GOLD\",\n\"current_tiers\": [],\n\"billing_status\": \"Trial\"\n}\n");
        Request request=new Request.Builder()
        .url("https://api.cc.email/v3/partner/accounts/{encoded_account_id}/plan")
        .put(body)
        .addHeader("Accept", "*/*")
        .addHeader("Content-Type", "application/json")
        .addHeader("Authorization", ""xxxxxxxxxxxxxWQzZGTG9DS0RGTkYzT2w0XC9KaDU2TUFtc3RnQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2cjZ0bzVmb2UxZ2luNWt0N3Y2Y2JoanNjcyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoidjNhcGlcL2dlbmVyYWwucGFydG5lciIsImF1dGhfdGltZSI6MTU5MTEwMTg4OCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfTUd4alFNTTRQIiwiZXhwIjoxNTkxMTA1NDg4LCJpYXQiOjE1OTExMDE4ODgsInZlcnNpb24iOjIsImp0aSI6IjdmOWFiODI3LWIwZjktNDRmYi1iZTcwLTc3OGE5MTg0Y2MwMyIsImNsaWVudF9pZCI6IjZyNnRvNWZvZTFnaW41a3Q3djZjYmhqc2NzIn0.lLvhRdv_k1swxxxxxxxxxxxxxxxxxxxxxxxa3ZjMU4KAXitot-3VCOZ_95rErSmP7aST2oAENKiVEbttq2QJaJqVvuce2sJSx9dstWzlXixeQt5MFwkrzC3vBpT02qBotAUpoEz28zcRft5LFYxFs4Z5ycTzkgmBCdX6GtHL8bj6QihYrsi5wKdO0JatMlyt2cv1qRwN_dAKFrPx9QuXdz2x7Xnip0g7jCZDEJpYFJVe_aAoiutRGJNtpemI70_A42MU9XDTuXg0i75ISStcnjYP27SNtgKyg6So3EOnZLR5nyHeYUE3wTZfMt13wBUIsKvX_SgMgdQLOC7lOhsix8okA,xxxxxxx3N2Yxxxxxxxxxxxxxxxxxx"")
        .addHeader("x-api-key", "40a0b12-342b-436d-97c3-000000000000")
        .addHeader("cache-control", "no-cache")
        .build();

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


 curl -X PUT \
  https://api.cc.email/v3/partner/accounts/{encoded_account_id}/plan \
  -H 'Accept: */*' \
  -H 'Authorization: Basic YmlsbGluZ3N2Y19zX3FhOktSKGppc31nWzx3aV8=' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-api-key: 40a0b12-342b-436d-97c3-000000000000' \
  -d '{
"plan_type": "GOLD",
"current_tiers": [],
"billing_status": "Trial"
}

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.