ebay api ReviseInventoryStatus 函数

ReviseInventoryStatus

 

1.

作用:卖家通过这个函数可以更新产品价格,数量等。

2

Inputstiem ids  or sku,需要修改的属性的值。

3

更新:有2000次的限制。到达次数后需要续期

原文:Note: As of November 9, 2011, an upper limit of 2,000 has been placed on item revisions that have a pricing impact. Revisions that do not have a pricing impact will not count toward this 2,000 call limit. An item can be revised by the ReviseFixedPriceItem, ReviseItem, and ReviseInventoryStatus calls, and all item revisions (that have a pricing impact) made with these three calls count towards the maximum limit. Once the upper limit is reached, the seller will be blocked from revising the item in any manner, even for revisions that have no pricing impact. For GTC listings, the 2,000 call limit resets with each renewal. 

Example:

<?xml version="1.0" encoding="utf-8"?>

<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">

  <!-- Call-specific Input Fields -->

  <InventoryStatusInventoryStatusType

    <ItemIDItemIDType (string) </ItemID>

    <Quantityint </Quantity>

    <SKUSKUType (string) </SKU>

    <StartPriceAmountType (double) </StartPrice>

  </InventoryStatus>

  <!-- ... more InventoryStatus nodes allowed here ... -->

  <!-- Standard Input Fields -->

  <ErrorLanguagestring </ErrorLanguage>

  <MessageIDstring </MessageID>

  <Versionstring </Version>

  <WarningLevelWarningLevelCodeType </WarningLevel>

</ReviseInventoryStatusRequest>

 

 

<?xml version="1.0" encoding="utf-8"?>

<ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">

  <RequesterCredentials>

    <eBayAuthToken>ABC...123 OF SELLER</eBayAuthToken>

  </RequesterCredentials>

  <Version>589</Version>

  <ErrorLanguage>en_US</ErrorLanguage>

  <WarningLevel>High</WarningLevel>

  <InventoryStatus>

    <ItemID>110035400937</ItemID>

    <Quantity>20</Quantity>

  </InventoryStatus>

  <InventoryStatus>

    <SKU>cmg00002</SKU>

    <ItemID>110035406664</ItemID>

    <Quantity>20</Quantity>

  </InventoryStatus>

  <InventoryStatus>

    <ItemID>110035406665</ItemID>

    <StartPrice>9.95</StartPrice>

  </InventoryStatus>

  <InventoryStatus>

    <SKU>cmg00002</SKU>

    <ItemID>110035407916</ItemID>

    <StartPrice>19.95</StartPrice>

    <Quantity>80</Quantity>

  </InventoryStatus>

</ReviseInventoryStatusRequest>

 

 

 

InventoryStatus:必选,是一个容器,里面包含其他标签,这个标签里面有ItemID,Quantity,sku,startprice,这四个标签,InventoryStatus这个容器标签只能出现一次,不能把这四个子项标签分开写到2个InventoryStatus中。

InventoryStatus.ItemID:有条件性的可选,itemid和sku,必须至少你填写一个,如果2个都写了,但是匹配的时候发现itemid对应的sku没有匹配到,会以itemid为准,sku忽略掉,

Please note that the same ItemID can be returned multiple times in the same response if you revise several variations from the same multi-variation listing. 

 

InventoryStatus.Quantity:指定个数,这个个数指定很有意思,举个例子:如果原来有10个产品,卖出去8个,还剩下2个,现在重新指定个数为10,然后执行完成后,返回的修改后的结果为18,计算的方式为现在的库存加上卖出的个数=18,

要确定库存的个数,可以使用GetItem或GetSellerList,从数量减去SellingStatus.QuantitySold。或用GetMyeBaySelling的QuantityAvailable

InventoryStatus.SKU:产品的唯一标示,可以用来做该函数的唯一值,和itemid至少有一个,但是2个都同时存在的时候,以itemid为准。

 

InventoryStatus.StartPrice:修改固定价格,提高价格会相应的增加ebay的收费。

 

标准input Field

MessageID:如果你传递了messageid,将返回CorrelationID,CorrelationID field in the response. Pairing these values can help you track and confirm that a response is returned for every request and to match specific responses to specific requests.

Version:您正在编写API代码的版本号,他制定了代码的版本,还一些ebay应该用到的数据,您需要使用一个版本,大于或等于最低支持的版本。

对于SOAP API,version是必须填写的,对于 XML API,这个是不写到代码中的,而是,在X-EBAY-API-COMPATIBILITY-LEVEL HTTP header中指定。

WarningLevel:当程序执行一个过时,或者无法识别的程序时,就会返回警告,级别由这里设定,因此,warninglevel可以帮你快速的找到错误,WarningLevel只验证元素,它不验证XML里面的属性值。它不会控制用户输入的字符串,数字,逻辑错误等,发生这些错误时也不会发出警告。

警告的级别:

高:应用程序传递一个请求无法识别的或过时的元素,返回警告

低: 应用程序传递一个请求无法识别的或过时的元素,不返回警告,这个是默认值。

建议在调试和开发环境中使用“高”,正式环境中使用低。

 

 

ReviseInventoryStatus Output:

 

Fees:在他的子元素中返回上架预计费用,使用itemid参数可以获取到相应的费用数据,这个费用不包含最终的费用,最终的数据以上架后为准,。

If you revise a variation in a multi-variation listing, the fees are for the entire listing. The insertion fee and listing fee are affected by the highest priced variation in the listing (which is not necessarily the variation that you passed in the request).

 

Also note that the call returns only one Fees node per listing. For example, if you revise 4 variations from the same multi-variation listing, the response includes 4 InventoryStatus nodes and 1 Fees node. 

See: 
    eBay.com Fees 
    Fees per Site 
    Final Value Fees and Credits 
    Final Value Fees

Fees.Fee:一个Fee的容器,里面包含fee,name ,amount

Fees.Fee.Name:Name of the listing feature, for identification purposes. See the Trading API guide for a list of current listing features names and associated fees. 

Fees.Fee.PromotionalDiscount:促销折扣,当卖家参与了促销折扣,这个选项将会显示出来,收费标准参看http://pages.ebay.com/help/sell/fees.html

 

Fees.ItemID:这个不需要解释了。在回复中用来做唯一标示,Max length: 19

InventoryStatus:容器

 

InventoryStatus.ItemID:注意:itemid在一次返回中,是可以返回多次的,前提是:你对同一个itemid执行了多次操作。Please note that the same ItemID can be returned multiple times in the same response if you revise several variations from the same multi-variation listing. 

 

InventoryStatus.Quantity:最近一次的数量(the latest quantity),含义为:可以出售的数目(包含卖出的)。例子:如果有10个产品,卖出去8个,然后重新指定库存为10个,那么,当前返回的为18(10个库存+8个卖出的),确定库存,(接下面的蓝色英文)

原文:suppose the listing originally had Quantity=10, and then 8 sold. Now you restock your inventory, and you pass Quantity=10 in the ReviseInventoryStatus request. In this case, ReviseInventoryStatus returns Quantity=18 (10 available + 8 sold). To determine the quantity available, use GetItem or GetSellerList, and subtract SellingStatus.QuantitySold from Quantity. Or see QuantityAvailable in GetMyeBaySelling.

 

InventoryStatus.SKU:

InventoryStatus.StartPrice:没怎么看懂。

Specifies the revised fixed price of the listing (or of a variation within a multi-variation listing). If you raise the price of a listing, the recent sales score of the listing is reset. (Best Match search ranking is based on buyer activity, and one of the factors affecting search ranking for fixed-price listings is the recent sales score.)

 Raising a listing's price may also affect the insertion fee (and therefore the overall listing fee).

 ReviseInventoryStatus requires either StartPrice or Quantity (or both) for each InventoryStatus node in the request. 

See:
    Insertion Fees
    eBay.com Listing Fees

 

Standard Output Fields   

Ack:用来标示是否成功执行。Applicable values: 

•   CustomCode

(out) Reserved for internal or future use.

•   Failure

(out) Request processing failed

•   Success

(out) Request processing succeeded

•   Warning

(out) Request processing completed with warning information being included in the response message

 

 

Build:ebay处理您的请求所使用的specific software ,以及这个软件的一些信息。

 

CorrelationID:如果您传递了一个MessageID,那么就会返回一个CorrelationID,这个值和传递的messageid值是相同的,这样就方便开发者获取对应对应的数据

 

Errors:应用级别的错误(A list of application-level errors )

Errors.ErrorClassification: api错误包含2块,系统错误和请求错误,

Errors其他的略去

 

HardExpirationWarning:用户的身份验证令牌的有效期。只是象征性的到期之前的7天之内返回。为了确保用户身份验证令牌是安全的,并有助于避免用户的令牌被攻破,令牌有一个有限的寿命。令牌是唯一有效的一段时间(由易趣设置)。在此之后的时间已经过去了,令牌过期,必须更换一个新的令牌。

 

Timestamp:ebay处理请求的时间,时区是: GMT ,格式为:(YYYY-MM-DDTHH:MM:SS.SSSZ). 

 

Version:版本

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个示例代码,可以批量修改 eBay Feed 中的库存信息: ```python import requests import xml.etree.ElementTree as ET # eBay API endpoint and credentials endpoint = 'https://api.ebay.com/ws/api.dll' dev_id = 'YOUR_DEV_ID' app_id = 'YOUR_APP_ID' cert_id = 'YOUR_CERT_ID' auth_token = 'YOUR_AUTH_TOKEN' site_id = '0' # US site ID # function to build eBay API request body def build_request_body(item_id, quantity): xml = '<?xml version="1.0" encoding="UTF-8"?>' xml += '<BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">' xml += '<Header><SiteID>{}</SiteID></Header>'.format(site_id) xml += '<Request><RequestID>1</RequestID>' xml += '<Item><ItemID>{}</ItemID>'.format(item_id) xml += '<Quantity>{}</Quantity></Item></Request>'.format(quantity) xml += '</BulkDataExchangeRequests>' return xml # function to make eBay API call def call_ebay_api(xml_request): headers = { 'X-EBAY-API-COMPATIBILITY-LEVEL': '967', 'X-EBAY-API-DEV-NAME': dev_id, 'X-EBAY-API-APP-NAME': app_id, 'X-EBAY-API-CERT-NAME': cert_id, 'X-EBAY-API-CALL-NAME': 'BulkDataExchange', 'X-EBAY-API-SITEID': site_id, 'X-EBAY-API-IAF-TOKEN': auth_token, 'Content-Type': 'text/xml' } response = requests.post(endpoint, headers=headers, data=xml_request) return response # example usage item_ids = ['ITEM_ID_1', 'ITEM_ID_2', 'ITEM_ID_3'] quantities = [10, 20, 30] for item_id, quantity in zip(item_ids, quantities): xml_request = build_request_body(item_id, quantity) response = call_ebay_api(xml_request) root = ET.fromstring(response.content) ack = root.find('.//{urn:ebay:apis:eBLBaseComponents}Ack').text if ack == 'Success': print('Successfully updated quantity for item {}'.format(item_id)) else: print('Failed to update quantity for item {}: {}'.format(item_id, response.content)) ``` 请注意,在使用此代码之前,您需要将代码中的 `YOUR_DEV_ID`、`YOUR_APP_ID`、`YOUR_CERT_ID` 和 `YOUR_AUTH_TOKEN` 替换为您自己的 eBay 开发者凭据。此外,您还需要将 `ITEM_ID_1`、`ITEM_ID_2` 和 `ITEM_ID_3` 替换为您要更新库存信息的 eBay 商品的实际 ID,以及 `10`、`20` 和 `30` 替换为相应的库存数量。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值