Skip to main content

Retrieve recommended upsell campaign

Retrieve recommended upsell campaign

Last updated: 02-Jun-2021
Rate this article:

Overview

Use the getRecommendedUpsellCampaign method via JSON-RPC API 6.0 to find a campaign for the product code and the other sent filters.

Request Parameters

Parameter Name Type Required/Optional Description
SessionId String Required

Unique 2Checkout session ID code.

 

ProductCode String Required

The primary product code.

Quantity Integer Optional

The product quantity.

PriceOptions String Optional

The price options for the primary product.

EnabledForRenewals Boolean Optional

Returns only upsell campaigns that are enabled (or not) for renewals.

Request Example

<?php

require('PATH_TO_AUTH');

$productCode = 'upsell_module_po';
$quantity = 13;
$priceOptions = 'option1,module_scale_po2=5';
$enabledForRenewals = true;

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getRecommendedUpsellCampaign';
$jsonRpcRequest->params = [$sessionID, $productCode, $quantity, $priceOptions, $enabledForRenewals];
$jsonRpcRequest->id = $i++;

$resp = callRPC($jsonRpcRequest, $host);
$response = json_encode($resp, JSON_PRETTY_PRINT);
echo PHP_EOL . 'getRecommendedUpsellCampaign response:' . PHP_EOL . var_export($resp, true) . PHP_EOL;

Response

Parameters Type Description

UpSell

Object

Object containing information related to the upsell campaigns, including product information and discount settings.
Rate this article:
Logo of Verifone