Update a cross-sell campaign
Overview
Use the updateCrossSellCampaign method to update a cross-sell campaign for your 2Checkout account.
Request parameters
Parameters | Type | Required | Description |
---|---|---|---|
CampaignCode |
String |
Required |
The campaign code that can be used when placing orders. |
MasterProducts |
Array of strings |
Required |
Array of product codes to apply to this campaign. |
DisplayType |
String |
Required |
The display type of the campaign; Can be cart, review, finish. |
DisplayInEmail |
Boolean |
Required |
Determines if the campaign will be displayed in payment receipt emails. |
Products |
Array of objects |
Required |
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). |
ProductCode |
String |
Required |
Product code of the product to be recommended to the shopper. |
Discount |
Float |
Required |
Value of the discount. |
DiscountType |
String |
Required |
Can only be 'PERCENT'. |
Name |
String |
Required |
Name of the campaign. |
CampaignStatus |
String |
Optional |
The status of the cross-sell campaign. |
StartDate |
String |
Optional |
The date when the cross-sell campaign starts, formatted as YYYY-MM-DD. |
EndDate |
String |
Optional |
The date when the cross-sell campaign ends, formatted as YYYY-MM-DD. |
Response parameters
Parameters | Type | Required | Description |
---|---|---|---|
CampaignCode |
String |
Required |
The campaign code that can be used when placing orders. |
MasterProducts |
Array of strings |
Required |
Array of product codes to apply to this campaign. |
DisplayType |
String |
Required |
The display type of the campaign; Can be cart, review, finish. |
DisplayInEmail |
Boolean |
Required |
Determines if the campaign will be displayed in payment receipt emails. Can be 'true' or 'false'. |
Products |
Array of objects |
Required |
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). |
ProductCode |
String |
Required |
Product code of the product to be recommended to the shopper. |
Discount |
Float |
Required |
Value of the discount. |
DiscountType |
String |
Required |
Can only be 'PERCENT'. |
Name |
String |
Required |
Name of the campaign. |
CampaignStatus |
String |
Optional |
The status of the cross-sell campaign. |
StartDate |
String |
Optional |
The date when the cross-sell campaign starts, formatted as YYYY-MM-DD. |
EndDate |
String |
Optional |
The date when the cross-sell campaign ends, formatted as YYYY-MM-DD. |
Request sample
<?php
require ('PATH_TO_AUTH');
$csCampaign = new stdClass();
$csCampaign->CampaignCode = '2Xrl85eSkemBv3G3ea+9fg==';
$csCampaign->MasterProducts = ['C8851A5BC9'];
$csCampaign->DisplayType = 'review';
$csCampaign->DisplayInEmail = true;
$csCampaign->Name = 'testingRpc';
$csCampaign->StartDate = '2019-10-21';
$csCampaign->EndDate = '2021-10-21';
$csCampaign->CampaignStatus = 'ACTIVE';
$csCampaign->Products = [];
$csCampaign->Products[0] = new stdClass();
$csCampaign->Products[0]->ProductCode = '512712FA53';
$csCampaign->Products[0]->Discount = 20;
$csCampaign->Products[0]->DiscountType = 'PERCENT';
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'updateCrossSellCampaign';
$jsonRpcRequest->params = array($sessionID, $csCampaign);
$jsonRpcRequest->id = $i++;
$csCampaignResponse = callRPC($jsonRpcRequest, $host, true)