To list an item with parts compatibility using modern APIs, first find the matching eBay catalog product, then retrieve that product's compatibility details, and finally use the product's ePID in your Trading API listing request.
Before you begin, use getAutomotivePartsCompatibilityPolicies to confirm that the target category supports parts compatibility for the marketplace.
To list an item with parts compatibility using a catalog product:
-
Use search in the Catalog API to locate the matching eBay catalog product and its eBay Product ID (ePID).
The ePID value is used as input to AddItem to list your item by product. The search method on the product_summary resource lets you search with keywords, category IDs, GTINs, MPNs, and aspect refinements.
If the search results are not specific enough, call getProduct with the selected ePID to retrieve the full catalog record and confirm the match.
The following request and response samples show how to find a product and its ePID.
Catalog API search request
GET https://api.ebay.com/commerce/catalog/v1_beta/product_summary/search?q=headlight&category_ids=33707
Catalog API search response, showing ePID
{ "productSummaries": [ { "epid": "81391542", "title": "Headlight Assembly", "productHref": "https://api.ebay.com/commerce/catalog/v1_beta/product/81391542" } ], "limit": 1 } -
Use getProductCompatibilities in the Metadata API to retrieve the parts compatibilities for the product.
If you are deriving compatibility from dimensions or other part specifications instead of a catalog product, use getCompatibilitiesBySpecification and the related compatibility property methods in the Metadata API.
The following getProductCompatibilities request and response show how to retrieve compatibilities for the selected catalog product.
Metadata API getProductCompatibilities request
POST https://api.ebay.com/sell/metadata/v1/compatibilities/get_product_compatibilities Content-Type: application/json X-EBAY-C-MARKETPLACE-ID: EBAY_US { "productIdentifier": { "ePID": "81391542" }, "applicationPropertyFilter": [ { "propertyName": "Make", "propertyValue": "Ford" } ] }Metadata API getProductCompatibilities response
{ "compatibilityDetails": [ { "compatibilityProperties": [ { "name": "Make", "value": "Ford" }, { "name": "Model", "value": "F-150" }, { "name": "Year", "value": "2004" } ] } ] } -
Use AddItem (or a related Trading API listing call) to list your item using the product.
The ePID value from search is passed in the ProductListingDetails.ProductReferenceID field of the AddItem request.
AddItem request using an eBay catalog product
<?xml version="1.0" encoding="utf-8"?> <AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <RequesterCredentials> <eBayAuthToken>ABC...123</eBayAuthToken> </RequesterCredentials> <Item> ... <PrimaryCategory> <CategoryID>33708</CategoryID> </PrimaryCategory> <ProductListingDetails> <ProductReferenceID>81391542</ProductReferenceID> <IncludePrefilledItemInformation>true</IncludePrefilledItemInformation> </ProductListingDetails> ... </Item> </AddItemRequest>
Refer to Retrieve parts compatibilities for listed items for additional information about confirming parts compatibilities.
For a broader overview of finding catalog products before listing, see Matching inventory to catalog products.