# Upsell

## Search and filter upsell campaigns

> Search and filter upsell campaigns

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell":{"get":{"description":"Search and filter upsell campaigns","operationId":"search-upsell","summary":"Search and filter upsell campaigns","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchUpsellResponse"}},"application/xml":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"X-Avangate-Authentication","required":true},{"schema":{"type":"string"},"in":"query","name":"Name","description":"The title of the campaign"},{"schema":{"type":"array","items":{"type":"string"}},"in":"query","name":"PrimaryProductCodes","description":"Array of primary product codes"},{"schema":{"type":"array","items":{"type":"string"}},"in":"query","name":"RecommendedProductCodes","description":"Array of recommended product codes"},{"schema":{"type":"array","items":{"type":"string","enum":["Enabled","Disabled","Expired"]},"default":["Enabled"]},"in":"query","name":"Statuses","description":"Array of upsell statuses"},{"schema":{"type":"string"},"in":"query","name":"StartsBefore","description":"The UTC date in Y-m-d format"},{"schema":{"type":"string"},"in":"query","name":"StartsAfter","description":"The UTC date in Y-m-d format"},{"schema":{"type":"string"},"in":"query","name":"EndsBefore","description":"The UTC date in Y-m-d format"},{"schema":{"type":"string"},"in":"query","name":"EndsAfter","description":"The UTC date in Y-m-d format"},{"schema":{"type":"boolean"},"in":"query","name":"EnabledForRenewals","description":"Retrieve upsells that are or are not enabled for renewals"},{"schema":{"type":"array","items":{"type":"string"}},"in":"query","name":"CampaignCodes","description":"Array of campaign UUIDs"},{"schema":{"type":"number"},"in":"query","name":"Page","description":"Page number"},{"schema":{"type":"number"},"in":"query","name":"Limit","description":"Number of campaigns per page"}],"tags":["Upsell"]}}},"components":{"schemas":{"SearchUpsellResponse":{"title":"SearchUpsellResponse","type":"object","properties":{"Page":{"type":"integer","description":"Current page number"},"Limit":{"type":"integer","description":"Number of upsell campaigns in a page"},"Upsells":{"type":"array","description":"Upsell collection from the current page","items":{"$ref":"#/components/schemas/UpsellResponse"}},"UpsellsCount":{"type":"integer","description":"Total number of filtered upsell campaigns"},"PagesCount":{"type":"integer","description":"Total number of pages"}}},"UpsellResponse":{"type":"object","properties":{"Code":{"type":"string","description":"Uniquely generated campaign code"},"Name":{"type":"string","description":"Name of campaign"},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When will campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}}},"UpsellCampaignDiscountFixed":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (FIXED)"},"Values":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignDiscountAmount"}},"DefaultCurrency":{"type":"string","description":"discount default currency"}}},"UpsellCampaignDiscountAmount":{"type":"object","properties":{"Currency":{"type":"string","description":"price discount currency"},"Amount":{"type":"integer","description":"price discount amount"}}},"UpsellCampaignDiscountPercent":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (PERCENT)"},"Value":{"type":"integer","description":"the value of the percentage discount"}}},"UpsellCampaignProduct":{"type":"object","properties":{"Code":{"type":"string","description":"Product code"},"Quantity":{"type":"integer","description":"Product quantity (0 means any quantity)"},"PriceOptions":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOption"}}}},"UpsellCampaignProductPriceOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option code"},"Options":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOptionOption"}}}},"UpsellCampaignProductPriceOptionOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option option code"},"Value":{"type":"integer","description":"Value for price option option (inside the ScaleMin and ScaleMax range for that price option option)","nullable":true}}},"UpsellCampaignLanguageDescription":{"type":"object","properties":{"Language":{"type":"string","description":"language code"},"Text":{"type":"string","description":"campaign text in the specified language code"}}},"ErrorResponse":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## POST /upsell

> Create Upsell campaign

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell":{"post":{"tags":["Upsell"],"summary":"Create Upsell campaign","operationId":"UpsellCreate","parameters":[{"name":"X-Avangate-Authentication","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellCreate"}}}},"responses":{"200":{"description":"Create campaign response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponse"}}}},"400":{"description":"Create campaign error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponseException"}}}}}}}},"components":{"schemas":{"UpsellCreate":{"type":"object","properties":{"Name":{"type":"string","description":"Name of campaign, max 500 chars."},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When should campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}},"required":["Name","DisplayForManualRenewals","Discount","PrimaryProduct","RecommendedProduct","Enabled","Description"]},"UpsellCampaignDiscountFixed":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (FIXED)"},"Values":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignDiscountAmount"}},"DefaultCurrency":{"type":"string","description":"discount default currency"}}},"UpsellCampaignDiscountAmount":{"type":"object","properties":{"Currency":{"type":"string","description":"price discount currency"},"Amount":{"type":"integer","description":"price discount amount"}}},"UpsellCampaignDiscountPercent":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (PERCENT)"},"Value":{"type":"integer","description":"the value of the percentage discount"}}},"UpsellCampaignProduct":{"type":"object","properties":{"Code":{"type":"string","description":"Product code"},"Quantity":{"type":"integer","description":"Product quantity (0 means any quantity)"},"PriceOptions":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOption"}}}},"UpsellCampaignProductPriceOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option code"},"Options":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOptionOption"}}}},"UpsellCampaignProductPriceOptionOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option option code"},"Value":{"type":"integer","description":"Value for price option option (inside the ScaleMin and ScaleMax range for that price option option)","nullable":true}}},"UpsellCampaignLanguageDescription":{"type":"object","properties":{"Language":{"type":"string","description":"language code"},"Text":{"type":"string","description":"campaign text in the specified language code"}}},"UpsellResponse":{"type":"object","properties":{"Code":{"type":"string","description":"Uniquely generated campaign code"},"Name":{"type":"string","description":"Name of campaign"},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When will campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}}},"UpsellResponseException":{"type":"object","properties":{"error_code":{"type":"string","description":"Error type"},"message":{"type":"string","description":"Error message"}}}}}}
```

## GET /upsell/recommended

> Get the recommended campaign based on product settings

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell/recommended":{"get":{"tags":["Upsell"],"summary":"Get the recommended campaign based on product settings","operationId":"get-upsell-recommended","parameters":[{"name":"X-Avangate-Authentication","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"query","name":"ProductCode","required":true,"description":"The primary product code"},{"schema":{"type":"integer"},"in":"query","name":"Quantity","description":"The quantity for the primary product"},{"schema":{"type":"string"},"in":"query","name":"PriceOptions","description":"The price options for the primary product"},{"schema":{"type":"boolean"},"in":"query","name":"EnabledForRenewals","description":"Returns only upsell campaigns that are (or not) enabled for renewals"}],"responses":{"200":{"description":"Found recommended campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponse"}}}},"400":{"description":"Get recommended campaign error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponseException"}}}},"404":{"description":"Recommended campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponseException"}}}}},"description":""}}},"components":{"schemas":{"UpsellResponse":{"type":"object","properties":{"Code":{"type":"string","description":"Uniquely generated campaign code"},"Name":{"type":"string","description":"Name of campaign"},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When will campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}}},"UpsellCampaignDiscountFixed":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (FIXED)"},"Values":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignDiscountAmount"}},"DefaultCurrency":{"type":"string","description":"discount default currency"}}},"UpsellCampaignDiscountAmount":{"type":"object","properties":{"Currency":{"type":"string","description":"price discount currency"},"Amount":{"type":"integer","description":"price discount amount"}}},"UpsellCampaignDiscountPercent":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (PERCENT)"},"Value":{"type":"integer","description":"the value of the percentage discount"}}},"UpsellCampaignProduct":{"type":"object","properties":{"Code":{"type":"string","description":"Product code"},"Quantity":{"type":"integer","description":"Product quantity (0 means any quantity)"},"PriceOptions":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOption"}}}},"UpsellCampaignProductPriceOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option code"},"Options":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOptionOption"}}}},"UpsellCampaignProductPriceOptionOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option option code"},"Value":{"type":"integer","description":"Value for price option option (inside the ScaleMin and ScaleMax range for that price option option)","nullable":true}}},"UpsellCampaignLanguageDescription":{"type":"object","properties":{"Language":{"type":"string","description":"language code"},"Text":{"type":"string","description":"campaign text in the specified language code"}}},"UpsellResponseException":{"type":"object","properties":{"error_code":{"type":"string","description":"Error type"},"message":{"type":"string","description":"Error message"}}}}}}
```

## Update Upsell campaign

> Update Upsell campaign

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell/{upsellCode}":{"put":{"summary":"Update Upsell campaign","operationId":"UpsellUpdate","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellResponse"}}}},"400":{"description":"Bad Request"}},"description":"Update Upsell campaign","parameters":[{"schema":{"type":"string"},"in":"header","name":"X-Avangate-Authentication","required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellCreate"}}}},"tags":["Upsell"]}}},"components":{"schemas":{"UpsellResponse":{"type":"object","properties":{"Code":{"type":"string","description":"Uniquely generated campaign code"},"Name":{"type":"string","description":"Name of campaign"},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When will campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}}},"UpsellCampaignDiscountFixed":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (FIXED)"},"Values":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignDiscountAmount"}},"DefaultCurrency":{"type":"string","description":"discount default currency"}}},"UpsellCampaignDiscountAmount":{"type":"object","properties":{"Currency":{"type":"string","description":"price discount currency"},"Amount":{"type":"integer","description":"price discount amount"}}},"UpsellCampaignDiscountPercent":{"type":"object","properties":{"Type":{"type":"string","description":"discount type (PERCENT)"},"Value":{"type":"integer","description":"the value of the percentage discount"}}},"UpsellCampaignProduct":{"type":"object","properties":{"Code":{"type":"string","description":"Product code"},"Quantity":{"type":"integer","description":"Product quantity (0 means any quantity)"},"PriceOptions":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOption"}}}},"UpsellCampaignProductPriceOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option code"},"Options":{"type":"array","items":{"$ref":"#/components/schemas/UpsellCampaignProductPriceOptionOption"}}}},"UpsellCampaignProductPriceOptionOption":{"type":"object","properties":{"Code":{"type":"string","description":"Price option option code"},"Value":{"type":"integer","description":"Value for price option option (inside the ScaleMin and ScaleMax range for that price option option)","nullable":true}}},"UpsellCampaignLanguageDescription":{"type":"object","properties":{"Language":{"type":"string","description":"language code"},"Text":{"type":"string","description":"campaign text in the specified language code"}}},"UpsellCreate":{"type":"object","properties":{"Name":{"type":"string","description":"Name of campaign, max 500 chars."},"StartDate":{"type":"string","description":"When will campaign start","nullable":true},"EndDate":{"type":"string","description":"When should campaign end","nullable":true},"DisplayForManualRenewals":{"type":"boolean","description":"Flag that controls compaign display for manual renewals"},"Discount":{"oneOf":[{"$ref":"#/components/schemas/UpsellCampaignDiscountFixed"},{"$ref":"#/components/schemas/UpsellCampaignDiscountPercent"}]},"PrimaryProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"RecommendedProduct":{"$ref":"#/components/schemas/UpsellCampaignProduct"},"Enabled":{"type":"boolean","description":"Flag that controls if the compaign is enabled"},"Description":{"type":"array","description":"The list of campaign language descriptions","items":{"$ref":"#/components/schemas/UpsellCampaignLanguageDescription"}}},"required":["Name","DisplayForManualRenewals","Discount","PrimaryProduct","RecommendedProduct","Enabled","Description"]}}}}
```

## Delete an Upsell campaign

> Delete Upsell campaign

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell/{upsellCode}":{"delete":{"tags":["Upsell"],"summary":"Delete an Upsell campaign","operationId":"UpsellDelete","parameters":[{"name":"X-Avangate-Authentication","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"upsellCode","in":"path","description":"Unique Upsell campaign code.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"OK"},"400":{"description":"Delete campaign error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUpsellResponseException"}}}}},"description":"Delete Upsell campaign"}}},"components":{"schemas":{"DeleteUpsellResponseException":{"type":"object","properties":{"error_code":{"type":"string","description":"Error type"},"message":{"type":"string","description":"Error message"}}}}}}
```

## GET /upsell/settings/campaign/

> Get Upsell campaig settings by vendor

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell/settings/campaign/":{"get":{"tags":["Upsell"],"summary":"Get Upsell campaig settings by vendor","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns Upsell campaign settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellCampaignSettingsResponse"}}}}}}}},"components":{"schemas":{"UpsellCampaignSettingsResponse":{"type":"object","properties":{"UpsellingDisplayType":{"type":"string"}}}}}}
```

## Update Upsell campaign settings

> Update Upsell campaign settings displayType

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/upsell/settings/campaign/":{"put":{"tags":["Upsell"],"summary":"Update Upsell campaign settings","description":"Update Upsell campaign settings displayType","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellUpdateSettings"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellCampaignSettingsResponse"}}}},"400":{"description":"Upsell campaign settings error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsellDisplayTypeResponseException"}}}}}}}},"components":{"schemas":{"UpsellUpdateSettings":{"required":["UpsellingDisplayType"],"type":"object","properties":{"UpsellingDisplayType":{"type":"string","description":"Update displayType setting"}}},"UpsellCampaignSettingsResponse":{"type":"object","properties":{"UpsellingDisplayType":{"type":"string"}}},"UpsellDisplayTypeResponseException":{"type":"object","properties":{"error_code":{"type":"string","description":"Error type"},"message":{"type":"string","description":"Error message"}}}}}}
```


---

# 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/api-reference/reference/upsell.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.
