I used this guide, https://github.com/Shopify/shopify-api-js/tree/main/packages/shopify-api
My code:
const { shopifyApi, adminApiClient, LATEST_API_VERSION } = require(“@shopify/shopify-api”);
const shopify = shopifyApi({
apiKey: process.env.CLIENT_ID,
apiSecretKey: process.env.CLIENT_KEY,
scopes: [‘read_products’],
hostName: process.env.HOST_NAME
});
const order = new shopify.rest.Order({ session })
res.send(order)
I got this error:
TypeError: shopify.rest.Order is not a constructor