Contents

Modify Next Renewal Product Name (AR/PMR)

POST /v1/subscription/modify_next_product_name

The request allows you to modify the next renewal product name. 
NOTE: The request affects only one subscription of one individual customer. The product renewal name remains unchanged. 

You can update a renewal product name of a subscription only if the subscription is active. Otherwise, if a renewal order is created, and it is payment pending (subscription status is not_paid), or the subscription is cancelled (subscription status is cancelled), you cannot update the renewal product name. You can find out current statuses of subscriptions through request used for getting subscription data.

Starting with the next renewal after you apply the update to a subscription, the renewal product name transferred remains valid for the lifecycle of the subscription as well as for its subsequent child orders, until you transfer a new value.

content-type
string
required
It must be equal to "application/json".
AuthorizationJWT
required
Authorization token.
  • Format: Bearer [token]
  • Where [token] is substituted by the token value obtained through the authentication API.
id
required
Subscription identifier
Format: NN_MM, where NN is an identifier of the order that initiates subscriptions (parent order).
You can get it from:
next_product_name
string
required
Next renewal product name. The name of the next product that extends the customer’s subscription for another validity period (term).
  • Maximum of 255 characters.
  • It cannot be passed empty or have a null value.
{
 "id": "111111_22222",
 "next_product_name": "Product renewal for 1 year"
}

In response to the request, you receive the server response code corresponding to the processing result. Depending on the code, the response body may contain additional parameters.

If processing is successful, the following will return in response server response code: HTTP/1.1 200 ОК.

If an error occurs while processing the request, you receive a server response code corresponding to the result of processing.

Depending on the code, the response body may contain additional parameters.

HTTP Server Response Error Code

HTTP code Description
HTTP/1.1 400 Bad Request The request is not valid (error in parameters; necessary data is not transferred, etc.).
An additional error code (one or more) will be transferred in the response bodу.
HTTP/1.1 401 Unauthorized Unsuccessful authorization.
An additional error code (one or more) will be transferred in the response bodу.
HTTP/1.1 404 Not found Invalid request URL or no subscription having the identifier transferred is found. If no subscription is found, an additional additional error code will return in the response body. 
HTTP/1.1 500 Request Error Internal Server Error. Please try again later or contact support.

Additional Error Codes for HTTP 400

Error Message Description
If at least one error from the list below is found, then it returns in response to a request, other errors are not validated.
110 JSON is not valid. The request cannot be processed. Request field structure is not valid. Check the fields in the request body against the JSON format.
111 Invalid data format (Content-type). The request cannot be processed. Invalid request header. Content-type must be equal to application/json.
7000 No access to subscription management. Please contact technical support. During processing, we could not identify your account setting unambiguously. Please contact support team.
If at least one error from the list below is found, then request validation is not interrupted. Several errors may return in response.
7010 Invalid field value: [parametr name] The request is not valid, e.g., the required parameter is not filled out, the parameter name is incorrect, the parameter value does not match with the data type provided, or the value format is incorrect. Moreover, the error will return if null is transferred in the parameter, and this value option is not set as valid in the parameter description.
7420 Impossible to change the next product name for the subscription. The subscription status is not_paid (payment pending). The next renewal product name cannot be updated because a renewal order has already been created, and it is payment pending (subscription status is not_paid). You can update the name only if the subscription has the active status.
7430 Impossible to change the next product name for the subscription. The subscription status is cancelled (cancelled). The next renewal product name cannot be updated because the subscription has already been cancelled (subscription status is cancelled). You can update the name only if the subscription has the active status.
7900 Failed to execute the action with the subscription. Please contact Technical Support. Failed to execute the action with the subscription. Please contact Technical Support.

Additional Error Codes for HTTP 401

The errors are the same for all the APIs that use token authorization.

Additional Error Codes for HTTP 404

Error Message Description
If at least one error from the list below is found, then it returns in response to a request, other errors are not validated.
7400 Subscription not found. No subscription with the identifier transferred is found, or you do not have the rights to get the data. 
errors
array [objects]
required
Error list.
errors / [error object]
/
error
number
required
Error code.
errors / [error object]
/
message
string
required
Error description.
{
 "errors": [{
   "error": 7420,
   "message": "Impossible to change the next product name for the subscription. The subscription status is not_paid (payment pending)."
  }
 ]
}