XML 提交给亚马逊 MWS 很好,但价格未更新
XML submitted just fine to Amazon MWS but price not being updated
我创建了自己的重新定价器,但亚马逊方面没有更新价格。
根据提交后亚马逊的回复,我的代码似乎工作正常。我希望这里有人知道为什么它实际上没有更新价格。
这是 XML 提交的:
<?xml version="1.0" encoding="utf-8" ?>
<AmazonEnvelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>MERCHANTID</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<Price>
<SKU>mysku</SKU>
<StandardPrice currency="USD">350.50</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>
这是回复:
GetFeedSubmissionResultResponse{}(ResponseMetadata: <Element_?/ResponseMetadata_0x7fee61f74248>, GetFeedSubmissionResultResult: <Element_?/GetFeedSubmissionResultResult_0x7fee61f74248>, AmazonEnvelope:
{'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation': 'amzn-envelope.xsd'}, DocumentVersion: '1.02', MerchantIdentifier: 'M_EXAMPLE_1234', Header: '\n\t', MessageType: 'ProcessingReport', MessageID: '1', DocumentTransactionID: '4200000000', StatusCode: 'Complete', MessagesProcessed: '1', MessagesSuccessful: '1', MessagesWithError: '0', MessagesWithWarning: '0', ProcessingSummary: '\n\t\t\t', ProcessingReport: '\n\t\t', Message: '\n\t')
我不知道在这种情况下显示我的代码是否有帮助,因为我从亚马逊得到了成功的回应。这里不管了:
...
# Provide credentials.
conn = MWSConnection(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
Merchant=AMZ_SELLER_ID
)
# Get the service resource
sqs = boto3.resource('sqs')
# Get the queue
queue = sqs.get_queue_by_name(QueueName=SQS_QUEUE_NAME)
for index, message in enumerate(queue.receive_messages(MaxNumberOfMessages=10)):
...
import time
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('repricer', 'xml_templates'), trim_blocks=True, lstrip_blocks=True)
template = env.get_template('_POST_PRODUCT_PRICING_DATA_.xml')
class Message(object):
def __init__(self, s, price):
self.SKU = s
self.PRICE = round(price, 2)
self.CURRENCY = USD_CURRENCY
feed_messages = [
Message(sku.sku, new_price),
]
namespace = dict(MerchantId=AMZ_SELLER_ID, FeedMessages=feed_messages)
feed_content = template.render(namespace).encode('utf-8')
print(feed_content)
feed = conn.submit_feed(
FeedType='_POST_PRODUCT_PRICING_DATA_',
PurgeAndReplace=False,
MarketplaceIdList=[MARKETPLACE_ID],
content_type='text/xml',
FeedContent=feed_content
)
feed_info = feed.SubmitFeedResult.FeedSubmissionInfo
print('Submitted product feed: ' + str(feed_info))
while True:
submission_list = conn.get_feed_submission_list(
FeedSubmissionIdList=[feed_info.FeedSubmissionId]
)
info = submission_list.GetFeedSubmissionListResult.FeedSubmissionInfo[0]
submission_id = info.FeedSubmissionId
status = info.FeedProcessingStatus
print('Submission Id: {}. Current status: {}'.format(submission_id, status))
if status in ('_SUBMITTED_', '_IN_PROGRESS_', '_UNCONFIRMED_'):
print('Sleeping and check again....')
time.sleep(60)
elif status == '_DONE_':
feedResult = conn.get_feed_submission_result(FeedSubmissionId=submission_id)
print(feedResult)
break
else:
print("Submission processing error. Quit.")
break
我不知道 Python,但你的 XML 看起来不错,这是我的 PHP 代码,过去 5 年我用它来进行价格变动,它工作正常。我不知道这是否对您有帮助,因为它是 PHP。
$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>$merchant_token</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<Price>
<SKU>$sku</SKU>
<StandardPrice currency="$currency">$new_price</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>
EOD;
$feed = trim($feed);
$feedHandle = @fopen('php://temp', 'rw+');
fwrite($feedHandle, $feed);
rewind($feedHandle);
$parameters = array(
'Merchant' => $MERCHANT_ID,
'MarketplaceIdList' => $marketplaceIdArray,
'FeedType' => '_POST_PRODUCT_PRICING_DATA_',
'FeedContent' => $feedHandle,
'PurgeAndReplace' => false, //Leave this PurgeAndReplace to false so that it want replace whole product in amazon inventory
'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true))
);
rewind($feedHandle);
$request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
$return_feed = invokeSubmitFeed($service, $request, $price_change_info_log);
fclose($feedHandle);
有几个可能的原因,大致按照可能性的顺序列出:
1. 亚马逊更新值的速度比他们说的要慢。有可能虽然 Feed 是成功的,但在该更改反映在亚马逊上之前仍有一段时间(即使来自 SellerCentral 的更改值也会附带一条消息,表明它不是即时的)。
等待几分钟,看看最终是否会出现更改。
2. 您可以让替代重新定价服务仍然有效。如果您当前为此 SKU 使用另一个重新定价器,它可能会与您的尝试竞争并根据其自己的规则集恢复价格。
可以使用 GetFeedSubmissionList 调用来查看是否在您之后提交了另一个 _POST_PRODUCT_PRICING_DATA_
供稿(尽管无法查看提交的内容)。
3. min 和 max 价格可能有冲突SKU(无论您是否设置),并且您尝试设置的价格超出了允许的范围。这是亚马逊的一项政策要求新的和更新的 SKU 设置这些政策或使用默认标准的结果。
In our continued effort to reduce price error risks to sellers and to avoid potentially negative customer experiences, starting on January 14, 2015, you will not be able to use your Seller Central preferences to select a blanket “opt-out” from all potential low- and high-pricing error rules. Instead, you will need to set a minimum and maximum allowed selling price for each product in your inventory if you do not want Amazon’s default potential pricing error rules to apply to that product.
我找不到关于此的公告页面,所以它可能是一封电子邮件,但在 forums
在这些情况下,Feed 会报告成功(因为它的 references/format 是正确的),但由于设置的价格范围限制,价格更改将悄无声息地失败。
您可以通过查看 SellerCentral 管理库存页面下的 SKU 来验证这是否是您的问题。根据您为该页面设置的首选项,您可能必须打开 min/max 列才能查看当前值。
遗憾的是,没有办法提取 min/max 库存商品的价格以提前知道这是否会成为问题:
Dear Seller,
I am Sharon from Amazon Seller Support and I will be assisting you with your concern today.
From the content of your email, I understand that you are concerned if there's any report where you can download the report for 'Minimum Price' and 'Maximum Price'.
I regret to inform you that as of now the reports which are available will only provide information for 'standard_price' and 'list_price'.
I understand that this is a disappointment for you but please understand that as of not this feature of including 'Minimum Price' and 'Maximum Price' in the inventory reports has not been included and I sincerely apologize for all the inconvenience caused to you in this regard.
通过给亚马逊 MWS 团队的支持票,2016 年 7 月 3 日
4. 亚马逊可能不允许 Feed 在活动促销期间更新价格。您应该能够通过查看 SellerCentral Manage Inventory 页面来检查商品是否正在销售,其中 "price" 列将以绿色边框显示。
似乎不太可能,因为他们要求 "StandardPrice" 元素与 "Sale" 元素一起提供,但亚马逊自己的 "Automate Pricing" 工具将其列为 possible reason 工具失败。
5. 您将价格更新应用于错误的商城。
如果在 MarketplaceIdList=[MARKETPLACE_ID],
下提供给通话的 ID 与您正在检查的市场不同,您将看不到价格变化。
如果您提交到一个您无权访问的市场,亚马逊确实会失败 Feed 提交请求,因此如果您只有一个市场,这可能不是问题。
6.您在错误的地方寻找新价格。
如果您在 SellerCentral Manage Inventory 页面下查看,请确保您查看的是 "Price" 列而不是 "Lowest Price" 列。
如果您正在查看产品的详细信息或报价页面(在亚马逊店面),请确保您正在查看您的报价。您可能不是详情页面显示的主要报价或报价列表页面显示的顶级报价。
当然,请确保您拥有正确的 SKU/ASIN。
7. 这是针对不同的提要,但是 user has reported 亚马逊有时不更新信息,需要重新发送提要。
您可以尝试使用替代提要来更新价格信息 _POST_FLAT_FILE_INVLOADER_DATA_
,但它是平面文件类型(制表符分隔),因此您的 XML 架构不会传输过来。可能只有当您认为问题与您使用的特定提要有关时才值得尝试。
我最终联系了亚马逊 api 支持,他们发现价格更改最多需要 15 分钟。我还有另一个脚本可以上传新产品并更新现有产品的库存和价格...这个脚本与我的重新定价脚本竞争。
我通过更改第二个脚本更新现有产品价格的方式解决了这个问题。
我创建了自己的重新定价器,但亚马逊方面没有更新价格。
根据提交后亚马逊的回复,我的代码似乎工作正常。我希望这里有人知道为什么它实际上没有更新价格。
这是 XML 提交的:
<?xml version="1.0" encoding="utf-8" ?>
<AmazonEnvelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>MERCHANTID</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<Price>
<SKU>mysku</SKU>
<StandardPrice currency="USD">350.50</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>
这是回复:
GetFeedSubmissionResultResponse{}(ResponseMetadata: <Element_?/ResponseMetadata_0x7fee61f74248>, GetFeedSubmissionResultResult: <Element_?/GetFeedSubmissionResultResult_0x7fee61f74248>, AmazonEnvelope:
{'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation': 'amzn-envelope.xsd'}, DocumentVersion: '1.02', MerchantIdentifier: 'M_EXAMPLE_1234', Header: '\n\t', MessageType: 'ProcessingReport', MessageID: '1', DocumentTransactionID: '4200000000', StatusCode: 'Complete', MessagesProcessed: '1', MessagesSuccessful: '1', MessagesWithError: '0', MessagesWithWarning: '0', ProcessingSummary: '\n\t\t\t', ProcessingReport: '\n\t\t', Message: '\n\t')
我不知道在这种情况下显示我的代码是否有帮助,因为我从亚马逊得到了成功的回应。这里不管了:
...
# Provide credentials.
conn = MWSConnection(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
Merchant=AMZ_SELLER_ID
)
# Get the service resource
sqs = boto3.resource('sqs')
# Get the queue
queue = sqs.get_queue_by_name(QueueName=SQS_QUEUE_NAME)
for index, message in enumerate(queue.receive_messages(MaxNumberOfMessages=10)):
...
import time
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('repricer', 'xml_templates'), trim_blocks=True, lstrip_blocks=True)
template = env.get_template('_POST_PRODUCT_PRICING_DATA_.xml')
class Message(object):
def __init__(self, s, price):
self.SKU = s
self.PRICE = round(price, 2)
self.CURRENCY = USD_CURRENCY
feed_messages = [
Message(sku.sku, new_price),
]
namespace = dict(MerchantId=AMZ_SELLER_ID, FeedMessages=feed_messages)
feed_content = template.render(namespace).encode('utf-8')
print(feed_content)
feed = conn.submit_feed(
FeedType='_POST_PRODUCT_PRICING_DATA_',
PurgeAndReplace=False,
MarketplaceIdList=[MARKETPLACE_ID],
content_type='text/xml',
FeedContent=feed_content
)
feed_info = feed.SubmitFeedResult.FeedSubmissionInfo
print('Submitted product feed: ' + str(feed_info))
while True:
submission_list = conn.get_feed_submission_list(
FeedSubmissionIdList=[feed_info.FeedSubmissionId]
)
info = submission_list.GetFeedSubmissionListResult.FeedSubmissionInfo[0]
submission_id = info.FeedSubmissionId
status = info.FeedProcessingStatus
print('Submission Id: {}. Current status: {}'.format(submission_id, status))
if status in ('_SUBMITTED_', '_IN_PROGRESS_', '_UNCONFIRMED_'):
print('Sleeping and check again....')
time.sleep(60)
elif status == '_DONE_':
feedResult = conn.get_feed_submission_result(FeedSubmissionId=submission_id)
print(feedResult)
break
else:
print("Submission processing error. Quit.")
break
我不知道 Python,但你的 XML 看起来不错,这是我的 PHP 代码,过去 5 年我用它来进行价格变动,它工作正常。我不知道这是否对您有帮助,因为它是 PHP。
$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>$merchant_token</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<Price>
<SKU>$sku</SKU>
<StandardPrice currency="$currency">$new_price</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>
EOD;
$feed = trim($feed);
$feedHandle = @fopen('php://temp', 'rw+');
fwrite($feedHandle, $feed);
rewind($feedHandle);
$parameters = array(
'Merchant' => $MERCHANT_ID,
'MarketplaceIdList' => $marketplaceIdArray,
'FeedType' => '_POST_PRODUCT_PRICING_DATA_',
'FeedContent' => $feedHandle,
'PurgeAndReplace' => false, //Leave this PurgeAndReplace to false so that it want replace whole product in amazon inventory
'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true))
);
rewind($feedHandle);
$request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
$return_feed = invokeSubmitFeed($service, $request, $price_change_info_log);
fclose($feedHandle);
有几个可能的原因,大致按照可能性的顺序列出:
1. 亚马逊更新值的速度比他们说的要慢。有可能虽然 Feed 是成功的,但在该更改反映在亚马逊上之前仍有一段时间(即使来自 SellerCentral 的更改值也会附带一条消息,表明它不是即时的)。
等待几分钟,看看最终是否会出现更改。
2. 您可以让替代重新定价服务仍然有效。如果您当前为此 SKU 使用另一个重新定价器,它可能会与您的尝试竞争并根据其自己的规则集恢复价格。
可以使用 GetFeedSubmissionList 调用来查看是否在您之后提交了另一个 _POST_PRODUCT_PRICING_DATA_
供稿(尽管无法查看提交的内容)。
3. min 和 max 价格可能有冲突SKU(无论您是否设置),并且您尝试设置的价格超出了允许的范围。这是亚马逊的一项政策要求新的和更新的 SKU 设置这些政策或使用默认标准的结果。
In our continued effort to reduce price error risks to sellers and to avoid potentially negative customer experiences, starting on January 14, 2015, you will not be able to use your Seller Central preferences to select a blanket “opt-out” from all potential low- and high-pricing error rules. Instead, you will need to set a minimum and maximum allowed selling price for each product in your inventory if you do not want Amazon’s default potential pricing error rules to apply to that product.
我找不到关于此的公告页面,所以它可能是一封电子邮件,但在 forums
在这些情况下,Feed 会报告成功(因为它的 references/format 是正确的),但由于设置的价格范围限制,价格更改将悄无声息地失败。
您可以通过查看 SellerCentral 管理库存页面下的 SKU 来验证这是否是您的问题。根据您为该页面设置的首选项,您可能必须打开 min/max 列才能查看当前值。
遗憾的是,没有办法提取 min/max 库存商品的价格以提前知道这是否会成为问题:
Dear Seller,
I am Sharon from Amazon Seller Support and I will be assisting you with your concern today.
From the content of your email, I understand that you are concerned if there's any report where you can download the report for 'Minimum Price' and 'Maximum Price'.
I regret to inform you that as of now the reports which are available will only provide information for 'standard_price' and 'list_price'.
I understand that this is a disappointment for you but please understand that as of not this feature of including 'Minimum Price' and 'Maximum Price' in the inventory reports has not been included and I sincerely apologize for all the inconvenience caused to you in this regard.
通过给亚马逊 MWS 团队的支持票,2016 年 7 月 3 日
4. 亚马逊可能不允许 Feed 在活动促销期间更新价格。您应该能够通过查看 SellerCentral Manage Inventory 页面来检查商品是否正在销售,其中 "price" 列将以绿色边框显示。
似乎不太可能,因为他们要求 "StandardPrice" 元素与 "Sale" 元素一起提供,但亚马逊自己的 "Automate Pricing" 工具将其列为 possible reason 工具失败。
5. 您将价格更新应用于错误的商城。
如果在 MarketplaceIdList=[MARKETPLACE_ID],
下提供给通话的 ID 与您正在检查的市场不同,您将看不到价格变化。
如果您提交到一个您无权访问的市场,亚马逊确实会失败 Feed 提交请求,因此如果您只有一个市场,这可能不是问题。
6.您在错误的地方寻找新价格。
如果您在 SellerCentral Manage Inventory 页面下查看,请确保您查看的是 "Price" 列而不是 "Lowest Price" 列。
如果您正在查看产品的详细信息或报价页面(在亚马逊店面),请确保您正在查看您的报价。您可能不是详情页面显示的主要报价或报价列表页面显示的顶级报价。
当然,请确保您拥有正确的 SKU/ASIN。
7. 这是针对不同的提要,但是 user has reported 亚马逊有时不更新信息,需要重新发送提要。
您可以尝试使用替代提要来更新价格信息 _POST_FLAT_FILE_INVLOADER_DATA_
,但它是平面文件类型(制表符分隔),因此您的 XML 架构不会传输过来。可能只有当您认为问题与您使用的特定提要有关时才值得尝试。
我最终联系了亚马逊 api 支持,他们发现价格更改最多需要 15 分钟。我还有另一个脚本可以上传新产品并更新现有产品的库存和价格...这个脚本与我的重新定价脚本竞争。
我通过更改第二个脚本更新现有产品价格的方式解决了这个问题。