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
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 |
---|---|---|
listingId | string | This 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 |
sku | string | This 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/field | Type | Description |
---|---|---|
locations | array of LocationAvailabilityDetails | This array represents a collection of fulfillment center locations mapped to a SKU. Occurrence: Always |
locations.merchantLocationKey | string | The unique identifier of a seller’s fulfillment center location where inventory is available for the item or item variation. 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 |
404 | Not Found |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
25001 | API_INVENTORY | APPLICATION | Any System error. {additionalInfo} |
25002 | API_INVENTORY | REQUEST | Any User error. {additionalInfo} |
25904 | API_INVENTORY | REQUEST | Invalid listing ID or the listing does not belong to the seller. |
25905 | API_INVENTORY | REQUEST | Invalid 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.