feed APIv1.3.1

createInventoryTask

POST
/inventory_task
This method creates an inventory-related download task for a specified feed type with optional filter criteria. When using this method, specify the feedType.

This method returns the location response header containing the getInventoryTask call URI to retrieve the inventory task you just created. The URL includes the eBay-assigned task ID, which you can use to reference the inventory task.

To retrieve the status of the task, use the getInventoryTask method to retrieve a single task ID or the getInventoryTasks method to retrieve multiple task IDs.

Note: The scope depends on the feed type. An error message results when an unsupported scope or feed type is specified.

Presently, this method supports Active Inventory Report. The ActiveInventoryReport returns a report that contains price and quantity information for all of the active listings for a specific seller. A seller can use this information to maintain their inventory on eBay.

Input

Resource URI (production)

POST https://api.ebay.com/sell/feed/v1/inventory_task

URI parameters

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

HeaderTypeDescription
X-EBAY-C-MARKETPLACE-IDstringThe ID of the eBay marketplace where the item is hosted.

Note: This value is case sensitive.

For example:

X-EBAY-C-MARKETPLACE-ID:EBAY_US

This identifies the eBay marketplace that applies to this task. See MarketplaceIdEnum.

Occurrence: Strongly Recommended

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.inventory

See OAuth access tokens for more information.

Input container/fieldTypeDescription
schemaVersionstringThe schemaVersion/version number of the file format (use the schema version of the API to which you are programming):

Occurrence: Optional

feedTypestringThe feed type associated with the inventory task you are about to create. Use a feedType that is available for your API. Presently, only one feed type is available:
  • LMS_ACTIVE_INVENTORY_REPORT

Occurrence: Required

filterCriteriaInventoryFilterCriteriaThe container for the filter fields. This container is used to set the filter criteria for the ActiveInventoryReport. A seller can set date range filters and/or can retrieve listings in a specific state, date, or format.

Occurrence: Optional

filterCriteria.creationDateRangeDateRangeThe creation date range of the listings you want returned. Set the date range so it contains less than 10 days (maximum). If you do not specify a creationDateRange, results from the last 10 days will be returned in ActiveInventoryReport by default.

Occurrence: Optional

filterCriteria.creationDateRange.fromstringThe beginning date in the range. If the parent type is included, both the from and/or the to fields become conditionally required.

Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ

For example: Tasks within a range
yyyy-MM-ddThh:mm:ss.SSSZ..yyyy-MM-ddThh:mm:ss.SSSZ

Tasks created on March 31, 2021
2021-03-31T00:00:00.000Z..2021-03-31T00:00:00.000Z

Occurrence: Conditional

filterCriteria.creationDateRange.tostringThe end date for the date range, which is inclusive. If the parent type is included, both the from and/or the to fields become conditionally required.

For example:

Tasks within a range
yyyy-MM-ddThh:mm:ss.SSSZ..yyyy-MM-ddThh:mm:ss.SSSZ

Tasks created on March 31, 2021
2021-03-31T00:00:00.000Z..2021-03-31T00:00:00.000Z

Occurrence: Conditional

filterCriteria.modifiedDateRangeDateRangeThe modified date range of the listings you want returned.

Occurrence: Optional

filterCriteria.modifiedDateRange.fromstringThe beginning date in the range. If the parent type is included, both the from and/or the to fields become conditionally required.

Format: UTC yyyy-MM-ddThh:mm:ss.SSSZ

For example: Tasks within a range
yyyy-MM-ddThh:mm:ss.SSSZ..yyyy-MM-ddThh:mm:ss.SSSZ

Tasks created on March 31, 2021
2021-03-31T00:00:00.000Z..2021-03-31T00:00:00.000Z

Occurrence: Conditional

filterCriteria.modifiedDateRange.tostringThe end date for the date range, which is inclusive. If the parent type is included, both the from and/or the to fields become conditionally required.

For example:

Tasks within a range
yyyy-MM-ddThh:mm:ss.SSSZ..yyyy-MM-ddThh:mm:ss.SSSZ

Tasks created on March 31, 2021
2021-03-31T00:00:00.000Z..2021-03-31T00:00:00.000Z

Occurrence: Conditional

filterCriteria.listingFormatListingFormatEnumThe type of buying option for the order. Supports LMS_ACTIVE_INVENTORY_REPORT.

Occurrence: Optional

filterCriteria.listingStatusListingStatusEnumThe status of the listing (whether the listing was unsold or is active). The UNSOLD value does not apply to LMS_ACTIVE_INVENTORY_REPORT feed types.

Occurrence: Optional

inventoryFileTemplateInventoryFileTemplateEnumThe inventory file template used to return specific types of inventory tasks. Presently not applicable for LMS_ACTIVE_INVENTORY_REPORT.

Occurrence: Optional

Output

HTTP response headers

See HTTP response headers for details.

HeaderMeaning
LocationThe location response header contains the URL to the inventory task. The URL includes the eBay-assigned task ID, which you can use to reference the task.

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.

StatusMeaning
202Accepted
400Bad Request
403Forbidden
409Conflict
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
160001API_FEEDAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
160002API_FEEDREQUESTThe authentication scope {scope} is incorrect for 'feed_type' {feedType}. Refer to documentation for details about the scopes.
160017API_FEEDREQUESTThe 'feedType' is missing or invalid.
160018API_FEEDREQUESTThe 'schemaVersion' is invalid.
160019API_FEEDREQUESTThe 'filterCriteria' is invalid. {additionalInfo}
160022API_FEEDREQUESTYou are not allowed to access this resource. Contact eBay Developer Technical Support for assistance.
160024API_FEEDBUSINESSYou have reached the maximum number of feed tasks that can be queued or processed concurrently. Wait for current tasks to complete before adding tasks. For more information, see the documentation for this API.
160025API_FEEDBUSINESSYou have exceeded the maximum number of records or tasks that can be created or processed in the period (hourly or daily). Wait until the present period ends before trying again. Please reference the API documentation for more information.
160027API_FEEDREQUESTThe X-EBAY-C-MARKETPLACE-ID header is missing or invalid.
160030API_FEEDREQUESTThis resource is not applicable for the feed type {feedTypeValue}. For more information, see the documentation for this API.

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: Create an Inventory Task

This call creates an inventory-related task to download the LMS Active Inventory Report, which contains price and quantity information for all the active listings for a specific seller.

Input

The inputs are schemaVersion and feedType.
POST
https://api.ebay.com/sell/feed/v1/inventory_task

Output

The output is an HTTP status. If the call is successful, the task ID is returned in the Location response header.