getInventoryLocation
<p><strong>GET</strong> /location/{merchantLocationKey}</p>
<p>此调用将检索由merchantLocationKey path参数指定的库存位置的所有已定义详细信息。
所述authorizationHTTP标头是该呼叫的唯一所需的请求报头。</p>
<p>成功调用将返回HTTP状态值200 OK。</p>
<h5>Input</h5>
<h6>Resource URI (production)</h6>
<p>GET <a href="https://api.ebay.com/sell/inventory/v1/location/{merchantLocationKey">https://api.ebay.com/sell/inventory/v1/location/{merchantLocationKey</a>}</p>
<h6>URI parameters</h6>
<table>
<thead>
<tr>
<th>参数</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>merchantLocationKey</td>
<td>string</td>
<td>商品定义的唯一商品密钥(ID),用于库存位置。此唯一标识符或密钥在其他Inventory API调用中用于标识库存位置。最大长度:36 发生:必需</td>
</tr>
</tbody>
</table>
<h6>HTTP请求标头</h6>
<p>对eBay REST操作发出的所有请求都要求您提供授权 HTTP标头以进行身份验证授权。
此外,此方法要求您包含Content-Type标头,其值应设置为“ application / json ”。请参阅<a href="http://developer.ebay.com/devzone/rest/ebay-rest/content/rest-request-components.html#HTTP" title="HTTP请求标头">HTTP请求标头</a>打开其余请求组件页面以获取详细信息</p>
<h6>OAuth范围</h6>
<p>此请求需要使用<a href="https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html" title="授权代码授权">授权代码授权</a>流创建的访问令牌,使用以下列表中的一个范围:
<a href="https://api.ebay.com/oauth/api_scope/sell.inventory.readonly">https://api.ebay.com/oauth/api_scope/sell.inventory.readonly</a>
<a href="https://api.ebay.com/oauth/api_scope/sell.inventory">https://api.ebay.com/oauth/api_scope/sell.inventory</a></p>
<p>eBayUser</p>
<p>有关详细信息,请参阅<a href="https://developer.ebay.com/api-docs/static/oauth-tokens.html" title="OAuth访问令牌">OAuth访问令牌</a>。</p>
<h6>Request payload</h6>
<p>This call has no payload.</p>
<h6>Request fields</h6>
<p>This call has no field definitions.</p>
<h5>Output</h5>
<h6>HTTP response headers</h6>
<p>This call has no response headers.</p>
<h6>Response payload</h6>
<pre><code class="language-json">{
"location": {
"address": {
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"country": "CountryCodeEnum : [AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,PH,PK,PL,PM,PN,PR,PS,PT,PW,PY,QA,RE,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,WS,YE,YT,ZA,ZM,ZW]",
"county": "string",
"postalCode": "string",
"stateOrProvince": "string"
},
"geoCoordinates": {
"latitude": "number",
"longitude": "number"
},
"locationId": "string"
},
"locationAdditionalInformation": "string",
"locationInstructions": "string",
"locationTypes": [
"StoreTypeEnum"
],
"locationWebUrl": "string",
"merchantLocationKey": "string",
"merchantLocationStatus": "StatusEnum : [DISABLED,ENABLED]",
"name": "string",
"operatingHours": [
{
"dayOfWeekEnum": "DayOfWeekEnum : [MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY]",
"intervals": [
{
"close": "string",
"open": "string"
}
]
}
],
"phone": "string",
"specialHours": [
{
"date": "string",
"intervals": [
{
"close": "string",
"open": "string"
}
]
}
]
}</code></pre>
<h6>Response fields</h6>
<table>
<thead>
<tr>
<th>输入容器/字段</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>location</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:LocationDetails" title="LocationDetails">LocationDetails</a></td>
<td>此必需容器用于设置仓库或商店库存位置的物理地址和地理坐标(可选)。仓库库存位置仅需要城市,省/州和国家/地区,并且不需要完整的街道地址。但是,卖方仍可提供仓库位置的完整街道地址。一旦使用createInventoryLocation调用设置,就无法修改库存位置的物理位置/地址。可以使用updateInventoryLocation调用更改库存位置的所有其他详细信息(例如电话或营业时间)。发生:必需</td>
</tr>
<tr>
<td>location.address</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:Address" title="Address">Address</a></td>
<td>该地址容器所需的createInventoryLocation电话。除了支持店内分拣库存的库存位置外,在设置库存位置时不需要完整地址。发生:必需</td>
</tr>
<tr>
<td>location.address.addressLine1</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>街道地址的第一行。对于将持有店内提货库存的商店库存位置,此字段是必需的。如果库存位置未持有店内提货库存,则不需要街道地址。如果为库存位置定义,则将返回此字段。最大长度:128 发生:有条件的</td>
</tr>
<tr>
<td>location.address.addressLine2</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>街道地址的第二行。此字段可用于其他地址信息,例如套房或公寓号。如果库存位置未持有店内提货库存,则不需要街道地址。如果为库存位置定义,则将返回此字段。最大长度:128发生:有条件的</td>
</tr>
<tr>
<td>location.address.city</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>库存位置所在的城市。对于将持有店内提货库存的商店库存位置,此字段是必需的。对于仓库位置,此字段在技术上是可选的,因为可以使用postalCode而不是 city / stateOrProvince对,然后城市只是从这个邮政/邮政编码派生。如果为库存位置定义,则返回此字段。最大长度:128 发生:有条件的</td>
</tr>
<tr>
<td>location.address.country</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/ba:CountryCodeEnum" title="CountryCodeEnum">CountryCodeEnum</a></td>
<td>地址所在的国家/地区,表示为双字母ISO 3166-1 Alpha-2国家/地区代码。例如,US代表美国,DE代表德国。最大长度:2发生:必需</td>
</tr>
<tr>
<td>location.address.county</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>地址所在的县。如果为库存位置定义,则返回此字段。出现:可选</td>
</tr>
<tr>
<td>location.address.postalCode</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>地址的邮政编码。易趣使用邮政编码在买家所在地附近展示店内提货物品,并使用邮政编码(原产地和目的地)来估算卖家使用计算出货时的运费。甲城市 / stateOrProvince对可被用来代替一个邮编值,然后将邮递区号距离城市和州/省的。如果为库存位置定义,则返回此字段。最大长度:16发生:有条件的</td>
</tr>
<tr>
<td>location.address.stateOrProvince</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>库存位置所在的州/省。对于将持有店内提货库存的商店库存位置,此字段是必需的。对于仓库位置,此字段在技术上是可选的,因为可以使用postalCode而不是city / stateOrProvince对,然后州或省只是从此邮政/邮政编码派生。最大长度:128发生:有条件的</td>
</tr>
<tr>
<td>location.geoCoordinates</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/ba:GeoCoordinates" title="GeoCoordinates">GeoCoordinates</a></td>
<td>此容器用于设置库存位置的全球定位系统(GPS)纬度和经度坐标。出现:可选</td>
</tr>
<tr>
<td>location.geoCoordinates.latitude</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="number">number</a></td>
<td>地理坐标的纬度(南北)分量。如果使用geoCoordinates容器,则此字段是必需的。如果为库存位置设置了地理坐标,则返回此字段。发生:有条件的</td>
</tr>
<tr>
<td>location.geoCoordinates.longitude</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="number">number</a></td>
<td>地理坐标的经度(东 - 西)分量。如果使用geoCoordinates容器,则此字段是必需的。如果为库存位置设置了地理坐标,则返回此字段。发生:有条件的</td>
</tr>
<tr>
<td>location.locationId</td>
<td>string</td>
<td>eBay为该位置分配的唯一ID。注意:不应将此字段与卖家定义的merchantLocationKey值混淆。它是merchantLocationKey值,用于在处理库存位置API调用时标识库存位置。该locationId值仅被eBay内部使用。发生:总是</td>
</tr>
<tr>
<td>locationAdditionalInformation</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>商家使用此文本字段来提供有关库存位置的其他信息。最大长度:256出现:可选</td>
</tr>
<tr>
<td>locationInstructions</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>商家通常使用该文本字段来为商店库存位置提供特殊的取件指令。虽然此字段是可选字段,但建议商家提供此字段,以便为店内提货和点击和收集订单创建愉快和轻松的取件体验。如果此字段未包含在呼叫请求有效负载中,则易趣将使用商家配置文件中包含的默认提取指令(如果可用)。出现:可选</td>
</tr>
<tr>
<td>locationTypes</td>
<td>array of <a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:StoreTypeEnum" title="StoreTypeEnum">StoreTypeEnum</a></td>
<td>此容器用于定义库存位置的功能。通常,库存位置将用作商店或仓库,但在某些情况下,库存位置可能都是。如果省略此容器,则库存位置的位置类型将默认为WAREHOUSE。有关支持的值,请参阅StoreTypeEnum。默认值:WAREHOUSE出现:可选</td>
</tr>
<tr>
<td>locationWebUrl</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>商家使用该文本字段来提供与库存位置相关联的网站地址(URL)。最大长度:512 出现:可选</td>
</tr>
<tr>
<td>merchantLocationKey</td>
<td>string</td>
<td>库存位置的唯一标识符。当首次使用createInventoryLocation调用创建库存位置时,商家会设置此标识符。为库存位置设置此值后,无法修改该值。最大长度:36;发生:总是</td>
</tr>
<tr>
<td>merchantLocationStatus</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:StatusEnum" title="StatusEnum">StatusEnum</a></td>
<td>此字段用于指示是否启用库存位置(库存可以加载到位置)或禁用(库存无法加载到位置)。如果省略此字段,则成功的createInventoryLocation调用将自动启用库存位置。商家可能希望创建新的库存位置,但如果库存位置尚未准备好用于活动库存,则将其保留为已禁用。库存位置准备就绪后,商家可以使用enableInventoryLocation调用来启用处于禁用状态的库存位置。有关支持的值,请参阅StatusEnum。 默认值:ENABLED 出现:可选</td>
</tr>
<tr>
<td>name</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>库存位置的名称。此名称应该是一个人性化的名称,因为它将显示在店内提货和点击和收集列表中。仓库库存位置不需要名称。对于商店库存位置,此字段不是立即需要的,但在使用In-Store Pickup或Click and Collect功能启用的商品可以发布之前,将需要此字段。因此,如果卖方在createInventoryLocation调用中省略了该字段,则updateInventoryLocation调用将需要该字段。最大长度:1000 发生:有条件的</td>
</tr>
<tr>
<td>operatingHours</td>
<td>array of <a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:OperatingHours" title="OperatingHours">OperatingHours</a></td>
<td>虽然技术上不需要,但强烈建议使用此容器来指定商店库存位置的运行时间。该容器用于表示一周中每天的商店位置的正常营业时间。一个dayOfWeekEnum场和间隔将需要为这家店的位置是开放一周的每一天容器。出现:可选</td>
</tr>
<tr>
<td>operatingHours.dayOfWeekEnum</td>
<td><a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:DayOfWeekEnum" title="DayOfWeekEnum">DayOfWeekEnum</a></td>
<td>一个dayOfWeekEnum值是必需的,这家店的位置有规律的工作时间一周中的每一天。如果为商店位置定义了营业时间,则会返回此字段。发生:必需</td>
</tr>
<tr>
<td>operatingHours.intervals</td>
<td>array of <a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:Interval" title="Interval">Interval</a></td>
<td>此容器用于定义商店工作日的开始和结束时间(在dayOfWeekEnum字段中定义)。一个间隔是需要的存储位置是开放一周的每一天容器。如果商店位置在午餐时间(或白天的任何其他时段)关闭然后重新打开,则需要多个打开和关闭对。如果为商店位置定义了营业时间,则返回此容器。发生:必需</td>
</tr>
<tr>
<td>operatingHours.intervals.close</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>该接近值实际上是商店关闭的时间。使用当地时间(军事格式)。因此,如果商店在当地时间晚上8点关闭,关闭时间将如下所示:20:00:00。如果使用间隔容器指定商店的工作时间或特殊时间,则有条件地需要此字段。如果为商店位置设置,则返回此字段。发生:必需</td>
</tr>
<tr>
<td>operatingHours.intervals.open</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>在开放的价值实际上是存储打开的时间。使用当地时间(军事格式)。因此,如果商店在当地时间上午9点开门,关闭时间如下:09:00:00。如果使用间隔容器指定商店的工作时间或特殊时间,则有条件地需要此字段。如果为商店位置设置,则返回此字段。发生:必需</td>
</tr>
<tr>
<td>phone</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>虽然技术上不需要,但强烈建议使用此字段来指定商店库存位置的电话号码。最大长度:36出现:可选</td>
</tr>
<tr>
<td>specialHours</td>
<td>array of <a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:SpecialHours" title="SpecialHours">SpecialHours</a></td>
<td>此容器用于表示特定日期(例如假日)的商店库存位置的特殊营业时间。为特定日期指定的特殊时间将覆盖该特定日期的正常工作时间。出现:可选</td>
</tr>
<tr>
<td>specialHours.date</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>甲日期值是必需的商店场所具有特殊的操作小时每个特定日期。日期实际上表示为ISO 8601格式中指定的时间戳,该格式使用24小时协调世界时(UTC)时钟。以下示例显示(1)时间戳的格式,以及(2)ISO 8601格式的示例时间值:格式: yyyy-MM-ddThh:mm:ssZ 示例: 2016-10-19T00:09:00Z 如果为商店位置设置,则返回此字段。发生:有条件的</td>
</tr>
<tr>
<td>specialHours.intervals</td>
<td>array of <a href="https://developer.ebay.com/api-docs/sell/inventory/types/api:Interval" title="Interval">Interval</a></td>
<td>此容器用于定义特定日期(在日期字段中定义)的商店的打开和关闭时间。商店有特殊营业时间的每个特定日期需要一个间隔容器。特定日期的这些特殊营业时间优先于一周中特定日期的正常营业时间。如果商店位置在午餐时间(或白天的任何其他时段)关闭然后重新打开,则需要多个打开和关闭对。如果为商店位置设置,则返回此容器。发生:必需</td>
</tr>
<tr>
<td>specialHours.intervals.close</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>该接近值实际上是商店关闭的时间。使用当地时间(军事格式)。因此,如果商店在当地时间晚上8点关闭,关闭时间将如下所示:20:00:00。如果使用间隔容器指定商店的工作时间或特殊时间,则有条件地需要此字段。如果为商店位置设置,则返回此字段。发生:必需</td>
</tr>
<tr>
<td>specialHours.intervals.open</td>
<td><a href="https://developer.ebay.com/api-docs/static/simple-types.html" title="string">string</a></td>
<td>在开放的价值实际上是存储打开的时间。使用当地时间(军事格式)。因此,如果商店在当地时间上午9点开门,关闭时间如下:09:00:00。如果使用间隔容器指定商店的工作时间或特殊时间,则有条件地需要此字段。如果为商店位置设置,则返回此字段。发生:必需</td>
</tr>
</tbody>
</table>
<h6>HTTP status codes</h6>
<p>此调用可以返回以下HTTP状态代码之一。状态代码的概述,请参阅<a href="https://developer.ebay.com/api-docs/static/rest-response-components.html#HTTP" title="HTTP状态代码">HTTP状态代码</a>在使用eBay RESTful API中。</p>
<table>
<thead>
<tr>
<th>状态</th>
<th>含义</th>
</tr>
</thead>
<tbody>
<tr>
<td>204</td>
<td>成功</td>
</tr>
<tr>
<td>400</td>
<td>错误的请求</td>
</tr>
<tr>
<td>404</td>
<td>未找到</td>
</tr>
<tr>
<td>500</td>
<td>内部服务器错误</td>
</tr>
</tbody>
</table>
<h3>错误代码</h3>
<table>
<thead>
<tr>
<th>有关错误的更多信息以及其他常见错误的代码,请参阅<a href="https://developer.ebay.com/api-docs/static/handling-error-messages.html" title="处理错误">处理错误</a>。</th>
<th>码</th>
<th>域</th>
<th>类别</th>
<th>含义</th>
</tr>
</thead>
<tbody>
<tr>
<td>25001</td>
<td>API_INVENTORY</td>
<td>应用</td>
<td>系统错误。{附加信息}</td>
</tr>
<tr>
<td>25804</td>
<td>API_INVENTORY</td>
<td>请求</td>
<td>输入错误。{附加信息}</td>
</tr>
<tr>
<td>25805</td>
<td>API_INVENTORY</td>
<td>请求</td>
<td>{fieldName}未找到。</td>
</tr>
</tbody>
</table>
<h6>示例</h6>
<p>新的API调用?请参阅<a href="https://developer.ebay.com/api-docs/static/make-a-call.html" title="拨打电话">拨打电话</a>。</p>
<p>注意:这些样本中的标识符(例如订单ID或用户ID)和个人数据可能是匿名的,或者在eBay上可能不再有效。如有必要,请在您的请求中替换当前相关的eBay数据。</p>
<h6>示例1:按键获取位置</h6>
<p>此示例检索特定位置。</p>
<h6>Input</h6>
<p>使用merchantLocationKey path参数指定要检索的位置。</p>
<p><strong>POST</strong>
<a href="https://api.ebay.com/sell/inventory/v1/location/store-1">https://api.ebay.com/sell/inventory/v1/location/store-1</a></p>
<h6>Output</h6>
<p>如果调用成功,则返回HTTP状态代码“200 OK”,其响应正文包含指定位置的详细信息。</p>
<pre><code class="language-json">{
"name": "Warehouse #1",
"location": {
"address": {
"locationId": "5467A3358AD12258E054002128D6641A",
"addressLine1": "2055 Hamilton Ave",
"addressLine2": "Building 3",
"city": "San Jose",
"stateOrProvince": "CA",
"postalCode": "95008",
"country": "US"
}
},
"merchantLocationStatus": "ENABLED",
"locationTypes": [
"WAREHOUSE"
],
"merchantLocationKey": "Warehouse-1"
}</code></pre>