Unable to update inventory using Walmart API

360 views
Skip to first unread message

Jaimin Vaghani

unread,
Apr 19, 2021, 4:38:07 PM4/19/21
to Google Apps Script Community
Hello,

I am successfully done with the authorization of Walmart API. after that I am trying to updating the inventory feed using their API. I make a call and API is responding 200(OK) responses with FEED ID.

I tried with POSTMAN, and it's working pretty well but having an issue with my code.
Here is my code.

var data = {
"file": "<InventoryFeed xmlns=\"http://walmart.com/\">\n    <InventoryHeader>\n        <version>1.4</version>\n    </InventoryHeader>\n    <inventory>\n        <sku>JW00726</sku>\n        <quantity>\n            <unit>EACH</unit>\n            <amount>25</amount>\n        </quantity>\n    </inventory>\n    <inventory>\n        <sku>JW00663</sku>\n        <quantity>\n            <unit>EACH</unit>\n            <amount>20</amount>\n        </quantity>\n    </inventory>\n</InventoryFeed>\n"
  };
  
  var options = {
    "method" : "POST",
    "headers": {
        "Authorization": "Basic "+Global_Auth,
        "WM_QOS.CORRELATION_ID": Global_CORRELATION_ID,
        "WM_SVC.NAME": Global_SVC_NAME,
        "WM_SEC.ACCESS_TOKEN":GetAccessToken(),
        "WM_CONSUMER.CHANNEL.TYPE": "#",
        "Accept": "application/json",
        "mimeType": "multipart/form-data",
        "Content-Type": "application/x-www-form-urlencoded"
      },
    "payload" : data,
    "muteHttpExceptions" : true
  };
  var response = UrlFetchApp.fetch(url, options);
  var res = JSON.parse(response.getContentText());


If you guy's already done with this, please your code for reference. or if you need any more information regarding this please let me know anytime. 

Thank You!
Jaimin

Tanaike

unread,
Apr 19, 2021, 10:31:59 PM4/19/21
to Google Apps Script Community
I noticed your this question just now. And, I noticed the same question at Stackoverflow. Is your this question the same with https://stackoverflow.com/q/67167279 ? If my understanding is correct, a while ago, I proposed an answer. Could you please confirm it?

Jaimin Vaghani

unread,
Apr 20, 2021, 12:31:39 AM4/20/21
to google-apps-sc...@googlegroups.com

Yes, same.
On Tue, 20 Apr 2021 at 8:02 AM, Tanaike <kanshi...@gmail.com> wrote:
I noticed your this question just now. And, I noticed the same question at Stackoverflow. Is your this question the same with https://stackoverflow.com/q/67167279 ? If my understanding is correct, a while ago, I proposed an answer. Could you please confirm it?

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/-B2db529Q7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a27454ac-054b-4429-9069-43e7060d4422n%40googlegroups.com.
--
Thanks& Regards;
Jaimin Vaghani
Q Save a Tree - Print only if really required.

Tanaike

unread,
Apr 20, 2021, 12:57:24 AM4/20/21
to Google Apps Script Community
Thank you for replying. When my proposed answer was not useful for your situation, I apologize.

Jaimin Vaghani

unread,
Apr 20, 2021, 3:21:43 AM4/20/21
to google-apps-sc...@googlegroups.com
No No, it's works for me. Thank you so much. 👐

On Tue, 20 Apr 2021 at 10:27 AM, Tanaike <kanshi...@gmail.com> wrote:
Thank you for replying. When my proposed answer was not useful for your situation, I apologize.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/-B2db529Q7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.

Tanaike

unread,
Apr 20, 2021, 3:36:12 AM4/20/21
to Google Apps Script Community
Thank you for replying. But, please add your comment to the thread of Stackoverflow and accept it. By this, your question will be useful for other users who have the same issue.

Reply all
Reply to author
Forward
0 new messages