# Create a cross-sell campaign

Use the **createCrossSellCampaign** method to create a cross-sell campaign for your 2Checkout account.

## Request parameters

<table><thead><tr><th width="158.5333251953125">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>MasterProducts</code></td><td><p><strong>Required (array of strings)</strong></p><p>Array of product codes to apply to this campaign.</p></td></tr><tr><td><code>DisplayType</code></td><td><p><strong>Required (string)</strong></p><p>The display type of the campaign; Can be cart, review, finish.</p></td></tr><tr><td><code>DisplayInEmail</code></td><td><p><strong>Required (boolean)</strong></p><p>Determines if the campaign will be displayed in payment receipt emails.</p></td></tr><tr><td><code>Products</code></td><td><p><strong>Required (array of objects)</strong></p><p>Array of objects containing the product codes pointing to the promoted products when tied to each master product, the discount value, and the discount type (can only be percent).</p></td></tr><tr><td><code>ProductCode</code></td><td><p><strong>Required (string)</strong></p><p>Product code of the product to be recommended to the shopper.</p></td></tr><tr><td><code>Discount</code></td><td><p><strong>Required (float)</strong></p><p>Value of the discount.</p></td></tr><tr><td><code>DiscountType</code></td><td><p><strong>Required (string)</strong></p><p>Can only be 'PERCENT'.</p></td></tr><tr><td><code>Name</code></td><td><p><strong>Required (string)</strong></p><p>Name of the campaign.</p></td></tr><tr><td><code>StartDate</code></td><td><p><strong>Optional (string)</strong></p><p>The date when the cross-sell campaign starts, formatted as YYYY-MM-DD.</p></td></tr><tr><td><code>EndDate</code></td><td><p><strong>Optional (string)</strong></p><p>The date when the cross-sell campaign ends, formatted as YYYY-MM-DD.</p></td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$csCampaign = new stdClass();
$csCampaign->MasterProducts = ['C8851A5BC9'];
$csCampaign->DisplayType = 'cart';
$csCampaign->DisplayInEmail = false;
$csCampaign->Name = 'testing';
$csCampaign->StartDate = '2019-09-20';
$csCampaign->EndDate = '2020-10-21';
$csCampaign->Products = [];
$csCampaign->Products[0] = new stdClass();
$csCampaign->Products[0]->ProductCode = '512712FA53';
$csCampaign->Products[0]->Discount = 15;
$csCampaign->Products[0]->DiscountType = 'PERCENT';

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'createCrossSellCampaign';
$jsonRpcRequest->params = array($sessionID, $csCampaign);
$jsonRpcRequest->id = $i++;

$csCampaignResponse = callRPC($jsonRpcRequest, $host, true);
```

## Response parameters

<table><thead><tr><th width="160.6666259765625">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>CampaignCode</code></td><td><p><strong>Required (string)</strong></p><p>The campaign code that can be used when placing orders.</p></td></tr><tr><td><code>MasterProducts</code></td><td><p><strong>Required (array of strings)</strong></p><p>Array of product codes to apply to this campaign.</p></td></tr><tr><td><code>DisplayType</code></td><td><p><strong>Required (string)</strong></p><p>The display type of the campaign; Can be cart, review, finish.</p></td></tr><tr><td><code>DisplayInEmail</code></td><td><p><strong>Required (boolean)</strong></p><p>Determines if the campaign will be displayed in payment receipt emails. Can be 'true' or 'false'.</p></td></tr><tr><td><code>Products</code></td><td><p><strong>Required (array of objects)</strong></p><p>Array of objects containing the product codes pointing to the promoted products when tied to each master product, the discount value, and the discount type (can only be percent).</p></td></tr><tr><td><code>ProductCode</code></td><td><p><strong>Required (string)</strong></p><p>Product code of the product to be recommended to the shopper.</p></td></tr><tr><td><code>Discount</code></td><td><p><strong>Required (float)</strong></p><p>Value of the discount.</p></td></tr><tr><td><code>DiscountType</code></td><td><p><strong>Required (string)</strong></p><p>Can only be 'PERCENT'.</p></td></tr><tr><td><code>Name</code></td><td><p><strong>Required (string)</strong></p><p>Name of the campaign.</p></td></tr><tr><td><code>CampaignStatus</code></td><td><p><strong>Optional (string)</strong></p><p>The status of the cross-sell campaign.</p></td></tr><tr><td><code>StartDate</code></td><td><p><strong>Optional (string)</strong></p><p>The date when the cross-sell campaign starts, formatted as YYYY-MM-DD.</p></td></tr><tr><td><code>EndDate</code></td><td><p><strong>Optional (string)</strong></p><p>The date when the cross-sell campaign ends, formatted as YYYY-MM-DD.</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/cross-sell/create-a-cross-sell-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.
