Skip to main content

Retrieve upgrade price

Last updated: 22-Jun-2023
Rate this article:

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

The response returns details about the upgrade price for a single product. For multiple products, the user needs to calculate the value using the quantity x upgradePrice (the value from the returned response) parameters.

Request

<?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);

 

Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo