question

nimblshop_1 avatar image
0 Likes"
nimblshop_1 asked ·

How to use Trading API with JavaScript

I want to use the trading api to find the total quantity sold for an item's listing. If this is possible, what's the most efficient way to do this with JavaScript?
trading apijavascript
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
clickimusprime avatar image
0 Likes"
clickimusprime answered ·
It would be a really bad idea to use Trading with client side Javascript. There are credentials and tokens involved that if exposed could open up security issues. If you have to use Trading for some reason, write a server side script in PHP or whatever to do the call and return the result to Javascript and call it via AJAX. Quantity Sold is a public value that is available from the Shopping API GetSingleItem/GetMultipleItems calls. Use that instead.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.