const Clover = require("clover-ecomm-sdk"); export default async (req, res) => { const clover = new Clover(process.env.CLOVER_KEY, { environment: process.env.DEVELOPER_APP_UID, }); const payment = { currency: "usd", email: "sample@gmail.com", items: { amount: 1, currency: "usd", description: "Fireball 50ml", quantity: 1, tax_rates: { name: "Sale", rate: 1000000 }, }, }; var myJSON = JSON.stringify(payment); let order = await clover.orders.create(myJSON) };
I am using the Node SDK and trying to create an order. I am getting an error as follows:
CloverAuthenticationError at IncomingMessage.<anonymous> (C:\Users\tvang\Desktop\danneckersWebRedone\node_modules\clover-ecomm-sdk\lib\net\Resources.js:137:21) at Object.onceWrapper (events.js:297:20) at IncomingMessage.emit (events.js:214:15) at endReadableNT (_stream_readable.js:1178:12) at processTicksAndRejections (internal/process/task_queues.js:77:11) { raw: { type: '401 Unauthorized', message: undefined, headers: { 'cache-control': 'no-cache, no-store, must-revalidate', pragma: 'no-cache', expires: 'Tue, 17 Sep 1991 10:00:00 PST', 'content-length': '30', 'content-type': 'application/json; charset=utf-8', date: 'Mon, 14 Dec 2020 02:25:29 GMT', via: '1.1 google', 'alt-svc': 'clear' }, statusCode: 401, requestId: undefined }, rawType: '401 Unauthorized', code: undefined, param: undefined, detail: undefined, headers: { 'cache-control': 'no-cache, no-store, must-revalidate', pragma: 'no-cache', expires: 'Tue, 17 Sep 1991 10:00:00 PST', 'content-length': '30', 'content-type': 'application/json; charset=utf-8', date: 'Mon, 14 Dec 2020 02:25:29 GMT', via: '1.1 google', 'alt-svc': 'clear' }, requestId: undefined, statusCode: 401, message: undefined }
is this because my ACCESS_TOKEN and ENVIRONMENT are not correct?