[POST] Modify Next Subscription Renewal Price (AR/PMR)

POST /v1/subscription/modify_next_billing_price

The request allows you to modify the next subscription price (renewal price amounts only, currencies remains unchanged).
NOTE: The request affects only one subscription of one individual customer. The product renewal price remains unchanged. 

You can update a price 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 price. 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 price 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:
currency
string
required
Currency code.
New next subscription prices (next renewal prices) are transferred using this parameter. The currency code must coincide with the current currency of a subscription. You can find out current currencies of subscriptions through request used for getting subscription data request.
  • Format: ISO 4217 alpha-3, 3 characters.
  • For the value options, see the reference guide.
next_billing_price
string
required
Next subscription price. The customer has to pay this amount for a renewal (incl. product quantity, VAT, discount) to extend the subscription validity period (term).

Format: String contains numerals; value separating by point, with two decimal places.
{
 "id": "111111_22222",
 "currency": "USD",
 "next_billing_price": "80.00"
}

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.
7310 Impossible to change the renewal price. Invalid order currency. The next subscription price (renewal price) cannot be updated because the currency transferred (currency) does not coincide with the current currency of the subscription.
7320 Impossible to change the renewal price. The subscription status is not_paid (payment pending). The next subscription price (renewal price) 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 price only if the subscription has the active status.
7330 Impossible to change the renewal price. The subscription status is cancelled (cancelled). The next subscription price (renewal price) cannot be updated because it has already been cancelled (subscription status is cancelled). You can update the price 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": 7310,
   "message": "Impossible to change the renewal price. Invalid order currency."
  }
 ]
}