Skip to main content

Retrieve price based on geolocation

Overview

Use the getPrice method to retrieve product prices based on geolocation. 

To display product prices on your website without having the geolocation feature, you can use the getPrice API method, as described below.

Request example

var data = {
    PRODS: ' 12345678', // product ID
    OPTIONS 12345678: '', // product pricing options if any
    QTY: 1, //product quantity
    CURRENCY: 'EUR', //product currency
    COUPON: null, //discount to be applied
    RESPONSE_TYPE: 'JSON'
};
$.ajax({
    type: 'GET',
    url: 'https://' + window.location.host + '/action/get_price.php',
    data: data,
    success: function (data) {
        // your code here
    },
    error: function (error) {
        console.error(error);
    },
});

A built URL that displays prices based on the customer's geolocation would look like this:

https://secure.2checkout.com/action/get_price.php?PRODS=12345678&OPTIONS12345678&QTY=1&CURRENCY=EUR&COUPON=null&RESPONSE_TYPE=JSON

The quantity parameter is used only to retrieve the unit price with volume discounts if this was applied to the product. Setting quantity=2 in the request will not return the price for quantity 2, but it will return the unit price corresponding to the quantity interval specified.

For example if the unit price is:

Quantity =1 to 10 = 100USD

Quantity= 10+ = 90USD

A request with quantity 11 will not return 1100USD, it will return 90USD. While a call with quantity= 5, will return 100USD, not 500USD. 

Subscription renewal notifications

Overview

Use the setRenewalNotificationStatus method to subscribe or unsubscribe shoppers from subscription renewal notifications.

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.

Status

Required (boolean)

 

true – enable subscription renewal notifications.

false – disable subscription renewal notifications.

Response

Boolean

true or false depending on whether or not the operation succeeded.

Request


<?php
 
 
function callRPC($Request, $hostUrl, $Debug = true) {
    $curl = curl_init($hostUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($curl, CURLOPT_SSLVERSION, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
    $RequestString = json_encode($Request);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);
 
 
    if ($Debug) {
        $RequestString;
    }
    $ResponseString = curl_exec($curl);
    if ($Debug) {
        $ResponseString;
    }
 
    if (!empty($ResponseString)) {
        $Response = json_decode($ResponseString);
        if (isset($Response->result)) {
            return $Response->result;
        }
        if (!is_null($Response->error)) {
            var_dump($Request->method, $Response->error);
        }
    } else {
        return null;
    }
}
 
$host = 'https://api.avangate.com/rpc/3.0/';
 
$merchantCode = "YOUR_MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key = "YOUR_SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
 
$string = strlen($merchantCode) . $merchantCode . strlen(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
// call login
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
 
$sessionID = callRPC($jsonRpcRequest, $host);
 
var_dump($sessionID);
$subscriptionReference = '30E47F8699';
$Status = false;

$jsonRpcRequest = array (
'method' => 'setRenewalNotificationStatus',
'params' => array($sessionID, $subscriptionReference, $Status),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

 

Retrieve customer subscriptions

Overview

Use the getCustomerSubscriptions method to retrieve details about the subscriptions belonging to a specific customer.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.

AvangateCustomerReference

Required (int)

 

System-generated customer reference. Required unless you prefer to use ExternalCustomerReference.

ExternalCustomerReference

Optional (string)

 

External customer reference that you control. Optional when you use AvangateCustomerReference. If you include it, it needs to belong to the same customer as the AvangateCustomerReference.

Response

Parameters Type/Description

Subscription

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$AvangateCustomerReference = CUSTOMER_REFERENCE;
$ExternalCustomerReference = 'EXTERNAL_CUSTOMER_REFERENCE'; // optional

$jsonRpcRequest = array (
'method' => 'getCustomerSubscriptions',
'params' => array($sessionID, $AvangateCustomerReference,ExternalCustomerReference),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Disable a subscription

Overview

Use the cancelSubscription method to disable an active subscription. 2Checkout disables the subscription immediately and no longer performs any recurring billing actions.

Parameters

Parameters Type/Description

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Response

Parameters Type/Description

Boolean

true or false depending on whether the call resulted in success or not.

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

$jsonRpcRequest = array (
'method' => 'cancelSubscription',
'params' => array($sessionID, $subscriptionReference),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Attach reseller information to an order

Overview

Use this method to add reseller details to a partner order.

Requirements

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, which is the output of the Login method. An exception is thrown if the values are incorrect.
refNo Required (String)
  The unique, system-generated identifier of a partner order.
resellerCode Required (String)
  Unique code identifying a specific reseller.

Response

Parameters Type/Description
result Boolean
  True or false

Request

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner

$refNo = 'YOUR_ORDER_REFERENCE_NUMBER';
$resellerCode = 'NEW_RESELLER_CODE';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setOrderReseller',
'params' => array($sessionID, $refNo, $resellerCode)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

Errors

Error Description

NOT_FOUND_PARTNER

No partner set before invoking the method.

EMPTY_ORDER_REFERENCE

Order reference not provided.

INVALID_PARTNER_RESELLER_CODE

Invalid partner reseller provided.

INVALID_SUBSCRIPTION_REFERENCE

No reseller defined for this order reference.

INVALID_PARTNER_RESELLER_CODE

No partner reseller found for the specified code.

One click (1-click) purchase

Overview

2Checkout supports 1-click purchases for returning customers who paid for their previous orders with:

  • Credit/Debit cards
  • PayPal

How does this work?

  1. Identify returning customers. 
  2. Access data on the previous purchases of returning customers.
  3. Validate previous order references for 1-click purchase scenarios using the isValidOrderReference method.
  4. Place a new order using a valid previous order reference as the payment method. 
  5. 2Checkout charges returning customers using their payment-on-file information, either a card or their PayPal account. 

Availability

Select 2Checkout accounts. Contact 2Checkout for more details. 

Requirements

  • Use only references to previous orders with one of the following statuses AUTHRECEIVED or COMPLETE.
  • The email address of the BillingDetails object is mandatory and it needs to match the email address used as a part of the billing details of the initial order whose reference you're now using to place a new order. 2Checkout checks whether the email addresses are identical, and throws an error if they're not, blocking the order placement process. Note: You need to provide only the email address of the shopper, and can ignore the rest of the required customer billing information. If you enter any billing details in addition to the email address, you'll have to provide all the information required in the BillingDetails object.

Parameters

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

Response

Order information

Object

Request


<?php
echo "<pre>";
$host   = "https://api.2checkout.com";
$client = new SoapClient($host . "/soap/3.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$key = "SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$now = date('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$orderReference = '45452071';
try {
    $validOrderRef = $client->isValidOrderReference($sessionID, $orderReference);
}
catch (SoapFault $e) {
    echo "validOrderRef: " . $e->getMessage();
    exit;
}
var_dump("validOrderRef", $validOrderRef);
try {
    $existentOrder = $client->getOrder($sessionID, $orderReference);
}
catch (SoapFault $e) {
    echo "existentOrder: " . $e->getMessage();
    exit;
}
$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'usd';
$Order->Country = 'US';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->AffiliateId = NULL;
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1; 
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false; 
$Order->Items[0]->AdditionalFields = NULL;
$Order->BillingDetails = new stdClass();
$Order->BillingDetails = $existentOrder->BillingDetails;
$Order->DeliveryDetails = NULL;
$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'PREVIOUS_ORDER';
$Order->PaymentDetails->Currency = 'usd';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->RefNo = $orderReference;
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;
try {
    $newOrderPaidWithPreviousRef = $client->placeOrder($sessionID, $Order);
}
catch (SoapFault $e) {
    echo "newOrderPaidWithPreviousRef: " . $e->getMessage();
    exit;
}
var_dump("newOrderPaidWithPreviousRef", $newOrderPaidWithPreviousRef);
?>

 

Retrieve subscriptions

Overview

Extract information on your account’s subscriptions. Use the searchSubscriptions method to retrieve details about your account’s subscriptions, based on a set of filters.  Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

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.

searchBy

Optional (Object)

 

Unique, system-generated subscription identifier.

 

SubscriptionSearchOptions Parameters Type/Description

CustomerEmail

Optional (string)

 

Customer email address. Can be NULL.

Note: The CustomerEmail parameter must be paired always with another reference pointing to the correct customer, such as the AvangateCustomerReference parameter or the ExternalCustomerReference parameter. Otherwise, the search call will return partial hits on the customer email address.

ExactMatchEmail Optional (Boolean)
 

Force search by email to perform exact match; recommended to keep this option set to true in order to avoid matching similar email addresses from multiple customers.

DeliveredCode

Optional (string)

 

Activation key/code. Can be NULL.

AvangateCustomerReference

Optional (int)

 

System-generated customer reference. Can be NULL.

ExternalCustomerReference

Optional (string)

 

External customer reference that you control. Can be NULL.

Aggregate

Optional (boolean)

 

true - search will work across all your aggregated Avangate accounts.

false - default value. You limit the search to the account whose details you used for authentication.

Can be NULL.

SubscriptionEnabled

Optional (boolean)

 

true for enabled subscriptions.

false for disabled subscriptions.

Can be NULL.

RecurringEnabled

Optional (StringArray)

 

true – Avangate charges customers using recurring billing for subscriptions.

false – customers need to make manual payments to renew their subscriptions.

Can be NULL.

ProductCodes

Optional (StringArray)

 

Product identifier that you control. Can be NULL.

CountryCodes

Optional (string)

 

Country code (ISO 3166 two-letter code). Can be NULL.

PurchasedAfter

Optional (string)

 

YYYY-MM-DD. Subscription search interval start. You can search for subscriptions purchased between the dates you set using PurchasedAfter and PurchasedBefore. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

PurchasedBefore

Optional (string)

 

YYYY-MM-DD. Subscription search interval end. You can search for subscriptions purchased between the dates you set using PurchasedAfter and PurchasedBefore. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

ExpireAfter

Optional (string)

 

YYYY-MM-DD. Search subscriptions set to expire after a specific date. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

ExpireBefore

Optional (string)

 

YYYY-MM-DD. Search subscriptions set to expire before a specific date. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

ModifiedAfter Optional (string)
  YYYY-MM-DD HH-MM-SS. Search subscriptions modified after a specific date.
ModifiedBefore Optional (string)
  YYYY-MM-DD HH-MM-SS. Search subscriptions modified before a specific date.

RenewedAfter

Optional (string)

 

YYYY-MM-DD. Search subscriptions renewed after a specific date. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

RenewedBefore

Optional (string)

 

YYYY-MM-DD. Search subscriptions renewed before a specific date. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

NotificationAfter

Optional (string)

 

YYYY-MM-DD. Search subscriptions for which the Avangate system sent out notifications after a specific date. Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

NotificationBefore

Optional (string)

 

YYYY-MM-DD. Search subscriptions for which the Avangate system sent out notifications before a specific date Note: The default Avangate API time zone is GMT+02:00. Can be NULL.

Type

Optional (string)

 

trial - trial subscriptions.

regular - all generated subscriptions that are not trials.

regularfromtrial - subscriptions generated from a trial conversion.

Can be NULL.

TestSubscription

Optional (boolean)

 

true

false, depending on whether you want to include test subscriptions in the search or not. Can be NULL.

LifetimeSubscription

Optional (boolean)

 

true – evergreen subscriptions.

false - subscriptions with a limited recurring billing cycle, typically no larger than 36 months.

Can be NULL.

Page

Optional (int)

 

A specific page of search results. Default value is 1.

Can be NULL.

Limit

Optional (int)

 

Number of results (subscriptions) displayed per page. Default value is 10.

Can be NULL.

Response

Parameters Type/Description

Subscription

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$SubscriptionSearch = new stdClass();
$SubscriptionSearch->CustomerEmail  = 'example@email.com';
$SubscriptionSearch->DeliveredCode = null;
$SubscriptionSearch->AvangateCustomerReference = null;
$SubscriptionSearch->ExternalCustomerReference = null;
$SubscriptionSearch->Aggregate = false;
$SubscriptionSearch->SubscriptionEnabled = null; //true false null
$SubscriptionSearch->RecurringEnabled = null; // true - autorenewal, false - manual renewal, null = both(default)
$SubscriptionSearch->ProductCodes = null; //array('Product_Code1', 'Product_Code2');
$SubscriptionSearch->CountryCodes = null;//array ('au')
$SubscriptionSearch->PurchasedAfter = null;
$SubscriptionSearch->PurchasedBefore = null;
$SubscriptionSearch->ExpireAfter = null;
$SubscriptionSearch->ExpireBefore = null;
$SubscriptionSearch->LifetimeSubscription = null;
$SubscriptionSearch->Type = 'regular'; //'trial', 'regular', 'regularfromtrial'
$SubscriptionSearch->TestSubscription = null; // true, false, null = both(default) $SubscriptionSearch->Page = 1;$SubscriptionSearch->Limit = 25;
$SubscriptionSearch->Page = 1;
$SubscriptionSearch->Limit = 10;

$jsonRpcRequest = array (
'method' => 'searchSubscriptions',
'params' => array($sessionID, $SubscriptionSearch),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Pricing configuration

Overview

This object is returned directly or within a successful response from the following API requests:

Retrieve a pricing configuration by name            Retrieve a pricing configuration by code               Retrieve pricing configurations

Pricing configuration object

Parameters Type/Description

Name

String

 

Pricing configuration name.

Code

String

 

System-generated identifier. Read-only.

Default

Boolean

 

True for the default pricing configuration

BillingCountries

Array of strings

 

ISO codes of the countries assigned to the pricing configuration.

Empty unless a pricing configuration has specific countries assigned.

PricingSchema

String

 

DYNAMIC – With a base price

FLAT – Without a base price

PriceType

String

 

Possible values:

• NET

• GROSS

DefaultCurrency

String

 

The ISO code of the default currency for the pricing configuration.

Prices

Object

 

Details below.

 

Regular

Array of objects

 

 

Details below.

 

 

Amount

Int

 

 

 

The price of the product. Use -1 to delete it.

 

 

Currency

String

 

 

 

ISO code of the currency for the product price.

 

 

MinQuantity

Int

 

 

 

The minimum quantity of volume discounts. Default is 1.

 

 

MaxQuantity

Int

 

 

 

The maximum quantity of volume discounts. Default is 99999.

 

 

OptionCodes

Array of objects

 

 

 

Details below.

 

 

 

Code

String

 

 

 

 

System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

 

 

Options

StringArray

 

 

 

 

The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

Renewal

Array of objects

 

 

Details below.

 

 

Amount

Int

 

 

 

The price of the product. Use -1 to delete it.

 

 

Currency

String

 

 

 

ISO code of the currency for the product price.

 

 

MinQuantity

Int

 

 

 

The minimum quantity of volume discounts. Default is 1.

 

 

MaxQuantity

Int

 

 

 

The maximum quantity of volume discounts. Default is 99999.

 

 

OptionCodes

Array of objects

 

 

 

Details below.

PriceOptions

Array of objects

 

Details below.

 

Code

String

 

 

System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

Required

Boolean

 

 

true – you set the price options group as required during the purchase process.

false - you did not set the price options group as required during the purchase process.

SSO by customer reference

Overview

Use the getSingleSignOnByCustomer method to create Single Sign On links into 2Checkout myAccount based on customer references (IDs). Use either the 2Checkout Customer Reference or the External Customer Reference to identify specific customers.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

idCustomer

Required (string)

 

Unique customer identifiers. Can be either the ExternalCustomerReference you control or the system-generated 2CheckoutCustomerReference.

customerType

Required (string)

 

Possible values:

  • ExternalCustomerReference
  • 2CheckoutCustomerReference

page

Optional (string)

 

The specific myAccount page where you redirect the customer.

Possible values:

my_subscription - redirect shoppers to the subscription's page of myAccount based on the SubscriptionReference you provide.

my_products - redirects shoppers to the myAccount page designed to list all products purchased from 2Checkout.

https://store.YourCustomDomain.com/m...t/my_products/?

user_data - redirects shoppers to the Personal Information page in myAccount

https://store.YourCustomDomain.com/m...unt/user_data/?

order_lookup - redirects shoppers to the Order Lookup area of myAccount:

https://store.YourCustomDomain.com/m.../order_lookup/

faq - redirects shoppers to the Support page of myAccount

https://secure. YourCustomDomain.com/support/

payment_methods – redirect shoppers to the Payment Methods area of myAccount:

https://store.YourCustomDomain.com/m...yment_methods/

Do not include PAGE in the URL to redirect shoppers to myAccount homepage

https://store.YourCustomDomain.com/myaccount/?

 

request

Optional (string)

 

Needed for 'my_subscription'

Request[]=code=123D40F123 redirects customers to the page for the subscription with the 123D40F123 SubscriptionReference value.

 

validityTime

Optional (int)

 

The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds. (optional)

validationIp

Optional (string)

 

The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.

Response

Parameters Type/Description

Single sign-on URL

String

 

The string generated is the complete single sign-on URL pointing to 2Checkout myAccount, containing the unique URL. Shoppers using it log into their 2Checkout myAccount automatically.

Request

<?php

require ('PATH_TO_AUTH');

$idCustomer = '352365983';
$customerType = '2CheckoutCustomerReference';
$page = 'my_license';
$request = null;
$validityTime = 50;
$validationIp = null;
$languageCode = 'en';

try {
    $ssoLINK = $client->getSingleSignOnByCustomer(
        $sessionID,
        $idCustomer,
        $customerType,
        $page,
        $request,
        $validityTime,
        $validationIp,
        $languageCode // optional
    );
}
catch (SoapFault $e) {
    echo "ssoLINK: " . $e->getMessage();
    exit;
}
var_dump("ssoLINK", $ssoLINK);

Retrieve product groups

Overview

Use the getProductGroups method to extract information about the product groups you created for your account.

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.

Response

Parameters Type/Description

ProductGroup

Array of objects

Request

 <?php

require ('PATH_TO_AUTH');

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getProductGroups',
'params' => array($sessionID)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

?>

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