# Retrieve recommended upsell campaign

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

<table><thead><tr><th width="198">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>SessionId</code></td><td><p><strong>Required (string)</strong></p><p>Unique 2Checkout session ID code.</p></td></tr><tr><td><code>ProductCode</code></td><td><p><strong>Required (string)</strong></p><p>The primary product code.</p></td></tr><tr><td><code>Quantity</code></td><td><p><strong>Optional (integer)</strong></p><p>The product quantity.</p></td></tr><tr><td><code>PriceOptions</code></td><td><p><strong>Optional (string)</strong></p><p>The price options for the primary product.</p></td></tr><tr><td><code>EnabledForRenewals</code></td><td><p><strong>Optional (boolean)</strong></p><p>Returns only upsell campaigns that are enabled (or not) for renewals.</p></td></tr></tbody></table>

### Request sample

```php
<?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

<table><thead><tr><th width="141.466552734375">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><a href="/pages/1a7741866b1eaedfee943ee450d04ecaabd287bc"><code>UpSell</code></a></td><td><p><strong>Object</strong></p><p>Object containing information related to the upsell campaigns, including product information and discount settings.</p></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/upsell/retrieve-recommended-upsell-campaign.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
