Retrieve upgrade price
Overview
Use the getProductUpgradeOptionsPrice method to retrieve information about the costs a customer incurs when upgrading a specific subscription. Retrieve information about the costs a customer incurs when upgrading a specific subscription.
Parameters
Parameters | Type/Description |
---|---|
sessionID |
Required (string) |
|
Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect. The sessionID expires in 10 minutes. |
subscriptionReference |
Required (string) |
Unique, system-generated subscription identifier. |
|
productCode |
Required (string) |
|
Unique identifier of the target product for the subscription upgrade process. You control the product code and can set it up in the Control Panel. |
currency |
Required (string) |
|
ISO 4217 code. |
options |
Required (string) |
|
Pricing options of the target product for the subscription upgrade process.
String - ';' separated list of 'OptionValue' returned by getProductUpgradeOptions function. If the pricing options groups is "scale" (interval), the Options parameter should be sent like this: [option group unique code] + "=" + value e.g. Users=7 |
Response
Parameters | Type/Description | |
---|---|---|
UpgradePrice |
Object |
|
Details below. | ||
BillingPrice | Int | |
Net billing price available for the upgrade process. | ||
BillingGrossPrice | Int | |
Gross billing price available for the upgrade process. | ||
BillingCurrency | String | |
Billing currency available for the upgrade process. | ||
Quantity | String | |
Quantity available for the upgrade process. | ||
DisplayPrice | Int | |
Net display price available for the upgrade process. | ||
DisplayGrossPrice | Int | |
Gross display price available for the upgrade process. | ||
DisplayCurrency | String | |
Display currency available for the upgrade process. | ||
Discount | Float | |
Applied discounts | ||
DiscountedProratedPrice | Float | |
Prorated net price for the upgrade with applied discounts | ||
DiscountedProratedGrossPrice | Float | |
Prorated gross price for the upgrade with applied discounts | ||
DiscountedBillingPrice | Float | |
Net billing price available for the upgrade process with applied discounts | ||
DiscountedBillingGrossPrice | Float | |
Gross billing price available for the upgrade process with applied discounts | ||
DisplayDiscount | Float | |
Discount displayed for the upgrade process | ||
DiscountedDisplayPrice | Float | |
Net display price available for the upgrade process with applied discounts | ||
DiscountedDisplayGrossPrice | Float | |
Gross display price available for the upgrade process with applied discounts |
Request
<?php
require ('PATH_TO_AUTH');
$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$productCode = 'my_subscription_123';
$currency = 'usd';
$options = 'emailsupport;oneuser1';
$jsonRpcRequest = array (
'method' => 'getProductUpgradeOptionsPrice',
'params' => array($sessionID, $subscriptionReference, $productCode, $currency, $options),
'id' => $i++,
'jsonrpc' => '2.0');
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));