== payment_subscriptions.edit==
=== Description ===
Edit user's subscription. User will remain premium until canceled or max rebill number reached, rebill amount(s) will be changed to new value(s), all other parameters will retain its values.
NOTE:
Edit is allowed only once for any user.
IMPORTANT:
Edit must be performed against appropriate system's url(system_id, retrieved by payment_subscriptions.search)
```
if system_id == 'a21'
staging: https://cs-a21.dvipdev.com/
production: https://cs-a21.dvipapp.com/
query: /api.json?cmd=payment_subscriptions.edit&sub_id=//value1//&offer=//value2//&next_offer=//value3//
```
==== Input Parameters ====
<table>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th><th>Note</th></tr>
<tr><td>sub_id</td><td>string</td><td>Yes</td><td>Subscription ID</td><td>Retrieved by payment_subscriptions.search</td></tr>
<tr><td>offer</td><td>float</td><td>Yes</td><td>Amount to be used for all rebills (except for next)</td><td>Equivalent to rebill_amount in [[ https://phab.dvipdev.com/w/public/payment/partners/apidocs/subscription.change/ | subscription.change ]]</td></tr>
<tr><td>next_offer</td><td>float</td><td>Yes</td><td>Amount to be used for next rebill only</td><td>Equivalent to next_rebill_amount in [[ https://phab.dvipdev.com/w/public/payment/partners/apidocs/subscription.change/ | subscription.change ]]</td></tr>
</table>
==== Return ====
<table>
<tr><th>Name</th><th>Type</th><th>Description</th><th>Note</th></tr>
<tr><td>success</td><td>bool</td><td>Was editing successfull?</td><td></td></tr>
</table>
==== Usage Example ====
example query:
```
/api.json?cmd=payment_subscriptions.edit&sub_id=211288
```
example of canceled successfully response:
```lang=json
{
"meta": {
"messages": [
{
"code": "edit_success",
"params": null,
"sticky": false,
"text": "edit_success"
}
],
"status": "OK"
},
"result": {
"success": true,
"id": 0,
"data": [
],
"item": [
]
}
}
```
example of failure response:
```lang=json
{
"meta": {
"errors": [
{
"code": "downselled",
"params": null,
"sticky": false,
"text": "Already used downsell"
}
],
"status": "ERROR"
},
"result": {
"success": false,
"id": 0,
"data": [
],
"item": [
]
}
}
```