Shopify-api-node: Receiving error while trying to use SDK with Meteor

Hey,

When I try to call the sdk I get the error: “Exception while invoking method ‘shop.get.customers’ RequestError: Unexpected token < in JSON at position 0” Which I assume is due to an authentication error.

I used ShopToken to generate a code and then an access token.

I am initializing the SDK as such: ` const shopify = new Shopify({ shopName: {STORE_NAME}, apiKey: {API_KEY}, password: {ACCESS_TOKEN},

}); `

The store name is the name of the store I authenticated with the token and have the access token for.

The api key is the one in my shopify partners dashboard that shows the app has been installed and has the appropriate permissions.

The Access Token is the one I generated after making the code with the correct permissions

Any ideas what could be causing this?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25

Most upvoted comments

Had the same issue with shopify-api-node while using mailgun-js (which was last updated 2 years ago), moving over to an even more bloated package (mailgun.js) that is less maintained really wasn’t an option. After looking around a little bit I stumbled upon nodemailer and its well maintained mailgun-nodemailer-transport package. My Mailgun and shopify API integrations are now both up-to-date and fully working.