Closed spencerlepine closed 2 months ago
import Printify from 'printify-sdk-js'; // const Printify = require('printify-sdk-js'); // CommonJS
const printify = new Printify({ shopId: '123456', // global query by shop_id accessToken: process.env.API_TOKEN, });
(async () => { const data = {/ ... /}; try { const result = await printify.orders.submit(data); console.log(result); // { "id": "5a96f649b2439217d070f507" } } catch (error) { console.error('Error submitting order:', error); } })();
Updated in https://github.com/spencerlepine/printify-sdk-js/commit/ba03c0e67a4147a88013d0e6ca06dd5a293bd645
const printify = new Printify({ shopId: '123456', // global query by shop_id accessToken: process.env.API_TOKEN, });
(async () => { const data = {/ ... /}; try { const result = await printify.orders.submit(data); console.log(result); // { "id": "5a96f649b2439217d070f507" } } catch (error) { console.error('Error submitting order:', error); } })();