Skip to main content

GET/listing/{listingId}/sku/{sku}/locations

This method allows sellers to retrieve the locations mapped to a specific SKU within a listing.

The listingId and sku of the listing are passed in as path parameters. This method only retrieves location mappings for a single SKU value; if a seller wishes to retrieve the location mappings for all items in a multiple-variation listing, this method must be called for each variation in the listing.

If there are fulfillment center locations mapped to the SKU, they will be returned in the locations array. If no locations are mapped to the SKU, status code 404 Not Found will be returned.

Input

Resource URI

GET https://api.ebay.com/sell/inventory/v1/listing/{listingId}/sku/{sku}/locations

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

ParameterTypeDescription
listingIdstringThis path parameter specifies the unique identifier of the listing that the SKU belongs to for which all mapped locations will be retrieved.

Use the getOffers method of the Inventory API or the GetMyEbaySelling method of the Trading API to retrieve all listing IDs for all active listings.

Occurrence: Required

skustringThis path parameter specifies the seller-defined SKU value of the item/variation for which location mappings will be retrieved. This SKU value must be defined in the listing specified in listingId parameter

Use the getOffers method of the Inventory API or the GetMyEbaySelling method of the Trading API to retrieve all SKUs for all active listings.

Occurrence: Required

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 client credentials 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

https://api.ebay.com/oauth/api_scope/sell.inventory.readonly

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/fieldTypeDescription
locationsarray of LocationAvailabilityDetails

This array represents a collection of fulfillment center locations mapped to a SKU.

Note: Only the first 50 locations mapped to a SKU will be considered when calculating estimated delivery dates. Sellers can set up more than 50 locations using this method, but only the first 50 locations will be considered for calculating the estimates.

Occurrence: Always

locations.merchantLocationKeystring

The unique identifier of a seller’s fulfillment center location where inventory is available for the item or item variation.

Note: When creating a location mapping using the createOrReplaceSkuLocationMapping method, the value entered in this field must be associated with a location with the FULFILLMENT_CENTER location type, or an error will occur. Sellers can check the locationTypes array in the response of the getInventoryLocations method to see if their location has a value of FULFILLMENT_CENTER.

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.

StatusMeaning
200Success
400Bad Request
404Not Found
500Internal Server Error

Error codes

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

CodeDomainCategoryMeaning
25001API_INVENTORYAPPLICATIONAny System error. {additionalInfo}
25002API_INVENTORYREQUESTAny User error. {additionalInfo}
25904API_INVENTORYREQUESTInvalid listing ID or the listing does not belong to the seller.
25905API_INVENTORYREQUESTInvalid SKU value or the SKU value is not defined in the listing.

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: Retrieve all locations mapped to a SKU

This method is used to retrieve all location mappings for a specified SKU within a listing.

Input

In the path parameter of the URI, specify the SKU for which you want to retrieve all mapped locations using the listingId and sku value associated with the SKU and listing.

GEThttps://api.ebay.com/sell/inventory/v1/listing/1**********4/sku/g********1/locations

Output

If a call is successful, 200 Success is returned, along with a response body containing an array of locations mapped to the SKU. In this example, two locations are returned.