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}/plan
endpoint to update the following Constant Contact billing plan details for a partner’s client account:
plan_type
: Change the current billing plan (plan_type
) to a different plan that is enabled in your partner 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 theBRONZE
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
fromTRIAL
to anotherplan_type
automatically changes thebilling_status
fromTrial
toOpen
.If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older billing plans and
plan_name
enum values will continue to be supported.- Update the day of month (
billing_day_of_month
) in which to bill the client account. This property is required if a client account is not set up to use single billing. You can choose to enter a specific day of the month or accept the default value, which is the day on which theplan_type
value changes from aTrial
plan to a differentplan_type
. For trial accounts, the value defaults tonull
. You can change thebilling_day_of_month
only when changing theplan_type
value fromTRIAL
to a differentplan_type
, otherwise the value you enter is ignored. Valid values include1
through and including31
.
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
.
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. The following provides an example of the type of client account details that display in the results body.
{
"plan_type": "TRIAL",
"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": "Trial",
"billing_day_of_month": 29
}
To update the billing plan for a client account, make a PUT
call to the /partner/accounts/{encoded_account_id}/plan
endpoint and include your changes in the request body. The following request body provides an example that changes the billing plan from TRIAL
to GOOD
and changes the billing date to the first (1
) day of each month. Any additional properties and values that you include in the request body are ignored.
{
"plan_type": "GOLD",
"billing_day_of_month": "1"
}
The response body results shows all 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
}
Changing the plan_type
from TRIAL
to different plan automatically changes the billing_status
from Trial
to Open
. Acceptable values for billing_status
include:
Trial
: This is a non-paying trial client account.Open
: This is an active and paying client account.Canceled
: The client account was canceled.Trial End
: The trial period has ended for this client account.
Parameters
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, you can choose to change the client account plan type (plan_type
) and if the plan_type
is current set to TRIAL
, you can also choose to change the day of month to bill the client account (billing_day_of_month
).
Example PUT Billing Plan Details for a Client Account Request
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.