Skip to main content

POST/ad_campaign/suggest_max_cpc

Note: This method is only supported for smart targeting priority strategy campaigns. Sellers can use the getAdvertisingEligibility method of the Account API v1 to determine if they are eligible for a priority strategy campaign.
This method allows sellers to retrieve the suggested maximum cost-per-click value for a smart targeting campaign. This value is required when creating a smart targeting campaign and indicates the maximum amount for which the eBay suggested bid can be adjusted.

Input

Resource URI

POST https://api.ebay.com/sell/marketing/v1/ad_campaign/suggest_max_cpc

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

This method has no URI parameters.

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

The table below shows additional HTTP request headers that are either required, conditionally required, or strongly recommended for this method. Other standard HTTP request headers- opens rest request components page (not in this table) can also be used, but they are optional.

HeaderTypeDescription
Content-TypestringThis header indicates the format of the request body provided by the client. Its value should be set to application/json.

For more information, refer to HTTP request headers.

Occurrence: Required

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.marketing

See OAuth access tokens for more information.

Request payload

Copy complete valid JSON to clipboard

Request fields

Input container/fieldTypeDescription
listingIdsarray of string

A comma delimited array of listing Ids the seller plans to associate with the smart targeting campaign for which the maxCpc will be suggested.

Occurrence: Required

marketplaceIdMarketplaceIdEnum

The unique identifier of the marketplace where the listings are hosted. See MarketplaceIdEnum for supported values.

Occurrence: Required

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
amountAmount

The suggested maxCpc amount for the smart targeting campaign.

Occurrence: Always

amount.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD

Occurrence: Conditional

amount.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

marketplaceIdMarketplaceIdEnum

The unique identifier of the marketplace where the listings are hosted.

Occurrence: Always

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200Success
400Bad Request
404Not Found
409Business error
500Internal Server error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
35001API_MARKETINGAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
35002API_MARKETINGAPPLICATIONInternal error. Please wait a few minutes and try the call again.
35041API_MARKETINGREQUESTThe 'marketplaceId' is required.
35051API_MARKETINGBUSINESS'marketplaceId' {marketplaceId} is not supported. Promoted Listings is supported only on these marketplaces: {supportedMarketplaces}.
35057API_MARKETINGBUSINESSThe listing Id {listingId} does not belong to the seller making this call
35068API_MARKETINGBUSINESSYou have exceeded the maximum number of listing Ids. Only {maxSupportedNumber} listings are supported per call.
35135API_MARKETINGREQUESTPlease supply one or more values in the ‘listingIds’ field in the request.
35136API_MARKETINGREQUESTThe following values you supplied in the ‘listingIds’ field are invalid: {listingIds}

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Retrieve suggested MaxCpc for a smart targeting campaign

This sample retrieves the suggested MaxCpc for a smart targeting campaign.

Input

The inputs for this sample are listingIds, which specifies the listings associated with the campaign, and marketplaceId, which specifies the marketplace associated with the listings.

No query parameters are required for this method.

POSThttps://api.ebay.com/sell/marketing/v1/ad_campaign/suggest_max_cpc

Output

If the call is successful, the suggested maxCpc for the smart targeting campaign is returned in the amount container, along with the associated marketplaceId where the listings are hosted.

In this sample, the suggested maxCpc for the campaign is 0.57 USD.