Packages

Navigation:  Billing Integration (Supported Systems) > Billing API >

Packages

Previous pageReturn to chapter overviewNext page

Package related API calls:

 

create a package:

 

request:

 

POST https://kuberdock.master/api/pricing/packages/

 

json-data:

 

{

“first_deposit”: “first_deposit”, // specify sum of money a user should pay to start using KuberDock e.g “2”, “20”, “5.5”

“currency”: “currency_code”, // e.g. USD

“id”: “package_id”,

“name”: “package_name”,

“period”: “hour”, // can be “hour”, “month”, “quarter”, “annual”

“prefix”: “currency_prefix”,

“suffix”: “currency_suffix”,

“price_ip": “price_per_ip”,

“price_pstorage”: “price_pstorage”, // per GB

“price_over_traffic”: “price_over_traffic”, // under development, per GB

}

 

response:

 

{

 “data“: {

“first_deposit”: “first_deposit”,

“currency”: “USD”,

“id”: “1”,

“name”: “package_name”,

“period”: “hour”,

“prefix”: “currency_prefix”,

“suffix”: “currency_suffix”,

“price_ip”: “price_per_ip”,

“price_pstorage”: “price_pstorage”,

“price_over_traffic”: “price_over_traffic”,

},

 “status”: “OK”

}

 

update a package:

 

Note. Making changes in pricing will affect existing users of this package starting from the date the changes have been made.

You can change several fields for a package in one request.

 

request:

 

PUT https://kuberdock.master/api/pricing/packages/<package_id>

 

json-data:

 

{

“currency”: “USD”,

“first_depoist”: “20”

}

 

response:

 

{

 “status”: “OK”

}

 

retrieve billing info for a package

 

request:

 

GET https://kuberdock.master/api/pricing/packages/<package_id>

 

response:

 

{

 “data": {

 “first_deposit”: “first_deposit”,

 “currency”: “USD”,

 “id”: “1”,

 “name”: “pacakge_name”,

 “period”: “hour”,

 “prefix”: “currency_prefix”,

 “suffix”: “currency_suffix”,

“price_ip”: “price_per_ip”,

 “price_pstorage”: “price_pstorage”,

 “price_over_traffic”: “price_over_traffic”, under development

 },

 "status": "OK"

}

 

 

retrieve all packages:

 

request:

 

GET https://kuberdock.master/api/pricing/packages

 

response:

 

{

 “data”: [

 {

       “first_deposit”: “first_deposit”,

       “currency”: “USD”,

       “id”: 0,

       “name”: “package_name”,

       “period”: “hour”,

 “prefix”: “currency_prefix”,

 “suffix”: “currency_suffix”,

 “price_ip”: “price_per_ip”,

 “price_pstorage”: “price_pstorage”,

 “price_over_traffic”: “price_over_traffic”,

},{…}

       ],

"status": "OK"

}

 

delete package:

 

Note. You can not delete a package if it is assigned to any user in the database. To check users' attachment to a package, use the information you can get from "get all users info" request (Users section of the current topic).

 

request:

 

DELETE https://kuberdock.master/api/pricing/packages/<package_id>

 

response:

 

{

 “status”: “OK”

}