For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a cross-sell campaign

Use the updateCrossSellCampaign method to update a cross-sell campaign for your 2Checkout account.

Request parameters

Parameter
Type / Description

CampaignCode

Required (string) The campaign code that can be used when placing orders.

MasterProducts

Required (array of strings) Array of product codes to apply to this campaign.

DisplayType

Required (string) The display type of the campaign; Can be cart, review, finish.

DisplayInEmail

Required (boolean) Determines if the campaign will be displayed in payment receipt emails.

Products

Required (array of objects) 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

Required (string) Product code of the product to be recommended to the shopper.

Discount

Required (float) Value of the discount.

DiscountType

Required (string) Can only be 'PERCENT'.

Name

Required (string) Name of the campaign.

CampaignStatus

Optional (string) The status of the cross-sell campaign.

StartDate

Optional (string) The date when the cross-sell campaign starts, formatted as YYYY-MM-DD.

EndDate

Optional (string) 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 = 'testingSoap'; 
$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 = 19; 
$csCampaign->Products[0]->DiscountType = 'PERCENT'; 
 
try { 
    $csCampaignResponse = $client->updateCrossSellCampaign($sessionID, $csCampaign); 
} catch (SoapFault $e) { 
    echo  $e->getMessage(); 
}

Response parameters

Parameter
Type / Description

CampaignCode

Required (string) The campaign code that can be used when placing orders.

MasterProducts

Required (array of strings)

Array of product codes to apply to this campaign.

DisplayType

Required (string) The display type of the campaign; Can be cart, review, finish.

DisplayInEmail

Required (boolean) Determines if the campaign will be displayed in payment receipt emails. Can be 'true' or 'false'.

Products

Required (array of objects) 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

Required (string) Product code of the product to be recommended to the shopper.

Discount

Required (float) Value of the discount.

DiscountType

Required (string) Can only be 'PERCENT'.

Name

Required (string) Name of the campaign.

CampaignStatus

Optional (string) The status of the cross-sell campaign.

StartDate

Optional (string) The date when the cross-sell campaign starts, formatted as YYYY-MM-DD.

EndDate

Optional (string) The date when the cross-sell campaign ends, formatted as YYYY-MM-DD.

Last updated

Was this helpful?