Hi everyone, I am integrating amazon seller centra...
# integrations
k
Hi everyone, I am integrating amazon seller central with our Netsuite using our own proprietary system. I am having trouble setting up the Auth for fetching data from Amazon, would like to know if anyone that have experience in this to can help guide me
e
The key is generating the AWS signature. I used Google's CryptoJS code. You also need to make sure to generate the canonical request.
function getAWSSignatureKey(key, dateStamp, regionName, serviceName) { var kDate = CryptoJS.HmacSHA256(dateStamp, "AWS4" + key); var kRegion = CryptoJS.HmacSHA256(regionName, kDate); var kService = CryptoJS.HmacSHA256(serviceName, kRegion); var kSigning = CryptoJS.HmacSHA256("aws4_request", kService); return kSigning; }
k
Hi Eric B, i'm sorry is this for Amazon seller partner API?
e
Yes it works for both SP-API and Vendor Central.
k
👍 I currently have refresh token, client id, and client secret How can I use that function?
e
That's the easy part...refresh token with the client id and client secret just gets you an access token
you have to construct the request headers using the access token and part of that is knowing how to construct the canonical request to use for generating the aws signature