Rails Peddler gem: 使用亚马逊 MWS Feeds API 将商品添加到亚马逊卖家中央商城



我正在尝试使用亚马逊 mws feed API 将商品添加到亚马逊卖家账户。我正在使用Ruby on Rails和小贩宝石。但是我找不到有关如何添加新产品的任何文档/示例。有一个提交提要的功能(链接)。但我不确定如何发送"feed_content"参数。有没有怎么做的例子?我能够建立连接:

client = MWS::Feeds::Client.new(
marketplace_id:        'marketplace_id',
merchant_id:           'merchant_id',
auth_token:            'auth_token',
aws_access_key_id:     'aws_access_key_id',
aws_secret_access_key: 'aws_secret_access_key'
)

请分享有关如何添加产品的任何示例或任何建议。提前谢谢。

FeedContent 是 Feed 本身的实际内容,无论是 XML 还是平面文件。 您还需要一个源类型。 查看 MWS 源 API 概述,了解该过程。 无论您使用哪种语言或平台,过程都是相同的。

请求将如下所示:

POST /Feeds/2009-01-01 HTTP/1.1
Content-Type: x-www-form-urlencoded
Host: mws.amazonservices.com
User-Agent: <Your User Agent Header>
?AWSAccessKeyId=0PB842ExampleN4ZTR2
&Action=SubmitFeed
&FeedType=_POST_PRODUCT_DATA_
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&MarketplaceIdList.Id.1=ATVExampleDER
&SellerId=A1XExample5E6
&ContentMD5Value=ExampleMd5HashOfHttpBodyAsPerRfc2616Example
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-01-26T23%3A51%3A31.315Z
&Version=2009-01-01
&Signature=SvSExamplefZpSignaturex2cs%3D

包含您要添加的产品的正文如下所示:

<?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_EXAMPLE_123456</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>56789</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B0EXAMPLEG</Value>
</StandardProductID>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<DescriptionData>
<Title>Example Product Title</Title>
<Brand>Example Product Brand</Brand>
<Description>This is an example product description.</Description>
<BulletPoint>Example Bullet Point 1</BulletPoint>
<BulletPoint>Example Bullet Point 2</BulletPoint>
<MSRP currency="USD">25.19</MSRP>
<Manufacturer>Example Product Manufacturer</Manufacturer>
<ItemType>example-item-type</ItemType>
</DescriptionData>
<ProductData>
<Health>
<ProductType>
<HealthMisc>
<Ingredients>Example Ingredients</Ingredients>
<Directions>Example Directions</Directions>
</HealthMisc>
</ProductType>
</Health>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>

相关内容

最新更新