Reselling modules
If you use another billing system or a script instead of BILLmanager, you need to make some changes to the system for automatic reselling of modules.
When a client purchases a module from a control panel, for example, from ispmanager, the system sends requests to a third-party system which must emulate BILLmanager API to handle the orders.
There are two ways to set up interaction with a third-party system:
Automatic order. The control panel sends all the requests required for automatic order and payment to the system. A control panel is a software product where a client purchases a module, for example, ISPmanager.
Manual order. The control panel won't try to order a module automatically. A client will be redirected to a partner's website (its URL is built in into a license).
You need to inform ispmanager representatives what variant you want to use, and they will change the settings in the ispmanager billing system accordingly.
Authorization in the system is performed using the parameter authinfo, which takes the value authinfo=EMAIL:PASSWORD, where:
EMAIL — user's email address in the billing system https://api.ispmanager.com;
PASSWORD — user’s password.
Below are the tables with the versions of the module and its identifiers.
For customers from the Russian Federation:
Version | ID (pricelist) |
---|---|
Dr.Web for ispmanager 6 lite | 55377 |
Dr.Web for ispmanager 6 pro | 55378 |
Dr.Web for ispmanager 6 host | 55379 |
DDoS-GUARD | 23221 |
For customers from other countries:
Version | ID (pricelist) |
---|---|
Dr.Web for ispmanager 6 lite | 55361 |
Dr.Web for ispmanager 6 pro | 55362 |
Dr.Web for ispmanager 6 host | 55363 |
DDoS-GUARD | 23221 |
Automatic order
The following functions are used for automatic order of modules:
Receive a list of tariff plans
The control panel where clients can make order requests a list of modules and their prices from the billing system.
The following request will be sent
https://api.ispmanager.com/billmgr?authinfo=user:passwd&func=pricelist.export&itemtype=addition&out=xml
An XML document of the format is expected in response:
<doc>
<pricelist>
<id>277</id>
<additionintname>Virusdie</additionintname>
<price currency="EUR">
<period cost="913.9286" type="month" length="1">monthly</period>
</price>
</pricelist>
</doc>
id - module tariff ID.
additionintname - module name. Possible values:
DDoS-GUARD - DDoS-GUARD module for ispmanager.
price - prices for a selected period. When paying and uploading the price, the system always uses <period> with type="month" and length="1".
Receive the contents of the Cart
The following request will be sent
https://api.ispmanager.com/billmgr?authinfo=user:passwd&func=basket
You will receive the XML where the '/doc/list[@name='itemlist']/elem' elements will be checked. If they are found, the modules will be added into the Cart, but the control panel won't try to pay for them automatically. The user will be redirected to the system to complete the order manually.
Add an order to the Cart
The following request will be sent
https://api.ispmanager.com/billmgr?authinfo=user:passwd&func=addition.order.param&item=234256&period=1&pricelist=2345&sok=ok
item - license id associated with the module.
period and pricelist are taken from the list of tariff plans (/doc/pricelist/id и /doc/pricelist/price/period/@length).
XML is expected in the response:
<doc>
<billorder.id>1234</billorder.id>
</doc>
billorder.id - order id.
Order payment
Request
https://api.ispmanager.com/billmgr?authinfo=user:passwd&func=basket&id=23445&sok=ok
id - id that was received when placing an order.
Log into the system
Request
https://api.ispmanager.com/billmgr?authinfo=user:passwd&func=session.newkey&key=vjJJNF3IDS2as
key - a random sequence of symbols.
To get a response, the client will be redirected to:
Request
https://api.ispmanager.com/billmgr?func=auth&username=<имя>&key=vjJJNF3IDS2as&backlevel=?&backname=?&backurl=?
key - the sequence from the previous call
backlevel - user role in the panel
backname - control panel name
backurl - <Control panel URL>?startform=plugin
Manual order
To order modules manually, you need to receive a list of tariff plans to get the information about module prices.
When the client purchases a module, the control panel will redirect him to the partner's website. To do so, the system generates the request:
https://api.ispmanager.com/billmgr?module=<имя модуля>&license=<ID лицензии>&ip=<IP лицензии>