> For the complete documentation index, see [llms.txt](https://developers.yumpu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.yumpu.com/api/subscription/subscriptionput.md).

# Put

## Update an existing subscription

### Parameters:

| Name             | Optional / Required | Data type | Description                                                                                                               | Default |
| ---------------- | ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | ------- |
| id               | required            | String    | One of your subscription ids                                                                                              |         |
| itc\_product\_id | required            | String    | min. 5 characters, max. 255 characters                                                                                    |         |
| name             | required            | String    | min. 5 characters, max. 50 characters                                                                                     |         |
| duration         | required            | Integer   | 7, 31, 62, 93, 186 or 365 (days)                                                                                          |         |
| description      | optional            | String    | min. 5 characters, max. 255 characters                                                                                    |         |
| kiosks           | optional            | String    | One or multiple kiosk ids (webkiosk\_123 or webkiosk\_123,appkiosk\_456), values must start with webkiosk\_ or appkiosk\_ |         |

{% tabs %}
{% tab title="curl" %}
Example:

```
curl -X PUT -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=B7OxpT5ji53wLuR2" -d "itc_product_id=subscription6" -d "name=subscription6" -d "description=subscription6" -d "duration=365" -d "kiosks=webkiosk_25,webkiosk_1572" "https://api.yumpu.com/2.0/account/subscription.json"
```

{% endtab %}

{% tab title="PHP" %}
Example:

```php
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'id' => 'B7OxpT5ji53wLuR2',
    'itc_product_id' => 'subscription6',
    'name' => 'subscription6',
    'duration' => 365,
    'description' => 'subscription6',
    'kiosks' => 'webkiosk_25,webkiosk_1572'
);
$putSubscription = $yumpu->putSubscription($data);
print_r($putSubscription);
```

{% endtab %}

{% tab title="JavaScript" %}
Example:

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
  id: 'B7OxpT5ji53wLuR2',
  itc_product_id: 'subscription6',
  name: 'subscription6',
  description: 'subscription6'.
  duration: 365,
  kiosks: 'webkiosk_25,webkiosk_1572'
};
yumpu.putSubscription(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});
```

{% endtab %}

{% tab title="Java" %}
Example:

```java
Yumpu y = new Yumpu("your access token");
String[] params = {"id=B7OxpT5ji53wLuR2", "itc_product_id=subscription6", "name=subscription6", "duration=365", "description=subscription6", "kiosks=webkiosk_25,webkiosk_1572"};
System.out.println(y.putSubscription(params));
```

{% endtab %}
{% endtabs %}

Whatever language you are using, the result will be the same.

```javascript
{
  "subscription": {
    "id": "B7OxpT5ji53wLuR2",
    "create_date": "2015-02-03 12:34:18",
    "update_date": "2015-02-03 12:40:54",
    "itc_product_id": "subscription6",
    "name": "subscription6",
    "description": "subscription6",
    "duration": "365",
    "kiosks": [
      {
        "id": "25",
        "type": "webkiosk"
      },
      {
        "id": "1572",
        "type": "webkiosk"
      }
    ]
  },
  "state": "success",
  "completed_in": "0.0687"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.yumpu.com/api/subscription/subscriptionput.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
