A
A
API
Search…
Post

Create a new subscription

Parameters:

Name
Optional / Required
Data type
Description
Default
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_

Demo

URL Find your token on - yumpu.com Token
itc_product_id name duration

Optional parameters:

description kiosks
Add optional parametersRun request
1
Copied!
curl
PHP
JavaScript
Java
Example:
1
curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "itc_product_id=subscription6" -d "name=subscription6" -d "description=subscription6" -d "duration=62" -d "kiosks=webkiosk_25" "http://api.yumpu.com/2.0/account/subscription.json"
Copied!
Example:
1
require_once('../yumpu.php');
2
$yumpu = new Yumpu();
3
$data = array(
4
'itc_product_id' => 'subscription6',
5
'name' => 'my subscription6 name',
6
'duration' => 62,
7
'description' => 'my subscription6 description',
8
'kiosks' => 'webkiosk_25'
9
);
10
$postSubscription = $yumpu->postSubscription($data);
11
print_r($postSubscription);
Copied!
Example:
1
var yumpu = require('yumpu');
2
yumpu.setToken('yourToken');
3
var parameters = {
4
itc_product_id: 'subscription6',
5
name: 'subscription6',
6
description: 'subscription6'.
7
duration: 62,
8
kiosks: 'webkiosk_25'
9
};
10
yumpu.postSubscription(parameters, function(statusCode, document){
11
console.log('Status: ' + statusCode);
12
console.log(document);
13
});
Copied!
Example:
1
Yumpu y = new Yumpu("your access token");
2
String[] params = {"itc_product_id=subscription6", "name=subscription6", "duration=62", "description=subscription6" "kiosks=webkiosk_25"};
3
System.out.println(y.postSubscription(params));
Copied!
Whatever language you are using, the result will be the same.
1
{
2
"subscription": {
3
"id": "B7OxpT5ji53wLuR2",
4
"create_date": "2015-02-03 12:34:18",
5
"update_date": "0000-00-00 00:00:00",
6
"itc_product_id": "subscription6",
7
"name": "subscription6",
8
"description": "subscription6",
9
"duration": "62",
10
"kiosks": [
11
{
12
"id": "25",
13
"type": "webkiosk"
14
}
15
]
16
},
17
"state": "success",
18
"completed_in": "0.1439"
19
}
Copied!
Last modified 1yr ago