Skip to main content

To update inventory quantity of multiple items on Amazon Seller Central

Comments

8 comments

  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Anju Babu that looks right. Is it working when you run the flow and it's maybe only in preview where it's showing 1 item? Here is the setup I've got:

    <?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>
        </Header>
        <MessageType>Inventory</MessageType>
        {{#each data}}
            <Message>
                <MessageID>{{{add @index 1}}}</MessageID>
                <OperationType>PartialUpdate</OperationType>
                <Inventory>
                    <SKU>{{SKU}}</SKU>
                    <FulfillmentCenterID>{{FulfillmentCenterID}}</FulfillmentCenterID>
                        <Quantity>{{Quantity}}</Quantity>
                        <Available>{{Available}}</Available>
                        <Lookup>{{Lookup}}</Lookup>
                    <RestockDate>{{RestockDate}}</RestockDate>
                    <FulfillmentLatency>{{FulfillmentLatency}}</FulfillmentLatency>
                    <SwitchFulfillmentTo>{{SwitchFulfillmentTo}}</SwitchFulfillmentTo>
                </Inventory>
            </Message>
        {{/each}}
    </AmazonEnvelope>
    0
  • Anju Babu
    Engaged

    While running the flow it shows a success status of 2 ( In the saved search there are 2 items ).

    But when checking on Amazon's side there is no updation for these 2 items.

    I am also providing the same HTTP request body you have provided.

    The only difference is that in our code we are not giving Restock Date, Fulfillment Latency, and SwitchFulfillmentTo. Other details are given in the above format.

     

    But my updation of a single item was successful, in that flow I fetched data from the saved search in the  NetSuite. During that time there was only 1 item in that search.

    Now I had edited the search and included 2 items in that and made a small change in HTTP request body, because now need to fetch 2 items and I included a loop (#each data). But in this case after running the flow there is no error but no updation is happening.

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Anju Babu do you have an async helper set to get the results back from Amazon?

    Can you download the feed results directly within Amazon's portal? Does it show 2 items sent? What are the statuses on them?

     

    What page size do you have your export from NetSuite set as? 

    0
  • Anju Babu
    Engaged

    No, I do not have an async helper.

    We cant download the feed results directly from Amazon Seller Central

    page size is like 1 page ( which includes 3 records)

     The data we received on the Export side is:

    {
      "page_of_records": [
        {
          "record": {
            "id": "7448",
            "recordType": "lotnumberedinventoryitem",
            "Stock Description": "NA305P",
            "Qty available": "197",
            "Name": "OA : NA305P",
            "dataURI": "https://1312745.app.netsuite.com/app/common/item/item.nl?id=7448&compid=1312745"
          }
        },
        {
          "record": {
            "id": "13828",
            "recordType": "lotnumberedinventoryitem",
            "Stock Description": "P5CAMO",
            "Qty available": "13",
            "Name": "OA : P5CAMO",
            "dataURI": "https://1312745.app.netsuite.com/app/common/item/item.nl?id=13828&compid=1312745"
          }
        },
        {
          "record": {
            "id": "7077",
            "recordType": "lotnumberedinventoryitem",
            "Stock Description": "SHSTRAP3",
            "Qty available": "142",
            "Name": "OA : SHSTRAP3",
            "dataURI": "https://1312745.app.netsuite.com/app/common/item/item.nl?id=7077&compid=1312745"
          }
        }
      ]
    }

     

    But when we reach the mapping side the input preview is showing like this 

    {
      "id": "7395",
      "recordType": "lotnumberedinventoryitem",
      "Stock Description": "CU200",
      "Qty available": "109",
      "Name": "CB : CU200",
      "dataURI": "https://1312745.app.netsuite.com/app/common/item/item.nl?id=7395&compid=1312745",
      "stockDescription1": "CU200",
      "quantityAvailable2": null
    } only one data is reaching here 

    And I provided a mapping

    But the output preview is repeating the same item details like

    {
      "MerchantIdentifier": "xxxxxx",
      "FulfillmentCenterID": "xxxxxxxx",
      "data": [
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        },
        {
          "SKU": "CU200",
          "Quantity": "109"
        }
      ]
    }

     

    What is the reason for this?

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Anju Babu it looks like you are confusing a record vs a page of records. When using mapper 2.0, your input is a single record. So what you're trying to do by making header values and and a data array don't make sense in this context. I bet if you were to go into the POST XML body, you would see something like {data[{data[]}]} because you're creating an additional nested data array for a single record. I would recommend you just remove the mapper settings and go directly to the POST XML body and modify your handlebars to reference the correct field names. If you leave mapper 2.0, you can use it to basically just rename the fields there and then use the same xml body you already have.

    0
  • Anju Babu
    Engaged

    Without providing Mapper 2.0 I have run the flow. But still, the updation on Amazon Seller Central is not happening.

    Here we provided an HTTP request body only, in that we are taking the data from the NetSuite through item search directly.

    While taking the preview of this HTTP request body output, the value is getting correctly as shown as

    <MerchantIdentifier>xxxxxxxx</MerchantIdentifier>
    <FulfillmentCenterID>xxxxxxxxxxx</FulfillmentCenterID>
    </Header>
    <MessageType>Inventory</MessageType>
    <Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <Inventory>
    <SKU>M5</SKU>
    <Quantity>108</Quantity>
    </Inventory>
    </Message>
    </AmazonEnvelope>

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Anju Babu you may want to attend office hours next week. Something must be setup wrong and it's tough to keep going back and forth here. Here is the link to sign up https://docs.celigo.com/hc/en-us/articles/360045798291

    0
  • Balasubramanian Mahadevan Community manager Senior Technical Writer
    Engaged
    Celigo University Level 2: Seasoned

    Anju Babu Hope you have attended office hours and your issue has been resolved. It would be great if you could share the resolution for your issue as it may be helpful for others who may face similar issues.

    0

Please sign in to leave a comment.