changeTariff method
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

changeTariff method

Вы здесь:

Switching the user to other tariff (for partner sites)

Method for changing the user’s tariff plan.

First you need to get the list of all tariffs available to be switched to, and then perform the switch.

This method is only possible for accounts that have a reseller status.

Principle of use

changeTariff (string login, int tariff_id)
https://api.unisender.com/en/api/changeTariff?format=json&api_key=KEY&login=LOGIN&tariff_id=TARIFF_ID
Arguments
api_key * API access key.
login * Login of the user for whom the tariff plan will be changed.
tariff_id * The identifier of the tariff being switched and has been previously obtained in getAvailableTariffs.
Return value
JSON object with the following fields:
tariff_id The identifier of the tariff that user has been switched to.
charged_sum The amount that has been written off from the user’s balance for changing the tariff plan.
charged_bonus The bonus amount that has been written off from the user’s balance for changing the tariff plan.
start_time Date and time in the «YYYY-MM-DD hh:mm:ss» format, as of which the new tariff plan will be effective.
end_time Date and time in the «YYYY-MM-DD hh:mm:ss» format, until which the new tariff plan will be effective.
Examples of return values:

{
  "result":{
		"tariff_id":1234,
		"charged_sum":300,
		"charged_bonus":0,
		"start_time":"2012-05-21 13:51:12",
		"end_time":"2012-06-21 13:51:12"
	}
}

{
  "error":"The tariff change failed. And the reason.",
  "result":false
}
Оцените, на сколько вам показалась полезной статья «changeTariff method»
(0)