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

Cross Sell

Get Cross Sell campaigns by filter

get
Query parameters
CampaignNamestringOptionalExample: Christmas campaign
Statusstring[]OptionalExample: ["ACTIVE","INACTIVE"]
Typestring · enumOptionalExample: MERCHPossible values:
Productsstring[]OptionalExample: ["34924C876E","34AF4C876S"]
RecommendedProductsstring[]OptionalExample: ["34924C876E","34AF4C876S"]
StartDatestringOptionalExample: 2020-09-03T16:28:32+04:00
EndDatestringOptionalExample: 2020-12-03T16:28:32+04:00
PagenumberOptionalExample: 1
LimitnumberOptionalExample: 10
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Returns Cross Sell campaign collection

application/json
get/crosssells
GET /rest/6.0/crosssells HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "Items": [
    {
      "IdCrossSellingCampaign": 435908435,
      "Name": "My campaign",
      "CampaignCode": "2Xrl83GEn+uBr3G3ddW9eg==",
      "DisplayType": "cart",
      "ProductCode": "cart",
      "MasterProducts": [
        "SOME_PRODUCT_CODE"
      ],
      "Products": [
        {
          "ProductCode": "SOME_PRODUCT_CODE",
          "Discount": 10,
          "DiscountType": "PERCENT",
          "Type": "Own",
          "AutoAdded": false,
          "DiscountedPrice": [
            {
              "Currency": "EUR",
              "Price": 9.04
            }
          ],
          "BasePrice": [
            {
              "Currency": "EUR",
              "Price": 9.04
            }
          ]
        }
      ]
    }
  ],
  "Pagination": {
    "Page": 1,
    "Limit": 10,
    "Count": 12
  }
}

Create a new Cross Sell campaign

post
Header parameters
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
AcceptstringRequiredExample: application/json
Body
NamestringRequired

Name of campaign, max 255 chars.

Example: New campaign
MasterProductsstring[]Required

array of product code ids to which this cross sell is going to be applied to

Example: FD86FD98
DisplayTypestring · enumRequired

Where should cross sell products be displayed

Example: cartPossible values:
DisplayInEmailbooleanRequired

true/false - display in payment receipt emails or not

Example: false
StartDatestring · nullableOptional

When should campaign start

Example: 2020-12-20
EndDatestring · nullableOptional

When should campaign end

Example: 2021-12-20
Responses
200

Create campaign response

application/json
CampaignCodestringOptionalExample: 123
NamestringOptionalExample: New campaign
MasterProductsstring[]OptionalExample: FD86FD98
DisplayTypestring · enumOptionalExample: cartPossible values:
DisplayInEmailbooleanOptionalExample: false
StartDatestringOptionalExample: 2020-12-20
EndDatestringOptionalExample: 2021-12-20
Errorsstring[]Optional

Validation errors, will be empty in case of successful request

Example: Master products are not provided
post/crosssells
POST /rest/6.0/crosssells HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 318

{
  "Name": "New campaign",
  "MasterProducts": [
    "FD86FD98"
  ],
  "DisplayType": "cart",
  "DisplayInEmail": false,
  "Products": [
    {
      "ProductCode": "FD86FD99",
      "Discount": 15.5,
      "DiscountType": "PERCENT",
      "DiscountedPrice": [
        {
          "Currency": "EUR",
          "Price": 9.04
        }
      ],
      "Errors": [
        "Discount number is invalid"
      ]
    }
  ],
  "StartDate": "2020-12-20",
  "EndDate": "2021-12-20"
}
{
  "CampaignCode": "123",
  "Name": "New campaign",
  "MasterProducts": [
    "FD86FD98"
  ],
  "DisplayType": "cart",
  "DisplayInEmail": false,
  "Products": [
    {
      "ProductCode": "FD86FD99",
      "Discount": 15.5,
      "DiscountType": "PERCENT",
      "DiscountedPrice": [
        {
          "Currency": "EUR",
          "Price": 9.04
        }
      ],
      "Errors": [
        "Discount number is invalid"
      ]
    }
  ],
  "StartDate": "2020-12-20",
  "EndDate": "2021-12-20",
  "Errors": [
    "Master products are not provided"
  ]
}

Update a Cross Sell campaign

put
Header parameters
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
AcceptstringRequiredExample: application/json
Body
CampaignCodestringRequired

The unique code of the cross-sell campaign

Example: 2Xrl83KEs6KB1XG3db+9dQ==
CampaignStatusstring · enumRequired

The cross-selll campaign status

Example: ACTIVEPossible values:
NamestringRequired

Name of campaign, max 255 chars.

Example: New campaign
MasterProductsstring[]Required

array of product code ids to which this cross sell is going to be applied to

Example: FD86FD98
DisplayTypestring · enumRequired

Where should cross sell products be displayed

Example: cartPossible values:
DisplayInEmailbooleanRequired

true/false - display in payment receipt emails or not

Example: false
StartDatestring · nullableOptional

When should campaign start

Example: 2020-12-20
EndDatestring · nullableOptional

When should campaign end

Example: 2021-12-20
Responses
200

Update campaign success response

application/json
CampaignCodestringRequired

The unique code of the cross-sell campaign

Example: 2Xrl83KEs6KB1XG3db+9dQ==
CampaignStatusstring · enumRequired

The cross-selll campaign status

Example: ACTIVEPossible values:
NamestringRequired

Name of campaign, max 255 chars.

Example: New campaign
MasterProductsstring[]Required

array of product code ids to which this cross sell is going to be applied to

Example: FD86FD98
DisplayTypestring · enumRequired

Where should cross sell products be displayed

Example: cartPossible values:
DisplayInEmailbooleanRequired

true/false - display in payment receipt emails or not

Example: false
StartDatestring · nullableOptional

When should campaign start

Example: 2020-12-20
EndDatestring · nullableOptional

When should campaign end

Example: 2021-12-20
Errorsstring[]OptionalExample: End date is invalid
put/crosssells
PUT /rest/6.0/crosssells HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 303

{
  "CampaignCode": "2Xrl85eSkemBv3G3ea+9fg==",
  "MasterProducts": [
    "PAV2019"
  ],
  "DisplayType": "cart",
  "DisplayInEmail": true,
  "Name": "REST documentation campaign",
  "StartDate": "2021-03-10",
  "EndDate": "2021-04-10",
  "CampaignStatus": "ACTIVE",
  "Products": [
    {
      "ProductCode": "PAV2020",
      "Discount": 5,
      "DiscountType": "PERCENT"
    }
  ]
}
{
  "CampaignCode": "2Xrl83KEs6KB1XG3db+9dQ==",
  "MasterProducts": [
    "PAV2019"
  ],
  "DisplayType": "cart",
  "DisplayInEmail": true,
  "Products": [
    {
      "ProductCode": "PAV2020",
      "Discount": 5,
      "DiscountType": "PERCENT",
      "AutoAdded": false,
      "DiscountedPrice": [
        {
          "Currency": "EUR",
          "Price": 20.19
        },
        {
          "Currency": "USD",
          "Price": 19.86
        }
      ],
      "Errors": []
    }
  ],
  "Name": "REST documentation campaign",
  "CampaignStatus": "ACTIVE",
  "StartDate": "2021-03-10",
  "EndDate": "2021-10-210",
  "Errors": []
}

Get Cross Sell campaigns by code

get
Path parameters
campaignCodestringRequiredExample: 2Xrl83KSnemB5XG3ea+9hQ==
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Returns Cross Sell campaign collection

application/json
CampaignCodestringOptionalExample: 2Xrl83KSnemB5XG3ea+9hQ==
Namestring · enumOptionalExample: New campaignPossible values:
CampaignStatusstring · enumOptionalExample: ACTIVEPossible values:
CampaignOwnerTypestring · enumOptionalExample: MERCHPossible values:
MasterProductsstring[]OptionalExample: FD86FD98
DisplayTypestring · enumOptionalExample: cartPossible values:
DisplayInEmailbooleanOptionalExample: false
StartDatestringOptionalExample: 2020-12-20
EndDatestringOptionalExample: 2021-12-20
get/crosssells/{campaignCode}/campaign
GET /rest/6.0/crosssells/{campaignCode}/campaign HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "CampaignCode": "2Xrl83KSnemB5XG3ea+9hQ==",
  "Name": "New campaign",
  "CampaignStatus": "ACTIVE",
  "CampaignOwnerType": "MERCH",
  "MasterProducts": [
    "FD86FD98"
  ],
  "DisplayType": "cart",
  "DisplayInEmail": false,
  "Products": [
    {
      "ProductCode": "FD86FD99",
      "Discount": 15.5,
      "DiscountType": "PERCENT",
      "DiscountedPrice": [
        {
          "Currency": "EUR",
          "Price": 9.04
        }
      ],
      "BasePrice": [
        {
          "Currency": "EUR",
          "Price": 9.04
        }
      ]
    }
  ],
  "StartDate": "2020-12-20",
  "EndDate": "2021-12-20"
}
post
Header parameters
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
AcceptstringRequiredExample: application/json
Responses
200

Returns cross sell

application/json
displayProductsMaxintegerRequired

The maximum number of recommended products; We recommend adding a maximum of 3 products as cross-selling options.

Example: 5
maxThumbSizeinteger · enumRequired

Maximum product thumbnail size. Must be any of [60, 80, 100, 150].

Example: 100Possible values:
displayShortDescriptionbooleanOptional

Determines if the product short description is displayed next to the thumbnail or not.

Example: false
post/crosssells/settings/
POST /rest/6.0/crosssells/settings/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
{
  "displayProductsMax": 5,
  "maxThumbSize": 100,
  "displayShortDescription": false
}

Add cross-sell campaign texts

post

Overview Add cross-sell campaigns texts.

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Bodyobject · CrossSellTextRequest[]
LanguagestringOptional

language code

Example: en
TitlestringOptional

campaign title in the related language

Example: Limited offer this week
DescriptionstringOptional

campaign description in the related language

Example: Buy this product at 5% discount
Responses
200

OK

application/json
LanguagestringOptional

language code

Example: en
TitlestringOptional

campaign title in the related language

Example: Limited offer this week
DescriptionstringOptional

campaign description in the related language

Example: Buy this product at 5% discount
Errorsstring[]Optional
post/crosssells/campaignTexts/
POST /rest/6.0/crosssells/campaignTexts/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Content-Type: application/json
Content-Length: 178

[
  {
    "Language": "en",
    "Title": "My campaign name",
    "Description": "My campaign description"
  },
  {
    "Language": "ro",
    "Title": "Numele campaniei mele",
    "Description": "Descrierea campaniei mele"
  }
]
200

OK

[
  {
    "Language": "en",
    "Title": "My campaign name",
    "Description": "My campaign description",
    "Errors": []
  },
  {
    "Language": "ro",
    "Title": "Numele campaniei mele",
    "Description": "Descrierea campaniei mele",
    "Errors": []
  }
]

Edit cross-sell campaign texts

put

Overview Edit cross-sell campaigns texts.

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Bodyobject · CrossSellTextRequest[]
LanguagestringOptional

language code

Example: en
TitlestringOptional

campaign title in the related language

Example: Limited offer this week
DescriptionstringOptional

campaign description in the related language

Example: Buy this product at 5% discount
Responses
200

OK

application/json
LanguagestringOptional

language code

Example: en
TitlestringOptional

campaign title in the related language

Example: Limited offer this week
DescriptionstringOptional

campaign description in the related language

Example: Buy this product at 5% discount
Errorsstring[]Optional
put/crosssells/campaignTexts/
PUT /rest/6.0/crosssells/campaignTexts/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Content-Type: application/json
Content-Length: 178

[
  {
    "Language": "en",
    "Title": "My campaign name",
    "Description": "My campaign description"
  },
  {
    "Language": "ro",
    "Title": "Numele campaniei mele",
    "Description": "Descrierea campaniei mele"
  }
]
200

OK

[
  {
    "Language": "en",
    "Title": "My campaign name",
    "Description": "My campaign description",
    "Errors": [
      "The campaign text already exists"
    ]
  },
  {
    "Language": "ro",
    "Title": "Numele campaniei mele",
    "Description": "Descrierea campaniei mele",
    "Errors": []
  }
]

Retrieve cross-sell campaign texts

get

Overview Extract information on all cross-sell campaigns texts.

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/crossselltexts/
GET /rest/6.0/crossselltexts/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

[
  {
    "Description": "<p>\n\tSave up to <em><strong>25%</strong></em> with this special offer!</p>",
    "Language": "en",
    "Title": "Exclusive, one-time deal!"
  },
  {
    "Description": "<p>\n\tSparen Sie bis zu <em><strong>25%</strong></em> mit diesem Angebot.</p>",
    "Language": "de",
    "Title": "Exklusives Angebot!"
  }
]

Retrieve cross-sell campaign texts

get

Overview Extract information on all cross-sell campaigns texts.

Path parameters
LanguagestringRequired

ISO 4217 code for the language of the cross-sell campaign text.

Example: en
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/crossselltexts/{Language}/
GET /rest/6.0/crossselltexts/{Language}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

[
  {
    "Description": "<p>\n\tSave up to <em><strong>25%</strong></em> with this special offer!</p>",
    "Language": "en",
    "Title": "Exclusive, one-time deal!"
  }
]

Last updated

Was this helpful?