Retrieve upgrade price

Use the getProductUpgradeOptionsPrice method to retrieve information about the costs a customer incurs when upgrading a specific subscription.

Request parameters

Parameter
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

Request sample

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$productCode = 'my_subscription_123';
$currency = 'usd';
$options = 'emailsupport;oneuser1';

try {
    $upgradeOptions = $client->getProductUpgradeOptionsPrice($sessionID, $subscriptionReference, $productCode, $currency, $options);
}
catch (SoapFault $e) {
    echo "upgradeOptions: " . $e->getMessage();
    exit;
}
var_dump("upgradeOptions", $upgradeOptions);

Response parameters

Parameter
Type / Description

UpgradePrice

Object

Details below.

UpgradePrice.BillingPrice

Int

Net billing price available for the upgrade process.

UpgradePrice.BillingGrossPrice

Int

Gross billing price available for the upgrade process.

UpgradePrice.BillingCurrency

String

Billing currency available for the upgrade process.

UpgradePrice.Quantity

String

Quantity available for the upgrade process.

UpgradePrice.DisplayPrice

Int

Net display price available for the upgrade process.

UpgradePrice.DisplayGrossPrice

Int

Gross display price available for the upgrade process.

UpgradePrice.DisplayCurrency

String

Display currency available for the upgrade process.

UpgradePrice.Discount

Float

Applied discounts

UpgradePrice.DiscountedProratedPrice

Float

Prorated net price for the upgrade with applied discounts

UpgradePrice.DiscountedProratedGrossPrice

Float

Prorated gross price for the upgrade with applied discounts

UpgradePrice.DiscountedBillingPrice

Float

Net billing price available for the upgrade process with applied discounts

UpgradePrice.DiscountedBillingGrossPrice

Float

Gross billing price available for the upgrade process with applied discounts

UpgradePrice.DisplayDiscount

Float

Discount displayed for the upgrade process

UpgradePrice.DiscountedDisplayPrice

Float

Net display price available for the upgrade process with applied discounts

UpgradePrice.DiscountedDisplayGrossPrice

Float

Gross display price available for the upgrade process with applied discounts

Last updated

Was this helpful?