lionheart / bottlenose

A Python wrapper for the Amazon Product Advertising API.
Apache License 2.0
577 stars 112 forks source link

CartCreate : Required parameters include Items #70

Open smurf-U opened 6 years ago

smurf-U commented 6 years ago

While Create New Cart:- Get Your request is missing required parameters. Required parameters include Items.

data = {
            'offer_id': "59PwDdXajXbVuCLg6kd7QZDCA2hWxjO%2FXqhLLQcJDzOe4mAm%2FIaKuy94kleD682oMmHsvFlXmM5guvCSnCTfaQuqU9PN%2Fq4%2Fwmm73RqOuFV9FePGy8fq4g%3D%3D",
            'quantity': 2
}
response = amazon.CartCreate(items=data)

Get Response as below:-

<?xml version="1.0" encoding="UTF-8"?>
<CartCreateResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2013-08-01">
   <OperationRequest>
      <HTTPHeaders>
         <Header Name="UserAgent" Value="Python-urllib/2.7" />
      </HTTPHeaders>
      <RequestId>0f8f191a-f546-4d2b-9eb4-297f575920c1</RequestId>
      <Arguments>
         <Argument Name="AWSAccessKeyId" Value="AKIAJTJOIACOYJSJC5EA" />
         <Argument Name="AssociateTag" Value="caupd4125k-21" />
         <Argument Name="Operation" Value="CartCreate" />
         <Argument Name="Service" Value="AWSECommerceService" />
         <Argument Name="Timestamp" Value="2018-04-24T10:59:39Z" />
         <Argument Name="Version" Value="2013-08-01" />
         <Argument Name="items" Value="{'offer_id': u'59PwDdXajXbVuCLg6kd7QZDCA2hWxjO%2FXqhLLQcJDzOe4mAm%2FIaKuy94kleD682oMmHsvFlXmM5guvCSnCTfaQuqU9PN%2Fq4%2Fwmm73RqOuFV9FePGy8fq4g%3D%3D', 'quantity': u'1'}" />
         <Argument Name="Signature" Value="g9PToXIDjSrnV5CQgaEsj5I1zpiAYg8cgu/I1lxIh1A=" />
      </Arguments>
      <RequestProcessingTime>1.26464E-4</RequestProcessingTime>
   </OperationRequest>
   <Cart>
      <Request>
         <IsValid>False</IsValid>
         <CartCreateRequest>
            <Items />
         </CartCreateRequest>
         <Errors>
            <Error>
               <Code>AWS.MissingParameters</Code>
               <Message>Your request is missing required parameters. Required parameters include Items.</Message>
            </Error>
         </Errors>
      </Request>
   </Cart>
</CartCreateResponse>

As AWS documentation image

https://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartCreate.html#CartCreate-rp