### Example Request with Query Parameters Source: https://developer.ebay.com/develop/api/buy/buy_marketing_api/similar_items/getsimilaritems This example demonstrates a GET request to the similar items endpoint, including optional query parameters like `buying_option`, `excluded_category_ids`, `filter`, and `max_results`. Remember to replace `api.ebay.com` with `api.sandbox.ebay.com` for Sandbox testing. ```HTTP GET https://api.ebay.com/buy/marketing/v1/similar_items?buying_option=FIXED_PRICE&excluded_category_ids=12345&filter=itemEndDate:[..2025-12-14T07:47:48Z]&item_id=v1|2**********2|0&max_results=10 ``` -------------------------------- ### Start Listing Previews Creation Source: https://developer.ebay.com/develop/guides-v2/listing-creation/listing-creation Initiates the creation of listing previews based on provided product details such as title, images, and aspects. This mutation is used to get a preview of how a listing might appear. ```APIDOC ## startListingPreviewsCreation Mutation ### Description Creates listing previews for products based on provided external product details. ### Method mutation ### Input - **input** (object) - Required - Input object for the mutation. - **externalProducts** (array) - Required - A list of external products to create previews for. - **images** (array of strings) - Required - URLs of images for the product. - **title** (string) - Required - The title of the product. - **aspects** (array of objects) - Optional - Aspects of the product. - **name** (string) - Required - The name of the aspect. - **values** (array of strings) - Required - The values for the aspect. ### Request Example ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/unmapped/png"], "title": "Unmapped Title", "aspects": [ { "name": "Color", "values": [ "Blue" ] } ] } ] } } ``` ``` -------------------------------- ### Example Accept-Language Header Source: https://developer.ebay.com/develop/guides-v2/using-ebay-restful-apis/using-ebay-restful-apis Shows an example of the Accept-Language request header, used to specify the desired response language. ```text Accept-Language: en-US ``` -------------------------------- ### FetchToken SOAP API Example Source: https://developer.ebay.com/develop/guides-v2/authorization This example demonstrates a FetchToken call using SOAP, with requester credentials included in the SOAP header. Wait 5-10 seconds before the first FetchToken call for a new user. ```xml YOUR-APP-ID YOUR-DEV-ID YOUR-AUTH-TOKEN YOUR-APP-ID YOUR-DEV-ID YOUR-AUTH-TOKEN 2024-12-31T23:59:59.000Z YOUR-SESSION-ID ``` -------------------------------- ### Success Response Example Source: https://developer.ebay.com/develop/guides-v2 An example of a successful response with no errors or warnings. ```APIDOC ## Success Response Example ### Description This is an example of a response that contains neither an `errors` nor a `warnings` component, indicating a successful operation. ### Response Example ```http HTTP/1.1 200 OK { "resource": "Hello, eBay follower!!" } ``` ``` -------------------------------- ### Feedback API Example Source: https://developer.ebay.com/develop/guides-v2/communications/sell-communications-guide This JSON snippet shows an example of feedback options that can be used with the Feedback API. ```json { "enabled": true }, { "value": "2", "valueLabel": "Inaccurate", "enabled": true }, { "value": "3", "valueLabel": "Neither inaccurate nor accurate", "enabled": true }, { "value": "4", "valueLabel": "Accurate", "enabled": true }, { "value": "5", "valueLabel": "Very accurate", "enabled": true } ] } ``` -------------------------------- ### External Product Aspects Example Source: https://developer.ebay.com/develop/api/sell/inventory_mapping.md Provides an example of how to structure product aspect name-value pairs. If the aspects array is included, it must not contain null entries. ```json [{"name":"Color","values":["Black","Red"]},{"name":"Storage Capacity","values":["64GB"]}] ``` -------------------------------- ### Example cURL Request for Authorization Code Grant Source: https://developer.ebay.com/develop/guides-v2/authorization An example cURL command demonstrating how to make the authorization code grant request. Ensure to replace placeholders with your actual credentials and values. The command is wrapped for readability. ```curl curl -X POST 'https://api.sandbox.ebay.com/identity/v1/oauth2/token' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Authorization: Basic RGF2eURldmUtRG2 ... ZTVjLTIxMjg=' \ -d '**grant_type**=authorization_code&\ **code**=v%5E1.1%23i%5E1%23f% ... 3D%3D&\ **redirect_uri**=Davy_Developer-DavyDeve-DavysT-euiukxwt' ``` -------------------------------- ### Authorization Code Redirect URL Example Source: https://developer.ebay.com/develop/guides-v2/authorization This example shows the structure of the redirect URL back to your application after a user grants consent. It includes the state value and the authorization code. ```html https://www.example.com/acceptURL.html? state=<_client_supplied_state_value_>& **code=v%5E1.1% ... NjA%3D**& expires_in=299 ``` -------------------------------- ### Start Listing Previews Creation with Image Source: https://developer.ebay.com/develop/guides-v2/listing-creation/listing-creation Initiates the creation of a listing preview using an image. Handles cases where the image is unmapped or invalid. ```APIDOC ## startListingPreviewsCreation mutation ### Description Creates a listing preview based on provided product information, including images. ### Method mutation ### Input - **input** (object) - Required - The input object for the mutation. - **externalProducts** (array) - Required - A list of external products to create previews for. - **images** (array) - Required - A list of image URLs for the product. ### Request Example ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/unmapped/png"] } ] } } ``` ``` -------------------------------- ### GET /buy/v1/deals Source: https://developer.ebay.com/develop/guides-v2/using-ebay-restful-apis/using-ebay-restful-apis Example of a successful response payload for retrieving deals from the eBay API. ```APIDOC ## GET /buy/v1/deals ### Description Retrieves a list of current eBay Deals items for a specified category. ### Method GET ### Endpoint `https://api.sandbox.ebay.com/buy/v1/deals` ### Response #### Success Response (200) - **deals** (array) - A list of deal items. - **groupId** (string) - Identifier for the deal group. - **title** (object) - Contains the title content of the deal. - **content** (string) - The title of the deal item. - **imageLink** (string) - URL for the deal item's image. - **minPrice** (object) - The minimum price for the deal. - **value** (number) - The price value. - **currency** (string) - The currency of the price. - **maxPrice** (object) - The maximum price for the deal. - **value** (number) - The price value. - **currency** (string) - The currency of the price. - **categoryIdentifier** (string) - The category of the deal item. - **quantitySold** (integer) - The number of items sold. - **discount** (boolean) - Indicates if a discount is applied. - **originalPrice** (object) - The original price before discount. - **value** (number) - The price value. - **currency** (string) - The currency of the price. - **quantityLimitPerBuyer** (integer) - The maximum quantity allowed per buyer. - **priceDisplayCondition** (string) - Condition for displaying the price. - **itemGroup** (string) - Link to the item group resource. - **dealEndtime** (object) - The end time of the deal. - **value** (string) - The ISO 8601 formatted end time. - **formattedValue** (string) - The formatted end time. #### Response Example ```json { "deals": [ { "groupId": "v1|1***********|0", "title": { "content": "Apple iPhone 4S - 32GB - White Smartphone-14485" }, "imageLink": "http://i.ebayimg.ebay.com/0*****/$_35.JPG", "minPrice": { "value": 300, "currency": "USD" }, "maxPrice": { "value": 300, "currency": "USD" }, "categoryIdentifier": "Cell Phones & Smartphones", "quantitySold": 12, "discount": true, "originalPrice": { "value": 401, "currency": "USD" }, "quantityLimitPerBuyer": 5, "priceDisplayCondition": "ALWAYS_SHOW", "itemGroup": "/buy/v1/item_group/v1|1***********|0", "dealEndtime": { "value": "2024-11-27T14:59:00.000Z", "formattedValue": "2024-11-27T14:59:00.000Z" } }, { "groupId": "v1|1***********|0", "title": { "content": "Packing and Shipping boxes - 19273-1445985364525" }, ... } ] } ``` ``` -------------------------------- ### Start Listing Preview Creation with Valid Details Source: https://developer.ebay.com/develop/guides-v2/listing-creation Use the `startListingPreviewsCreation` mutation with a title, image URL, and aspects to create a listing preview. This input provides all necessary details for a successful mapping. ```graphql { "input": { "externalProducts": [ { "title": "Title", "images": ["https://anything.com/png", "https://i.ebayimg.com/sample/png"], "aspects": [ { "name": "Color", "values": [ "Blue" ] } ] } ] } } ``` -------------------------------- ### GET /sell/fulfillment/v1/order/{orderId} Source: https://developer.ebay.com/develop/guides-v2/using-ebay-restful-apis Example of a Fulfillment API operation to retrieve order details using a specific order identifier. ```APIDOC ## GET /sell/fulfillment/v1/order/{orderId} ### Description Retrieves the contents of an order based on its unique identifier. ### Method GET ### Endpoint https://api.ebay.com/sell/fulfillment/v1/order/{orderId} ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. #### Query Parameters - **fieldGroups** (string) - Optional - Provides control over the data returned by the operation. ``` -------------------------------- ### Example Content-Digest Header Source: https://developer.ebay.com/develop/guides-v2/digital-signatures-for-apis.md The Content-Digest header provides an SHA-256 digest of the HTTP payload. This header is conditional and not required for requests without a payload, such as GET calls. ```text sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=: ``` -------------------------------- ### Start Listing Preview Creation with Unmapped Image Source: https://developer.ebay.com/develop/guides-v2/listing-creation Use the `startListingPreviewsCreation` mutation to create a listing preview when an image is provided but cannot be mapped by eBay. This input specifies an image URL for an external product. ```graphql { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/unmapped/png"] } ] } } ``` -------------------------------- ### Start Listing Previews Creation Source: https://developer.ebay.com/develop/guides-v2/listing-creation Initiates the creation of listing previews. This mutation can accept product images or titles to generate previews. ```APIDOC ## startListingPreviewsCreation Mutation ### Description Creates a listing preview based on provided product details. ### Method mutation ### Endpoint /v1/listing_creation/start_listing_previews_creation ### Parameters #### Request Body - **input** (object) - Required - The input object for the mutation. - **externalProducts** (array) - Required - A list of external products to create previews for. - **images** (array) - Optional - A list of image URLs for the product. - **title** (string) - Optional - The title of the product. ### Request Example **Unmapped Image Example:** ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/unmapped/png"] } ] } } ``` **Invalid Image Example:** ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/failed/png"] } ] } } ``` **Valid Title Example:** ```json { "input": { "externalProducts": [ { "title": "Title" } ] } } ``` ``` -------------------------------- ### Example eBay Deals API Response Payload Source: https://developer.ebay.com/develop/guides-v2 This JSON payload represents a successful response from the GET /buy/v1/deals API endpoint, listing current eBay deals for a specified category. It includes details such as item title, price, and deal end time. ```json { "deals": [ { "groupId": "v1|1***********|0", "title": { "content": "Apple iPhone 4S - 32GB - White Smartphone-14485" }, "imageLink": "http://i.ebayimg.ebay.com/0*****/$_35.JPG", "minPrice": { "value": 300, "currency": "USD" }, "maxPrice": { "value": 300, "currency": "USD" }, "categoryIdentifier": "Cell Phones & Smartphones", "quantitySold": 12, "discount": true, "originalPrice": { "value": 401, "currency": "USD" }, "quantityLimitPerBuyer": 5, "priceDisplayCondition": "ALWAYS_SHOW", "itemGroup": "/buy/v1/item_group/v1|1***********|0", "dealEndtime": { "value": "2024-11-27T14:59:00.000Z", "formattedValue": "2024-11-27T14:59:00.000Z" } }, { "groupId": "v1|1***********|0", "title": { "content": "Packing and Shipping boxes - 19273-1445985364525" }, "...": "..." } ] } ``` -------------------------------- ### Start Listing Preview Creation with Valid Title Source: https://developer.ebay.com/develop/guides-v2/listing-creation Initiate listing preview creation using the `startListingPreviewsCreation` mutation with a valid product title. This input demonstrates providing only a title for the external product. ```graphql { "input": { "externalProducts": [ { "title": "Title" } ] } } ``` -------------------------------- ### Content-Digest Header Example Source: https://developer.ebay.com/develop/guides-v2/digital-signatures-for-apis/digital-signatures-for-apis Example of a JSON payload and its corresponding SHA-256 Content-Digest header value. ```json {"hello": "world"} ``` ```text sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=: ``` -------------------------------- ### Start Listing Preview Creation Mutation Input Source: https://developer.ebay.com/develop/guides-v2/listing-creation Provide image input to the startListingPreviewsCreation mutation to create a listing preview. This mutation returns a task ID for subsequent queries. ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/sample/png"] } ] } } ``` -------------------------------- ### Start Listing Previews Creation Mutation Input Source: https://developer.ebay.com/develop/guides-v2/listing-creation Use this input with the `startListingPreviewsCreation` mutation to create a listing preview based on provided title, image, and item aspects. This is useful when eBay can automatically map the product details. ```json { "input": { "externalProducts": [ { "images": ["https://i.ebayimg.com/unmapped/png"], "title": "Unmapped Title", "aspects": [ { "name": "Color", "values": [ "Blue" ] } ] } ] } } ``` -------------------------------- ### Error Response Example Source: https://developer.ebay.com/develop/guides-v2 An example of an error response from the eBay API, detailing a problem with a request parameter. ```APIDOC ## Error Response Example ### Description This example shows a sample response when there is a problem with one of the parameters passed into the API call. ### Response Example ```json { "errors": [ { "errorId": 15008, "domain": "API_ORDER", "category": "REQUEST", "message": "Invalid Field : itemId.", "inputRefIds": [ "$.lineItemInputs[0].itemId" ], "parameters": [ { "name": "itemId", "value": "v1|2*********|0" } ] } ] } ``` ``` -------------------------------- ### Start Listing Previews Creation Mutation Source: https://developer.ebay.com/develop/guides-v2/listing-creation Use the startListingPreviewsCreation mutation to create a listing preview based on the provided product ID and title. This is useful for validating product details before a full listing creation. ```graphql { "input": { "externalProducts": [ { "externalProductIdentifierInput": { "productId": "222", "productType": "UPC" }, "title": "Something" } ] } } ``` -------------------------------- ### startListingPreviewsCreation Mutation Source: https://developer.ebay.com/develop/api/sell/inventory_mapping.md Initiates an asynchronous process to create eBay listing previews from a seller's external product data (up to 10 products). The mutation returns the task's status, ID, and any errors encountered. ```APIDOC ## startListingPreviewsCreation ### Description The startListingPreviewsCreation mutation initiates a process that leverages a seller’s provided external product data (maximum 10 products) and uses this data to create an eBay listing preview for each provided product. This asynchronous process can take some time to complete, which is partially dependent on the number of external products being processed. The startListingPreviewsCreation mutation includes details of the external products. The output of the mutation will include the status and ID of the task, and may include errors if there are any issues. Once the listing previews task is complete, the mutation response will also include the results of the listing preview. This mutation is useful for sellers who want to convert their external products into eBay Listing Previews. The field will only be null when there is a server error prior to starting the preview creation process. ### Method mutation ### Arguments #### input (StartListingPreviewsCreationInput!) - **input** (StartListingPreviewsCreationInput!) - Required - Details of the external products for which to create listing previews. ### Returns `StartListingPreviewsCreationOutput` ### OAuth Scope This request requires an access token created with the **Authorization Code Grant** flow, using one or more scopes from the following list: - `https://api.ebay.com/oauth/api_scope/sell.inventory.mapping` ``` -------------------------------- ### XML Seven-Day Warning Response Example Source: https://developer.ebay.com/develop/guides-v2/authorization This is an example of an XML response from the GeteBayOfficialTimeResponse call, showing the HardExpirationWarning element with a specific expiration date. ```xml 2005-01-12T18:29:48.312Z Success 00000000-00000000-00000000-00000000-00000000-00000000-0000000000 393 20050110220901 2005-01-14 03:34:00 ``` -------------------------------- ### Fetch Token with XML API and Credentials in Headers Source: https://developer.ebay.com/develop/guides-v2/authorization This example demonstrates fetching an authentication token for XML API calls by providing requester credentials in HTTP headers instead of the request payload. ```http X-EBAY-API-APP-NAME:MyAppID X-EBAY-API-DEV-NAME:MyDevID X-EBAY-API-CERT-NAME:MyCertID X-EBAY-API-CALL-NAME:FetchToken X-EBAY-API-SITEID:0 Content-Type:text/xml Request Payload: 1169 MySessionID ``` -------------------------------- ### StartListingPreviewsCreation Source: https://developer.ebay.com/develop/api/sell/inventory_mapping.md Initiates the creation of listing previews. This mutation returns a task ID that can be used to track the progress and retrieve the results once the task is complete. ```APIDOC ## StartListingPreviewsCreation ### Description Initiates the creation of listing previews. This mutation returns a task ID that can be used to track the progress and retrieve the results once the task is complete. ### Method mutation ### Arguments - **input** (ListingPreviewsCreationTaskByIdInput!) - The input object for the mutation, containing the ID of the listing preview task. ### Response #### Success Response (200) - **listingPreviewsCreationTask** (StartListingPreviewsCreationOutput) - Contains the ID of the created task and any potential errors. - **errors** ([StartListingPreviewsCreationError!]) - An array of errors that occurred during the mutation. Null if no errors. ### Response Example ```json { "data": { "startListingPreviewsCreation": { "listingPreviewsCreationTask": { "id": "12345" }, "errors": null } } } ``` ``` -------------------------------- ### Start Listing Preview Creation with Unmapped Title Source: https://developer.ebay.com/develop/guides-v2/listing-creation Use the `startListingPreviewsCreation` mutation to create a listing preview when only a title is provided. This demonstrates a scenario where the title may not map to an eBay product. ```graphql { "input": { "externalProducts": [ { "title": "Unmapped Title" } ] } } ``` -------------------------------- ### Fetching a Token Programmatically with SOAP Source: https://developer.ebay.com/develop/guides-v2/authorization This example shows how to fetch an authentication token using SOAP by including requester credentials directly in the SOAP header. ```APIDOC ## Fetching a Token Programmatically with SOAP ### Description This example demonstrates how to make a `FetchToken` call using SOAP, including the requester credentials directly within the SOAP header. ### Method SOAP ### Endpoint Not specified, typically a WSDL endpoint. ### Request Body ```xml MyAppID MyDevID MyCertID MySessionID 1169 ``` ``` -------------------------------- ### GET /report Source: https://developer.ebay.com/develop/guides-v2/marketing-and-promotions/marketing-and-promotions-guide Download the generated report content. ```APIDOC ## GET /report ### Description Download a Promoted Listings report once the task status is SUCCESS. ### Method GET ### Endpoint /report/{reportId} ``` -------------------------------- ### Create a Promoted Listings campaign Source: https://developer.ebay.com/develop/guides-v2/marketing-and-promotions/marketing-and-promotions-guide Use the createCampaign method to set up the basic structure of a Promoted Listings campaign. Ensure marketplaceId, campaignName, and startDate are configured. ```javascript const campaign = { marketplaceId: "EBAY_US", campaignName: "My General Strategy Campaign", startDate: "2024-01-01T12:00:00Z" }; const response = sellMarketing.createCampaign(campaign); console.log(response); ``` -------------------------------- ### GET /buy/deal/v1/event Source: https://developer.ebay.com/develop/guides-v2/marketing-and-discounts/marketing-and-discounts-guide Retrieve events on a specific marketplace. ```APIDOC ## GET /buy/deal/v1/event ### Description Retrieves events for a specified marketplace. ### Method GET ### Endpoint /buy/deal/v1/event ### Query Parameters - **limit** (integer) - Optional - The maximum number of events to return. - **marketplace_id** (string) - Required - The marketplace ID for which to retrieve events. ### Request Example ```bash curl -X GET "https://api.ebay.com/buy/deal/v1/event?limit=1" -H "Authorization:Bearer OAUTH_token" -H "X-EBAY-C-MARKETPLACE-ID:EBAY_US" ``` ### Response #### Success Response (200) - **events** (array) - A list of events. - **eventId** (string) - The ID of the event. - **title** (string) - The title of the event. - **startTime** (string) - The start time of the event. - **endTime** (string) - The end time of the event. #### Response Example ```json { "events": [ { "eventId": "event123", "title": "Example Event", "startTime": "2023-10-27T10:00:00Z", "endTime": "2023-10-27T18:00:00Z" } ] } ``` ```