openapi: 3.0.0
servers:
  - description: Production
    url: https://api.ebay.com{basePath}
    variables:
      basePath:
        default: /sell/recommendation/v1
info:
  contact:
    name: eBay Inc,
    x-twitter: ebay
  description: The <b>Recommendation API</b> returns information that sellers can use to optimize the configuration of their listings on eBay. <br><br>Currently, the API contains a single method, <b>findListingRecommendations</b>. This method provides information that sellers can use to configure Promoted Listings ad campaigns to maximize the visibility of their items in the eBay marketplace.
  license:
    name: eBay API License Agreement
    url: https://go.developer.ebay.com/api-license-agreement
  title: Recommendation API
  version: 1.1.0
  x-apisguru-categories:
    - ecommerce
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://twitter.com/ebay/profile_image?size=original
  x-origin:
    - format: openapi
      url: https://developer.ebay.com/api-docs/master/sell/recommendation/openapi/3/sell_recommendation_v1_oas3.json
      version: "3.0"
  x-providerName: ebay.com
  x-serviceName: sell-recommendation
paths:
  /find:
    post:
      description: "The find method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. For details on how to use this method, see Using the Recommendation API to help configure campaigns. The AD recommendation type The AD type contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the &quot;ad rate,&quot; the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings &ndash; If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs &ndash; If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request."
      operationId: findListingRecommendations
      parameters:
        - description: "Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (&quot;:&quot;). Currently, the only supported filter value is recommendationTypes and it supports only the (&quot;AD&quot;) type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces (&quot;{ }&quot;), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD}"
          in: query
          name: filter
          required: false
          schema:
            type: string
        - description: "Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500"
          in: query
          name: limit
          required: false
          schema:
            type: string
        - description: "Specifies the number of ads to skip in the result set before returning the first ad 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"
          in: query
          name: offset
          required: false
          schema:
            type: string
        - description: Use this header to specify the eBay marketplace where you list the items for which you want to get recommendations.
          in: header
          name: X-EBAY-C-MARKETPLACE-ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FindListingRecommendationRequest"
        required: false
      responses:
        "200":
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: "#/components/schemas/PagedListingRecommendationCollection"
          description: Success
        "204":
          description: No Content
        "400":
          description: Bad Request
          x-response-codes:
            errors:
              "145101":
                category: REQUEST
                description: "The marketplace value {marketplaceId} is not supported. The supported values are: {marketplaceIds}. "
                domain: API_RECOMMENDATION
              "145102":
                category: REQUEST
                description: Invalid value {recommendationTypes} for recommendationTypes filter
                domain: API_RECOMMENDATION
              "145103":
                category: REQUEST
                description: You must specify at least one listing ID.
                domain: API_RECOMMENDATION
              "145104":
                category: REQUEST
                description: The recommendationTypes filter accepts a single value only.
                domain: API_RECOMMENDATION
              "145105":
                category: REQUEST
                description: Invalid listing Ids {listingIds}.
                domain: API_RECOMMENDATION
              "145106":
                category: REQUEST
                description: Listing ID limit exceeded. You can pass up to a maximum of 500 listing IDs per request.
                domain: API_RECOMMENDATION
        "500":
          description: Internal Server Error
          x-response-codes:
            errors:
              "145000":
                category: APPLICATION
                description: Internal error. Please wait a few minutes and try the call again
                domain: API_RECOMMENDATION
      security:
        - api_auth:
            - https://api.ebay.com/oauth/api_scope/sell.inventory
      tags:
        - listing_recommendation
components:
  schemas:
    Ad:
      description: A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns.
      properties:
        bidPercentages:
          description: "This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. Note: Currently, ITEM and TRENDING are the only supported bid percentage types. The ITEM suggested bid percentages are tailored to each of your items and are designed to help you stay competitive while finding an optimal balance between performance and cost. The recommendations are calculated based on a variety of factors that may include item attributes, seasonality, past performance, and current competition for each of your listings. The TRENDING suggested bid percentages are calculated by reviewing the category level average ad rates in the marketplace. Setting the bidPercentage of your ad campaign based on these rate recommendations will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace."
          items:
            $ref: "#/components/schemas/BidPercentages"
          type: array
        promoteWithAd:
          description: "An enum whose values describe whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. IDs deemed RECOMMENDED by eBay are the listings with the highest potential of benefiting from being promoted. The recommendation calculation is based on marketplace trends, like buyer demand and the competition in the item&rsquo;s category. Note: A promoteWithAd value cannot be calculated for listings that are part of Promoted Listings campaigns. Because of this, if you call findListingRecommendations with a specific set of listing IDs, the promoteWithAd field is not returned for any of the listings that are involved in a promotion. However, as long as they are eligible, the trending bidPercentage is returned for all specified listings, even if they are part of an ad campaign. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/recommendation/types/api:PromoteWithAd'>eBay API documentation</a>"
          type: string
      type: object
    BidPercentages:
      description: A complex type that returns data related to Promoted Listings bid percentages.
      properties:
        basis:
          description: "The basis by which the ad rate is calculated. Valid Values: ITEM and TRENDING For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/recommendation/types/api:Basis'>eBay API documentation</a>"
          type: string
        value:
          description: "The bid percentage data is a single precision value, as calculated by the associated basis. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0 &nbsp; Maximum value: 100.0"
          type: string
      type: object
    Error:
      description: This type defines the fields that can be returned in an error.
      properties:
        category:
          description: Identifies the type of erro.
          type: string
        domain:
          description: Name for the primary system where the error occurred. This is relevant for application errors.
          type: string
        errorId:
          description: A unique number to identify the error.
          format: int32
          type: integer
        inputRefIds:
          description: An array of request elements most closely associated to the error.
          items:
            type: string
          type: array
        longMessage:
          description: A more detailed explanation of the error.
          type: string
        message:
          description: Information on how to correct the problem, in the end user's terms and language where applicable.
          type: string
        outputRefIds:
          description: An array of request elements most closely associated to the error.
          items:
            type: string
          type: array
        parameters:
          description: An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.
          items:
            $ref: "#/components/schemas/ErrorParameter"
          type: array
        subdomain:
          description: "Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc."
          type: string
      type: object
    ErrorParameter:
      properties:
        name:
          description: The object of the error.
          type: string
        value:
          description: The value of the object.
          type: string
      type: object
    FindListingRecommendationRequest:
      description: An list of listing ID values for which you want Promoted Listings ad configuration information.
      properties:
        listingIds:
          description: "A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs"
          items:
            type: string
          type: array
      type: object
    ListingRecommendation:
      description: A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations.
      properties:
        listingId:
          description: An ID that identifies the active listing associated with the eBay recommendations.
          type: string
        marketing:
          $ref: "#/components/schemas/MarketingRecommendation"
          description: "This return object provides the eBay recommendations and information related to the associated listing ID. The container currently returns the AD recommendation type, which contains information that sellers can use to configure Promoted Listings ad campaigns. This container is returned with each ListingRecommendation object, except when: The listing ID is not eligible for Promoted Listings The listing ID is currently in a Promoted Listings campaign The listing ID is invalid"
      type: object
    MarketingRecommendation:
      description: A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data.
      properties:
        ad:
          $ref: "#/components/schemas/Ad"
          description: An object that contains Promoted Listings recommendations and information related to the associated listing ID.
        message:
          description: A message that can conditionally accompany the listing information.
          type: string
      type: object
    PagedListingRecommendationCollection:
      description: The high-level object used to return a set of Promoted Listings ad recommendations.
      properties:
        href:
          description: The URI of the current page of results from the result set.
          type: string
        limit:
          description: 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.
          format: int32
          type: integer
        listingRecommendations:
          description: Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listingId. Which elements are returned depend on how you structure the request. For example, if you request recommendations for all of a sellers listings (by leaving the request payload empty), ad recommendations are returned only for those listings where promoteWithAd is set to RECOMMENDED.
          items:
            $ref: "#/components/schemas/ListingRecommendation"
          type: array
        next:
          description: "The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048"
          type: string
        offset:
          description: "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 0."
          format: int32
          type: integer
        prev:
          description: "The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048"
          type: string
        total:
          description: The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0.
          format: int32
          type: integer
      type: object
  securitySchemes:
    api_auth:
      description: The security definitions for this API. Please check individual operations for applicable scopes.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.ebay.com/oauth2/authorize
          scopes:
            https://api.ebay.com/oauth/api_scope/sell.inventory: View and manage your inventory and offers
          tokenUrl: https://api.ebay.com/identity/v1/oauth2/token
      type: oauth2
