Retrieve recommended upsell campaign
Last updated: 02-Jun-2021
Use the getRecommendedUpsellCampaign method via JSON-RPC API 6.0 to find a campaign for the product code and the other sent filters.
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. |
<?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;
Parameters | Type | Description |
---|---|---|
Object |
Object containing information related to the upsell campaigns, including product information and discount settings. |
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.
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.