GET/ad_campaign
This method retrieves the details for all of the seller's defined campaigns. Request parameters can be used to retrieve a specific campaign, such as the campaign's name, the start and end date, the channel, the status, and the funding model (i.e., Cost Per Sale (CPS) or Cost Per Click (CPC)).
You can filter the result set by a campaign name, end date range, start date range, campaign channel, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter.
Input
Resource URI
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
Parameter | Type | Description |
---|---|---|
campaign_status | string | This query parameter specifies the status of the campaign(s) being retrieved. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status Occurrence: Optional |
start_date_range | string | This query parameter specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):
Note: The results might not include all the campaigns with this start date if other filters exclude them. Occurrence: Optional |
end_date_range | string | This query parameter specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):
Note:The results might not include all the campaigns ending on this date if other filters exclude them. Occurrence: Optional |
campaign_name | string | This query parameter specifies the name of the campaign being retrieved. The results are filtered to include only the campaign by the specified name. Use the getCampaigns method to retrieve a list of a seller's campaign names. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name Occurrence: Optional |
funding_strategy | string | This query parameter specifies the funding strategy for the campaign(s) being retrieved. The results will be filtered to only include campaigns with the specified funding model. If not specified, all campaigns matching the other filter parameters will be returned. The results might not include these campaigns if other search conditions exclude them. Valid Values: See FundingModelEnum Occurrence: Optional |
channels | string | This query parameter specifies the channel for the campaign(s) being retrieved. The results will be filtered to only include campaigns with the specified channel. If not specified, all campaigns matching other filter parameters will be returned. The results might not include these campaigns if other search conditions exclude them. Valid Values: See ChannelEnum Occurrence: Optional |
campaign_targeting_types | string | This query parameter specifies the targeting type of the campaign(s) to be retrieved. The results will be filtered to only include campaigns with the specified targeting type. If not specified, all campaigns matching other filter parameters will be returned. The results might not include these campaigns if other search conditions exclude them. Valid values: See CampaignTargetingTypeEnum Occurrence: Optional |
limit | string | This query parameter specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10Maximum: 500 Occurrence: Optional |
offset | string | This query parameter specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10 , the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20 , the first page of the response contains items 11-30 from the complete result set.Default: 0 Occurrence: Optional |
HTTP request headers
All requests made to eBay REST operations require you to provide the Authorization
HTTP header for authentication authorization.
All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.
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.readonly
https://api.ebay.com/oauth/api_scope/sell.marketing
See OAuth access tokens for more information.
Request payload
This call has no payload.
Request fields
This call has no field definitions.
Output
HTTP response headers
This call has no response headers.
Response payload
Response fields
Output container/field | Type | Description |
---|---|---|
campaigns | array of Campaign | This array contains all of the seller's campaign that match the request criteria. Occurrence: Always |
campaigns.alerts | array of Alert | This array contains alert messages for the campaign. Occurrence: Conditional |
campaigns.alerts.alertType | AlertTypeEnum | The type of alert message. For example, an invalid bid percentage. Occurrence: Conditional |
campaigns.alerts.details | array of AlertDetails | A description of the alert including dimensions and aspects. Occurrence: Conditional |
campaigns.alerts.details.dimension | AlertDimension | The dimension information of the alert including keys and values. Occurrence: Conditional |
campaigns.alerts.details.dimension.key | DimensionKeyEnum | The key field of the applied dimension. For example, the marketplace Id. Occurrence: Conditional |
campaigns.alerts.details.dimension.value | string | The value field of the applied dimension. For example, if the key is a Occurrence: Conditional |
campaigns.alerts.details.aspect | Aspect | The aspect information of the alert including keys and values. Occurrence: Conditional |
campaigns.alerts.details.aspect.key | AspectKeyEnum | The type of the aspect. For example, Occurrence: Conditional |
campaigns.alerts.details.aspect.value | string | The value of the aspect. For example, if the aspect is a percentage, a value of '2.0' would equal 2%. Occurrence: Conditional |
campaigns.budget | CampaignBudget | The allocated budget for the Cost Per Click (CPC) Promoted Listings campaign.Note: This field will only be returned for campaigns using the CPC funding model; it does not apply to the Cost Per Sale (CPS) funding model. Occurrence: Conditional |
campaigns.budget.daily | Budget | The daily budget limit for the Cost Per Click (CPC) Promoted Listings campaign.
Occurrence: Conditional |
campaigns.budget.daily.amount | Amount | The allocated budget amount for a CPC Promoted Listings campaign. Occurrence: Conditional |
campaigns.budget.daily.amount.currency | CurrencyCodeEnum | The base currency applied to the value field to establish a monetary amount. Occurrence: Conditional |
campaigns.budget.daily.amount.value | string | The monetary amount in the specified currency. Occurrence: Conditional |
campaigns.budget.daily.budgetStatus | BudgetStatusEnum | The budget status for a CPC Promoted Listings campaign. Occurrence: Conditional |
campaigns.campaignCriterion | CampaignCriterion | The selection rules (criterion) used to select the listings for a campaign. If you populate the campaignCriterion object in your createCampaign request, ads for the campaign are created by rule for the listings that meet the criteria you specify, and these ads are associated with the campaign.Note: This container is only returned for rules-based campaigns using the Cost Per Sale (CPS) funding model. Occurrence: Conditional |
campaigns.campaignCriterion.autoSelectFutureInventory | boolean | A field used to indicate whether listings shall be automatically added to, or removed from, a Promoted Listings campaign based on the rules that have been configured for the campaign. Occurrence: Conditional |
campaigns.campaignCriterion.criterionType | CriterionTypeEnum | This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules | array of SelectionRule | This container shows all of the rules/inclusion filters used to add listings to the campaign. For information on using the contained fields, see Promoted Listing campaigns. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.brands | array of string | An array of product brands. For more details, see Using the selectionRules container. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.categoryIds | array of string | This field contains an array of the associated category ID(s). Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.categoryScope | CategoryScopeEnum | This enumerated value indicates if the category ID for the item is an identifier for eBay categories or for a seller's eBay store categories. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.listingConditionIds | array of string | A comma-separated list of unique identifiers for the conditions of listings to be included Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.maxPrice | Amount | This container sets the maximum price threshold. For more details, see Using the selectionRules container. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.maxPrice.currency | CurrencyCodeEnum | The base currency applied to the value field to establish a monetary amount. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.maxPrice.value | string | The monetary amount in the specified currency. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.minPrice | Amount | This container sets the minimum price threshold. For more details, see Using the selectionRules container. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.minPrice.currency | CurrencyCodeEnum | The base currency applied to the value field to establish a monetary amount. Occurrence: Conditional |
campaigns.campaignCriterion.selectionRules.minPrice.value | string | The monetary amount in the specified currency. Occurrence: Conditional |
campaigns.campaignId | string | A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. Occurrence: Always |
campaigns.campaignName | string | A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters. Max length: 80 charactersOccurrence: Always |
campaigns.campaignStatus | CampaignStatusEnum | Indicates the status of the campaign, such as Occurrence: Always |
campaigns.campaignTargetingType | CampaignTargetingTypeEnum | The targeting type of the campaign. This value indicates whether the campaign is a manual targeting or smart targeting ad campaign. Occurrence: Conditional |
campaigns.channels | array of ChannelEnum | The channel for the campaign. This value indicates whether the campaign is an Onsite or Offsite advertising campaign.
Occurrence: Conditional |
campaigns.endDate | string | The date and time the campaign ends, in UTC format ( Occurrence: Always |
campaigns.fundingStrategy | FundingStrategy | This container includes parameters that define an ad campaign funding strategy. The set of seller-configurable parameters depends on the selected fundingModel value. Occurrence: Always |
campaigns.fundingStrategy.adRateStrategy | AdRateStrategyEnum | This field is used to set the ad rate strategy for a Cost Per Sale (CPS) campaign. Occurrence: Conditional |
campaigns.fundingStrategy.biddingStrategy | BiddingStrategyEnum | Indicates the bidding strategy for an onsite Cost Per Click (CPC) campaign that uses manual targeting.
Default value: FIXED Occurrence: Conditional |
campaigns.fundingStrategy.bidPercentage | string | The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing.
If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign. Note:This field is only relevant for campaigns that use the CPS funding model and a fixed ad rate. It is not used for campaigns that use the Cost Per Click (CPC) funding model and should not be provided when the selected adRateStrategy for the campaign is dynamic. Note: This field has a minimum value of 2.0 and a maximum value of 100.0 . Occurrence: Conditional |
campaigns.fundingStrategy.bidPreferences | array of BidPreference | This container indicates the bidding preferences of the campaign, such as the maximum CPC amount. Occurrence: Conditional |
campaigns.fundingStrategy.bidPreferences.maxCpc | MaxCpc | The maximum amount for which the eBay suggested bid can be adjusted. This value represents the most a seller is willing to pay for each click on their ad. The adjusted bid will never exceed this amount. Occurrence: Conditional |
campaigns.fundingStrategy.bidPreferences.maxCpc.amount | Amount | The allocated maximum CPC amount for a smart targeting campaign. Occurrence: Conditional |
campaigns.fundingStrategy.bidPreferences.maxCpc.amount.currency | CurrencyCodeEnum | The base currency applied to the value field to establish a monetary amount. Occurrence: Conditional |
campaigns.fundingStrategy.bidPreferences.maxCpc.amount.value | string | The monetary amount in the specified currency. Occurrence: Conditional |
campaigns.fundingStrategy.dynamicAdRatePreferences | array of DynamicAdRatePreference | A field that indicates whether a single, user-defined bid percentage (also known as the ad rate) should be used, or whether eBay should automatically adjust listings to maintain the daily suggested bid percentage. Occurrence: Conditional |
campaigns.fundingStrategy.dynamicAdRatePreferences.adRateAdjustmentPercent | string | The percentage above or below (-) the eBay suggested ad rate that a seller is willing to pay. Occurrence: Conditional |
campaigns.fundingStrategy.dynamicAdRatePreferences.adRateCapPercent | string | The maximum value (specified as a percentage) to which the eBay suggested ad rate can be adjusted. The adjusted ad rate will never exceed this percentage. Occurrence: Conditional |
campaigns.fundingStrategy.fundingModel | FundingModelEnum | Indicates the model that eBay uses to calculate the Promoted Listings fee. For a description of the funding model types, refer to FundingModelTypeEnum. Occurrence: Always |
campaigns.marketplaceId | MarketplaceIdEnum | The ID of the eBay marketplace where the campaign is hosted. Occurrence: Always |
campaigns.startDate | string | The date and time the campaign starts, in UTC format ( On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. Occurrence: Always |
href | string | The URI of the current page of results from the result set. Occurrence: Always |
limit | integer | The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. Occurrence: Always |
next | string | The call URI that can be used to retrieve the next page in the result set. This value is returned only if there is an additional page of results to display from the result set. Occurrence: Conditional |
offset | integer | The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of Occurrence: Always |
prev | string | The call URI that can be used to retrieve the previous page in the result set. Basically, all of the request parameters will remain the same except the offset value, which will be decreased to retrieve the previous page of results. Occurrence: Conditional |
total | integer | The total number of campaigns retrieved in the result set. 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.
Status | Meaning |
---|---|
200 | Success |
400 | Bad Request |
409 | Business error |
500 | Internal Server error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
35001 | API_MARKETING | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance. |
35002 | API_MARKETING | APPLICATION | Internal error. Please wait a few minutes and try the call again. |
35020 | API_MARKETING | REQUEST | The campaign name cannot be more than {maxCampaignNameLength} characters. |
35023 | API_MARKETING | REQUEST | The request contains invalid characters. {notAllowedCharacters} are not allowed. |
35027 | API_MARKETING | REQUEST | The date range {dateRange} is not valid. Ensure the beginning of the range is before the end of the range. |
35028 | API_MARKETING | REQUEST | The format of the date range {dateRange} is invalid. The format for a date range is yyyy-MM-ddThh:mm:ss.sssZ..yyyy-MM-ddThh:mm:ss.sssZ or yyyy-MM-ddThh:mm:ss.sssZ.. or ..yyyy-MM-ddThh:mm:ss.sssZ. |
35029 | API_MARKETING | REQUEST | The 'limit' has to be greater than zero and less than {maxLimitValue}. |
35030 | API_MARKETING | REQUEST | The 'offset' cannot be less than zero. |
35043 | API_MARKETING | REQUEST | The campaign status of {campaignStatus} is either invalid or not supported for this operation. |
35077 | API_MARKETING | BUSINESS | To use promoted listings, you need to improve your seller level to Top Rated or Above Standard and have enough recent sales activity. |
35079 | API_MARKETING | REQUEST | Funding strategy needs to be one of {fundingStrategy} types. |
35123 | API_MARKETING | REQUEST | The 'campaignTargetingType' is not valid. Valid values for 'campaignTargetingType' are: {campaignTargetingTypeValues}. |
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 All Your Campaigns
This sample returns the details of the seller's campaign.
Input
There are no required inputs for this call. Optionally, you can use the campaign_name, campaign_status, end_date_range, limit, offset, and start_date_range fields to filter and control the size of the result set.
GEThttps://api.ebay.com/sell/marketing/v1/ad_campaign
Output
The output is a list of all the seller's campaigns.