GET/promotion
Note: As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help pages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
This method returns a list of a seller's undeleted discounts.
The call returns up to 200 currently-available discounts on the specified marketplace. While the response body does not include the discount's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the discount).
Use query parameters to sort and filter the results by the number of discounts to return, the discount state or type, and the eBay marketplace. You can also supply keywords to limit the response to the discounts that contain that keywords in the title of the discount.
Maximum returned: 200
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 |
---|---|---|
q | string | A string consisting of one or more keywords. eBay filters the response by returning only the discounts that contain the supplied keywords in the title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains discounts with both "iPhone" and "iPad" in the title. Occurrence: Optional |
limit | string | Specifies the maximum number of discounts returned on a page from the result set. Default: 200 Maximum: 200 Occurrence: Optional |
offset | string | Specifies the number of discounts to skip in the result set before returning the first discount 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 Default: 0 Occurrence: Optional |
marketplace_id | string | This parameter specifies eBay marketplace ID of the site where the discount is hosted. See MarketplaceIdEnum for supported Marketplace ID values. Occurrence: Required |
sort | array of SortField | Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example: sort=END_DATE Sorts the discounts in the response by their end dates in ascending order sort=-PROMOTION_NAME Sorts the discounts by their name in descending alphabetical order (Z-Az-a) Valid values:
Occurrence: Optional |
promotion_status | string | This parameter specifies the discount state by which you want to filter the results. The response contains only those discounts that match the state you specify. See PromotionStatusEnum for supported values. Maximum number of input values: 1 Occurrence: Optional |
promotion_type | string | This parameter specifies the campaign discounts type by which you want to filter the results. See PromotionTypeEnum for supported values. 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 |
---|---|---|
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 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. 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 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. Occurrence: Conditional |
promotions | array of PromotionDetail | A list containing the details of each returned discount. This includes all the information about the discounts except for the listings that are discounted. Occurrence: Always |
promotions.couponCode | string | A unique code that buyers can use during checkout to receive a discount. The code must be unique across eBay. Occurrence: Always |
promotions.description | string | This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a discount and displayed under the offer tile that is shown on the seller's All Offers page and on the discount's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE discoutns (and not valid for VOLUME_DISCOUNT discounts). Occurrence: Conditional |
promotions.endDate | string | The date and time the discount ends in UTC format ( Occurrence: Always |
promotions.marketplaceId | MarketplaceIdEnum | The eBay marketplace ID of the site where the discount is hosted. Threshold discounts are supported on a select set of marketplaces while markdown discounts are supported on all eBay marketplaces. Valid values for threshold discounts are as follows:
Occurrence: Always |
promotions.name | string | The seller-defined name or "title" of the discount, such as "Buy 1 Get 1", that the seller can use to identify a discount. This label is not displayed in end-user flows. Occurrence: Always |
promotions.priority | PromotionPriorityEnum | Applicable for only ORDER_DISCOUNT discount, this field indicates the precedence of the discount, which is used to determine the position of a discount on the seller's All Offers page. If an item is associated with multiple discounts, the discount with the higher priority takes precedence. Occurrence: Conditional |
promotions.promotionHref | string | The URI of the discount details. Occurrence: Always |
promotions.promotionId | string | A unique eBay-assigned ID for the discount that's generated when the discount is created. Occurrence: Always |
promotions.promotionImageUrl | string | Required for CODED_COUPON, MARKDOWN_SALE, and ORDER_DISCOUNT discount, and not applicable for VOLUME_DISCOUNT discounts, this field is a URL that points to an image for the discount. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. Occurrence: Always |
promotions.promotionStatus | PromotionStatusEnum | The current status of the discount. When creating a new discount, you must set this value to either Occurrence: Always |
promotions.promotionType | PromotionTypeEnum | Indicates type of the discount, either Occurrence: Always |
promotions.startDate | string | The date and time the discount starts in UTC format ( Occurrence: Always |
total | integer | The total number of items 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 |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
38201 | API_MARKETING | APPLICATION | Internal server error encountered. If this problem persists, contact the eBay Developers Program for support. |
38204 | API_MARKETING | REQUEST | The seller is not eligible for promotions because they do not have an eBay Store or they have not accepted the terms and conditions for creating a promotion on this Marketplace, see the documentation for this call. |
38211 | API_MARKETING | REQUEST | The offset value must be an integer value greater than or equal to zero. |
38212 | API_MARKETING | REQUEST | The sort value was not valid. For the valid values, see the documentation for this call. |
38213 | API_MARKETING | REQUEST | You can query a limit of between 0 and 200 promotion records at a time. Update the request and resubmit the call. |
38240 | API_MARKETING | REQUEST | Invalid input for the 'promotionStatus' field. For help, see the documentation for this call. |
345141 | API_MARKETING | REQUEST | Invalid input for the 'promotionType' field. For help, see the documentation for this call. |
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: Get All Discounts
This sample retrieves all the seller's discounts for a specific eBay marketplace.
Input
Only the marketplace_id parameter is required, but there are several filters you can use to limit the response. This sample uses the limit, offset, promotion_status and sort filters.
GEThttps://api.ebay.com/sell/marketing/v1/promotion?limit=5&offset=0&promotion_status=DRAFT&sort=START_DATE&marketplace_id=EBAY_US
Output
The output is all the seller's draft discounts, sorted by start date. The response is paginated to return five discounts, starting with the first one retrieved.