首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails Peddler gem:使用Amazon MWS Feeds将产品添加到Amazon卖方中心商店

Rails Peddler gem:使用Amazon MWS Feeds将产品添加到Amazon卖方中心商店
EN

Stack Overflow用户
提问于 2017-05-17 16:48:39
回答 1查看 820关注 0票数 0

我正在尝试添加一个产品到亚马逊卖家帐户使用亚马逊mws饲料api。我使用的是Ruby on Rails和peddler gem。但是我找不到任何关于如何添加新产品的文档/示例。有一个用于提交提要的函数(link)。但是我不确定如何发送'feed_content‘参数。有没有这样做的例子?我能够建立连接:

代码语言:javascript
复制
  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'
)

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

EN

回答 1

Stack Overflow用户

发布于 2017-05-18 09:00:42

FeedContent是提要本身的实际内容。您还需要一个FeedType。请查看MWS Feeds API overview以了解该过程。无论您使用哪种语言或平台,过程都是相同的。

请求将如下所示:

代码语言:javascript
复制
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

包含您要添加的产品的主体如下所示:

代码语言:javascript
复制
<?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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44019905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档