Change the Auto-renew option of the Reseller's Subscription
The Change the Auto-renew option of the Reseller's Subscription method is used to change the Auto-renew option of a Subscription by its ID for the current Reseller or any of its downstream Resellers. The availability of the operation depends on the Disable the Auto-renew option option of the Subscription (see Auto-renewing a subscription).
Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.
PATCH {base_url}/api/v3/resellers/{reseller_id}/subscriptions/{subscription_id}
Arguments
Name | Parameter Type | Data type | Required/Optional | Description | ||
---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) | ||
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) | ||
Accept | header | string | Required | Information about data types that the client (browser) supports | ||
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) | ||
subscription_id | path | integer | Required | ID of the Subscription | ||
data | form | object | Required | Information about the attributes of the operation | ||
attributes | form | object | Required | Attributes of the operation | ||
autorenew | form | bool | Required | Defines the target state of the Auto-renew option of the Subscription:
|
Response model
If no errors are encountered, the method returns information about the Subscription (see Get the Reseller's Subscription information by ID).
Errors
The auto-renew option is not available for change
— the Disable the Auto-renew option option is activated for the Subscription.Сan not change auto-renew option for the Subscription with
status
— the current status of the Subscription does not allow changing the Auto-renew option.Сan not change auto-renew option
for the Subscription with trial period
— changing the the Auto-renew option is not allowed for a Subscription to the trial period.Сan not change auto-renew option for the Subscription with endless period
— changing the the Auto-renew option is not allowed for a Subscription to the endless period.You are trying to change the current Auto-renew value to the same value
— the target state of the Auto-renew option of the Subscription is already set.
Request example
PATCH /api/v3/resellers/1/subscriptions/3007381
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+jsoni+json
{
"data":
{
"attributes":
{
"autorenew" : true
}
}
}
??? Response example
{
"data": {
"id": "3007381",
"type": "subscriptions",
"attributes": {
"created_at": "2021-03-06T03:05:29.717+03:00",
"updated_at": "2021-03-06T04:44:10.185+03:00",
"plan_id": 5,
"account_id": 710,
"name": "Auto provisioning with resources",
"trial": false,
"status": "active",
"start_date": "2021-03-06",
"expiration_date": "2021-04-06",
"plan_period_id": 4,
"promo_code": "",
"payment_model": "postpay",
"payment_model_parameters": {
"credit_limit": 5000.0,
"current_debt": 123.89
},
"renewal_settings": {
"autorenew": true,
"disable_autorenew": false,
"autorenew_point": 0,
"manual_renew_point": -1
},
"fixed_price": false
},
"relationships": {
"account": {
"data": {
"id": "710",
"type": "accounts"
}
},
"subscription_resources": {
"data": [
{
"id": "35882",
"type": "subscription_resources"
},
{
"id": "35883",
"type": "subscription_resources"
},
{
"id": "35884",
"type": "subscription_resources"
}
]
},
"subscription_period": {
"data": {
"id": "6486",
"type": "subscription_periods"
}
},
"plan": {
"data": {
"id": "5",
"type": "plans"
}
}
}
}
}