Skip to main content

Top 3 converting purchase flows (funnels)

Overview

2Checkout offers you multiple purchases flows that you can use to drive your shoppers through the shopping cart, all the way to the 'Finish' page:

  1. Checkout with cart functionalities
  2. One page checkout without review
  3. One page checkout with review
  4. Add to Shopping Cart
  5. Checkout page
  6. Product page
  7. Express Payments Checkout

After carefully analyzing a selection of our customers' shopping cart performance, we've come up with the three recommended purchase flows that are generating the most sales.

If you are just starting to sell with 2Checkout and this is your first time choosing a purchase flow, you can't go wrong with one of the three detailed below.

If you already have some experience with the 2Checkout platform, we advise you to continually A/B test purchase funnel conversion rates, and you can begin by trying the purchase flows described below and compare their performance with the flow that you are currently using.

Performance

Before we dive into the actual flows, we'd like to give you a short overview of the conversion rates identified on them. 

  • The Checkout Page flow is the top performer
  • The One Page Checkout With Review flow is a runner up
  • The Express Payments Checkout funnel took home the bronze

Checkout page

The purchase flow with the highest measured conversion rate, this flow offers a non-editable purchase experience.

How it works: Your shoppers land on the billing page having the product options already added to their shopping cart.

Best fit: Quick and seamless checkout scenarios, with minimal input from your shoppers.

 

One page checkout with review

Another one of our best converting purchase flows, perfect if you want to provide a sleek and fast purchase experience to your shoppers.

How it works: The shopping cart summary, billing information and the payment details are all on the same page.

Best fit: The biggest advantage of this flow is giving your shoppers the opportunity to fill in all the required information in one page.

Express payments checkout

The third of our best converting purchase flows minimizes billing data entry depending on the selected payment method and facilitates high volumes of payments via PayPal.

How it works: Use the CARD URL parameter to control the flow:

  • use CARD=1 to enable Express payments checkout with review
  • use CARD=2 to enable Express payments checkout without review (this is the default behavior)

Best fit: This purchase flow allows you to take advantage of the optimized design to further streamline the available one page checkout flows.

Conclusion

These are our top three best converting purchase flows. 2Checkout offers you complete control over the shopping experience along with support to optimize the cart to boost conversion rates. However, keep in mind that conversion rate optimization is not a one size fits all technique, so we advise you to try them out and see what works best for you.

We also recommend running A/B testing campaigns to try out different purchase flows on different segments of your traffic and optimize your shopping cart accordingly.

When running an eCommerce business, one of the most important indicators of success is clearly your conversion rate. While many businesses invest a lot of time and money in optimizing the conversion rate of their websites or online stores, it's critical to understand that this process doesn't end with shoppers reaching the shopping cart. This is actually only half of the trick.

Curb cart abandonment and unfinished payments

Overview

As many as 70% to 80% of customers abandon online shopping carts. On top of this, issues preventing successful transaction finalization can impact the shoppers sticking with their order until the end of the purchase funnel. This leaves your business facing the harsh reality of converting only approximately 2 out of every 10 visitors into paying customers.

Follow-up emails for monetizable leads

Instead of settling for only $20 out of every potential $100 of revenue, you need to reach out to untapped leads. Follow-up emails can help you recover up to 20% of your lost customers. The 2Checkout system continually harvests monetizable leads, and it’s up to you to use them to:

  • Increase the conversion rate for the customer acquisition stage
  • Boost subscriber retention with dunning management for recurring billing

Follow the best practices below to curb cart abandonment and collect unfinished payments.

Shopping cart abandons

Shopping cart abandonment is a common issue and happens for various reasons: comparison shopping, lack of money, undecided shoppers, pricing research before trial & buy. A surprising number of shoppers return within a few days to continue shopping, and it's up to you to ease their conversion into paying customers. Here is an easy way to adopt the abandoned cart follow-up configuration:

Type

When

Why?

Basic follow-up

1 hour

Speed is of the essence. Short attention span plagues online shoppers, so the sooner the lead management system can generate and send a follow-up message the better. As a rule of thumb, the first follow-up should reach potential customers within one hour to be as efficient as it can.

Make it easy for customers to return to the shopping cart without having to go back through the purchase process.

Basic follow-up

1 day

Promotional follow-up

3 days

A little incentivizing goes a long way. Offer discounts to make it very hard for an already interested customer to say no.

For ConvertPlus and InLine cart initiated orders, promotions supported are product level promotions (regular and special price promotions) managed directly in the Promotions area.

Unfinished payments

Placed orders for which the payment process was not finished - reasons can vary: expired cards, insufficient funds, authorization declined, etc.

Type

When

Why?

Instant payment methods

1 hour

1 day

3 days

Configure follow-up messages for unfinished payments and increase order recovery rate to as much as 25% from all transaction failures.

 

Offline payment methods

1 day

3 days

7 days

Direct Debit

3 days

7 days

Dunning management

Instantaneous

2Checkout sends out email notifications to subscribers in danger of churning out because their recurring charge failed with a hard decline, an irrecoverable transaction error.

Hard declines recovery with Dunning management, leading to a 15% recovery rate.

Customize follow-up emails

Target your subscribers granularly for each of the scenarios detailed above. Differentiate the lead management emails sent to customers based on the types of unfinished payment, cart abandonment, or dunning events, building custom strategies to target failed recurring transactions effectively.

Contact 2Checkout directly to customize follow-up emails to increase their success rate.

Update customer

Overview

Use the updateCustomerInformation method to update the details of a customer entity from the 2Checkout system.

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.

Customer

Object (required)

Use this object to update customer information.

UpdateEndUserSubscriptions

Optional (boolean)

You can push the changes made on the customer info to the end-user details for all subscriptions belonging to this customer. Set true to have the changes reflected on the end-user details for all subscriptions. If null or false, the changes are made only at the customer level. Default value is false.

Response

Parameters Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$customerReference = CUSTOMER_REFERENCE;
$externalCustomerReference = 'EXTERNAL_CUSTOMER_REFERENCE'; //Optional, but if you include it it needs to belong to the same customer as the internal 2Checkout customer reference

$jsonRpcRequest = array (
'method' => 'getCustomerInformation',
'params' => array($sessionID, $customerReference, $externalCustomerReference),
'id' => $i++,
'jsonrpc' => '2.0');

$existingCustomer = callRPC((Object)$jsonRpcRequest, $host, true);
$existingCustomer->Email = 'newemailaddress@email.com';
$UpdateEndUserSubscriptions = false; // Optional, but if true the changes made on customer info are pushed to all subscriptions from this customer.

$jsonRpcRequest = array (
'method' => 'updateCustomerInformation',
'params' => array($sessionID, $existingCustomer, $UpdateEndUserSubscriptions),
'id' => $i++,
'jsonrpc' => '2.0');

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

Add products

Overview

Use addPromotionProducts to add products to an existing promotion.

Parameters

Parameter Type/Description

sessionID

Required (string)

 

Output of the Login method.

promotionCode

Required (string)

 

The code corresponding to the promotion that you want to add products to.

promotionProducts

Required (object)

 

Code

Required (string)

 

 

System generated product code.

 

pricingConfigurationCode

Optional (string)

 

 

System generated pricing configuration code.

 

pricingOptionCodes

Optional (array of strings)

 

 

Pricing option codes that you control.

Response

Parameter Type/Description
PromotionProducts Object

Request

<?php

require ('PATH_TO_AUTH');

$promotionCode = 'MY_PROMO_CODE_1';

// Define a product to add to the promotion
$newProduct1 = new stdClass;
$newProduct1->Code = '';
$newProduct1->PricingConfigurationCode = '';
$newProduct1->PricingOptionCodes = ['',''];

// Define another product to add to the promotion
$newProduct2 = new stdClass;
$newProduct2->Code = '';
$newProduct2->PricingOptionCodes = [''];

$productPromotion = [$newProduct1, $newProduct2];

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

Single sign-on (SSO)

Overview

Use this method to redirect and login users of the Channel Manager/Partner account automatically from your system into their CM/Partner account based on their email address. This method connects third-party systems with the 2Checkout Channel Manager/Partner Control Panel and enables your partners to seamlessly sign in to their Control Panel.

getPartnerSingleSignOn logs the partner users only into the Channel Manager account associated with your 2Checkout account. This method will not replicate the functionality of a full sign-in operation for users who partnered with multiple 2Checkout vendors and are leveraging connected partner accounts.

Requirements

This method requires you to set a specific partner using setPartner.

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.
email Required (String)
  Channel Manager/Partner user account email address.
partnerCode Required (String)
  Unique partner identifier.
accessPage Required (String)
 

The specific Channel Manager / Partner control panel page you want the user to be redirected to.

Possible values:

You can use any URL in the Channel Manager/Partner Control Panel, including links to specific orders, subscriptions/licenses, and partner invoices.

validityTime Optional (Int)
  The time, in seconds, before the single sign-on URL returned by this method expires. By default, the URL expires after 10 seconds.
validationIP Optional (String)
  The IP address of the Channel Manager/Partner Control Panel user, required for security purposes. Can be an empty string or a valid IP, but cannot be NULL.

Response

Parameter Type/Description
Single sign-on URL String
 

The string is the complete single sign-on URL with a token to allow authentication into Channel Manager from external domains. Partner account users are logged in automatically to their Channel Manager accounts.

The URL can be used only once and only within the interval of time in which it's valid. Call this method again to generate a new single sign-on URL for a subsequent login action.

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.2checkout.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.2checkout.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

$email = 'YOUR_PARTNER_EMAIL';
$partnerCode = 'YOUR_PARTNER_CODE';
$accessPage = 'YOUR_ACCESS_PAGE_URL';
$validityTime = VALIDITY_TIME;
$validationIP = 'VALIDATION_IP_ADDRESS';

try {
    $PartnerSingleSignon= $client-> getPartnerSingleSignOn ($sessionID, $email, $partnerCode , $accessPage, $validityTime, $validationIP);
} catch (SoapFault $e) {
    echo "SSO: " . $e->getMessage();
    exit;
}
var_dump ("SSO", $PartnerSingleSignon);

Errors

Error Description

INVALID_EMAIL

The email address is mandatory.

INVALID_EMAIL

Please specify a valid email address.

INVALID_PARTNER

The partner code is mandatory.

INVALID_PARTNER

Partner code provided is not associated to an active partner account.

INVALID_USER

Email address provided is not associated to a partner account user.

INVALID_URL

The page URL is mandatory.

INVALID_URL

The page URL provided is not valid.

INVALID_VALIDITY_TIME

Validity time needs to be a positive numeric value.

INTERNAL_ERROR

Cannot save security token. Please try again.

 

Turn on auto-advance feature

Overview

Use the Cart object to turn on the auto-advance feature (if mandatory fields are filled in) on the InLine checkout by calling the TwoCoInlineCart.cart.setAutoAdvance(true) method.

Use case

  1. Add an HTML link or button on your page like the one below.
  2. Create a JavaScript click handler to execute the InLine Client desired methods.
  3. Use the TwoCoInlineCart.products.add({code, quantity, options}) method to prepare your catalog product.
  4. Turn on the auto-advance feature by calling the TwoCoInlineCart.cart.setAutoAdvance(true) method.
  5. Set all the mandatory fields for billing.
TwoCoInlineCart.billing.setCountry('US');
TwoCoInlineCart.billing.setEmail('some@email.com');
TwoCoInlineCart.billing.setName('John Doe');

6. Use the TwoCoInlineCart.cart.checkout() method to show the cart on your page.

Request sample

HTML

<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>

JavaScript

window.document.getElementById('buy-button').addEventListener('click', function() {
    TwoCoInlineCart.products.add({
        code: "74B8E17CC0"
    });
    TwoCoInlineCart.cart.setAutoAdvance(true);
      TwoCoInlineCart.billing.setCountry('US');
    TwoCoInlineCart.billing.setEmail('some@email.com');
    TwoCoInlineCart.billing.setName('John Doe');
    TwoCoInlineCart.cart.checkout();
});

Demo

After turning on the cart auto-advance feature using the above method, your cart should look like this:

 

 

Set cart lock in the InLine Cart

Overview

Use the Cart object to lock products by calling the TwoCoInlineCart.cart.setCartLockedFlag(true)method.

Use case

  1. Add an HTML link or button in your page like the one below.
  2. Create a JavaScript click handler to execute the Inline Client desired methods.
  3. Use theTwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.
  4. In order to set currency use TwoCoInlineCart.cart.setCurrency(currency-code).
  5. To lock products use TwoCoInlineCart.cart.setCartLockedFlag(true)method.
  6. You can see below a signature token request payload for this example. A success response contains a JSON with the property “signature“ which needs to be used at the next step to set the signature using the TwoCoInlineCart method.
{
    "merchant": "AVLRNG",
    "currency": "USD",
    "lock": 1,
    "products": [
        {
            "code": "74B8E17CC0",
            "quantity": 3
        }
    ]
}

The above payload will generate the signature ba6ad53ac1cb699daad64bb1d3ef6ab72050787f62a3137d5090c96173a05e85.

7. Use the TwoCoInlineCart.cart.setSignature('ba6ad53ac1cb699daad64bb1d3ef6ab72050787f62a3137d5090c96173a05e85') method to set the signature.

8. Use theTwoCoInlineCart.cart.checkout()method to show the cart on your page.

Sample request

HTML

<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>

Javascript

window.document.getElementById('buy-button').addEventListener('click', function() {
  TwoCoInlineCart.cart.setCurrency('USD');
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0",
    quantity: 3
  });
  TwoCoInlineCart.cart.setSignature('ba6ad53ac1cb699daad64bb1d3ef6ab72050787f62a3137d5090c96173a05e85');
  TwoCoInlineCart.cart.setCartLockedFlag(true);
  TwoCoInlineCart.cart.checkout();
});

Demo

After locking the product page using the above method, your cart should look like this:

 

Product Upgrade Schema

Overview

Use the setProductUpgradeSchema method to set a product’s upgrade schema via API.

Parameters

Parameter Type Required Description
UpgradeSettings Object Required Details below.

          PricingScheme

Integer Required

The Upgrade pricing scheme.

1 – Shopper pays the full upgrade product price;

2 – Shopper pays the difference between the original subscription and the upgraded product;

3 - Shopper pays a prorated upgrade price calculated using the most recent costs incurred by the customer;

4 – Shopper pays prorated upgrade price calculated using the product's pricing set up at the time of the order.

          OptionPriceOperator String Optional The operator that specifies how is the upgrade price impacted (not used for prorated upgrade pricing schemes):

- ADD – the value set as OptionPricePercentage is added to the  upgrade price;

- SUBTRACT – the value set as OptionPricePercentage is subtracted from the upgrade price.
          OptionPricePercentage Integer Optional The percentage of the upgrade price to be added/subtracted from this one (not used for pro-rated upgrade pricing schemes).
          UseProductCatalogPricing Boolean Optional When true, it enables the usage of product catalog pricing. Removing custom prices also disables any existing retention campaigns for the selected subscriptions.
          ProrateIgnoreGracePeriod Boolean Optional When true, it makes the grace period be ignored when calculating Upgrade. Use this option to ignore the grace period set in your Renewal Settings when computing the prorated price for the upgrade.
          SubscriptionUpgradeType Integer Required Determines the Subscription period option for the upgrade:

1 - Create a new subscription (disable the existing one);

2 - Prolong the subscription from the upgrade purchase date;

3 - The upgrade does not affect the original subscription duration. If you upgrade a lifetime subscription to a product that has recurring options, the subscription will remain lifetime, as its duration is not affected by the upgrade process.
AllowUpgradeFrom Array of Strings Required List of product codes corresponding to the products that can be upgraded to the product of reference.

Request sample

<?php

//require_once(realpath(__DIR__ . '/../../../../../') . "/lib/api/v6.0/vendor/autoload.php");
require_once("/srv/www/app/live/htdocs/lib/api/v6.0/vendor/autoload.php");

$apiVersion = '6.0';
$domain = 'api.avangate.local:8081';
$host = "http://{$domain}/soap/{$apiVersion}/";

$client = new SoapClient($host . "?wsdl", array('location' => $host, 'cache_wsdl' => WSDL_CACHE_NONE));
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');

// AlexB Inc account #21478
$merchantCode = "120000589445";
$key = "i9u2+w8%s4^5#8%t)A8?";
$productCode = "ADEV17962UPGRADE";            // main upgrade product offered as upgrade for other products
$upgradeFromProductCode1 = "ADEV17962UPOPT1"; // product that can be upgraded #1
$upgradeFromProductCode2 = "ADEV17962UPOPT12"; // product that can be upgraded #2

$date = gmdate('Y-m-d H:i:s');
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
$hash = hash_hmac('md5', $string, $key);

try {
    $sessionID = $client->login($merchantCode, $date, $hash);
} catch (SoapFault $e) {
    echo  $e->getMessage();

}
echo "SessionID: " . $sessionID . PHP_EOL;

$upgradeSchema = new stdClass();

/** @var \Api\Resources\Product\Assets\UpgradeSettings $upgradeSettings */
$upgradeSettings = new stdClass();
$upgradeSettings->PricingScheme = \Api\Resources\Product\Assets\UpgradeSettings::PRICING_SCHEME_PRICE_DIFFERENCE;
$upgradeSettings->OptionPriceOperator = \Api\Resources\Product\Assets\UpgradeSettings::OPTION_PRICE_OPERATOR_SUBSTRACT;
$upgradeSettings->OptionPricePercentage = 2;
$upgradeSettings->SubscriptionUpgradeType = \Api\Resources\Product\Assets\UpgradeSettings::SUBSCRIPTION_UPGRADE_TYPE_PROLONG_SUBSCRIPTION;
#$upgradeSettings->SubscriptionUpgradeType = 8; // invalid value
$upgradeSettings->UseProductCatalogPricing = true;
#$upgradeSettings->UseProductCatalogPricing = new SoapVar(5, XSD_INTEGER); // integer value 5 => will trigger exception
$upgradeSettings->ProrateIgnoreGracePeriod = false;

$upgradeSchema->UpgradeSettings = $upgradeSettings;
$upgradeSchema->AllowUpgradeFrom = [$upgradeFromProductCode1, $upgradeFromProductCode2];

$payload = json_encode($upgradeSchema, JSON_PRETTY_PRINT);

echo PHP_EOL . 'Calling ' . $host . ' with productCode: ' . $productCode . ' and payload: ' . PHP_EOL . $payload . PHP_EOL;

try {
    $resp = $client->setProductUpgradeSchema($sessionID, $productCode, $upgradeSchema);
} catch (SoapFault $e) {
    echo  '(SoapFault) Exception caught: ' . $e->getMessage() . PHP_EOL;
    die();
}

echo PHP_EOL . 'SetUpgradeSchema response:' . PHP_EOL . var_export($resp, true) . PHP_EOL;

Response

{
    "UpgradeSettings": {
        "PricingScheme": 1,
        "OptionPriceOperator": "ADD",
        "OptionPricePercentage": 3,
        "SubscriptionUpgradeType": 2,
        "UseProductCatalogPricing": false,
        "ProrateIgnoreGracePeriod": false
    },
    "AllowUpgradeFrom": [
        "ADEV17962UPOPT12"
    ]
}

Update upsell campaign

Overview

Use the updateUpSellCampaign method to update an upsell campaign via JSON-RPC API 6.0.

Request Parameters

Parameter Name Type Required/Optional Description
sessionId String Required Unique 2Checkout session ID code.
Code String Required The code of the upsell campaign in UUID format.
UpsellCampaign Object Required New upsell campaign definition.

Name

String

Required

Name of campaign, max 500 characters.

StartDate

String

Optional

The date when the up-sell campaign starts, in the YYYY-MM-DD format. Can be NULL (starts immediately after enabling).

EndDate

String

Optional

The date when the up-sell campaign ends, in the YYYY-MM-DD format. Can be NULL (ends immediately after disabling).

DisplayForManualRenewals

Boolean/Integer

Required

Flag to control if the campaign will be displayed for manual subscription renewal orders. Can be set as true/false/0/1.

Discount

Object

Required

Discount definition object, details below:

      Type

String

Required

Type of discount. Can be FIXED or PERCENT.

      Value

Integer

Required

Percentage discount value (PERCENT discount only).

      Values

Array of objects

Required

List of currency discounts (FIXED discount only), details below:

            Currency

String

Required

Code of Currency for the related amount.

            Amount

Integer

Required

Discount amount value for the related currency.

      DefaultCurrency

String

Required

Code of default Currency (FIXED discount only).

PrimaryProduct

Object

Required

Main (primary) product object, details below:

      Code

String

Required

The code of the product that the recommendation is made for.

      Quantity

Integer

Required

The quantity for the primary product. Can be 0 (standing for any quantity).

      PriceOptions

Array of objects

Optional

Price options list for the primary product, details below:

            Code

String

Required

Price option group code.

            Options

Array of objects

Optional

Price options list, details below:

                  Code

String

Required

Price option code.

                  Value

Integer

Optional

Price option value (for scale interval price option group only).

RecommendedProduct

Object

Required

Recommended product object, details below:

      Code

String

Required

The code of the recommended product.

      Quantity

Integer

Required

The quantity for the recommended product. Can be 0 (standing for “match quantity” setting).

      PriceOptions

Array of objects

Optional

Price options list for the recommended product, details below:

            Code

String

Required

Price option group code.

            Options

Array of objects

Optional

Price options list, details below:

                Code

String

Required

Price option code.

                Value

Integer

Optional

Price option value (for scale interval price options group only).

Enabled

Boolean/Integer

Required

Sets the campaign enabled or disabled. Can be set as true/false/0/1.

Description

Array of objects

Required

List of campaign language descriptions, details below:

      Language

String

Required

Code of the language.

      Text

String

Required

The text of the description in the associated language.

Request example

<?php
require ('PATH_TO_AUTH');

$upsell = new \stdClass();

$upsellCode = 'fc580e11-09e4-483f-b73e-cd0f460bcd9d';

$upsell->Name = 'December 2020 upsell campaign’;
$upsell->StartDate = '2020-12-21';
$upsell->EndDate = '2020-12-25';
$upsell->DisplayForManualRenewals = false;

// setup percent discount
$discountPercent = new \stdClass();
$discountPercent->Type = 'PERCENT';
$discountPercent->Value = 5;

// setup fixed discount
$discountFixed = new \stdClass();
$discountFixed->Type = 'FIXED';
$discountValues = [
    'USD' => 10,
    'EUR' => 8,
    'TRY' => 80,
    'RUB' => 1100,
];
$dv = [];
foreach ($discountValues as $curr => $amt) {
    $disc = new \stdClass();
    $disc->Currency = $curr;
    $disc->Amount = $amt;

    $dv[] = $disc;
}
$discountFixed->Values = $dv;

// assign discount
$upsell->Discount = $discountPercent;
# OR
# $upsell->Discount = $discountFixed;


// setup primary product
$primaryProduct = new \stdClass();
$primaryProduct->Code = $productCode;
$primaryProduct->Quantity = 1;
$ppPriceOptionGroup1 = new \stdClass();
$ppPriceOptionGroup1->Code = 'OPTGRP2';
$ppPriceOptionGroup1Option = new \stdClass();
$ppPriceOptionGroup1Option->Code = 'OptGrp2Code2';
$ppPriceOptionGroup1->Options = [$ppPriceOptionGroup1Option];

$ppPriceOptionGroup2 = new \stdClass();
$ppPriceOptionGroup2->Code = 'interval_scale_grp1';
$ppPriceOptionGroup2Option = new \stdClass();
$ppPriceOptionGroup2Option->Code = 'interval_scale_grp1-1-10';
$ppPriceOptionGroup2Option->Value = '6';
$ppPriceOptionGroup2->Options = [$ppPriceOptionGroup2Option];

$primaryProduct->PriceOptions = [$ppPriceOptionGroup1, $ppPriceOptionGroup2];
$upsell->PrimaryProduct = $primaryProduct;

// setup recommended product
$recommProduct = new \stdClass();
$recommProduct->Code = $recProductCode;
$recommProduct->Quantity = 0; // stands for “match quantity” 
$rpPriceOptionGroup1 = new \stdClass();
$rpPriceOptionGroup1->Code = 'CHECKB_LIST';
$rpPriceOptionGroup1Option1 = new \stdClass();
$rpPriceOptionGroup1Option1->Code = 'chk1';
$rpPriceOptionGroup1Option2 = new \stdClass();
$rpPriceOptionGroup1Option2->Code = 'chk3';
$rpPriceOptionGroup1->Options = [$rpPriceOptionGroup1Option1, $rpPriceOptionGroup1Option2];
$recommProduct->PriceOptions = [$rpPriceOptionGroup1];
$upsell->RecommendedProduct = $recommProduct;

$upsell->Enabled = true;

// setup languagte descriptions / texts
$enDescription = new \stdClass();
$enDescription->Language = 'EN';
$enDescription->Text = 'Buy <!--{RECOMMENDED_PRODUCT_NAME}--> for just <!--{RECOMMENDED_PRODUCT_PRICE}--> until Dec 25th';
$upsell->Description = [$enDescription];

$jsonRpcRequest = new \stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateUpsellCampaign';
$jsonRpcRequest->params = [$sessionID, $upsellCode, $upsell];
$jsonRpcRequest->id = $i++;

$upsellResponse = callRPC($jsonRpcRequest, $host);

Response

Parameters Type Description

UpSell

Object

Object containing information related to the upsell campaigns, including product information and discount settings.

 

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