spencerlepine / printify-sdk-js

Printify SDK for Node.js / TypeScript. A wrapper for the Printify REST API (v1)
https://github.com/spencerlepine/printify-sdk-js/blob/main/docs/API.md
MIT License
2 stars 0 forks source link

[documentation] update sample code #7

Closed spencerlepine closed 2 months ago

spencerlepine commented 2 months ago
  1. Update sample code:
    
    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); } })();

spencerlepine commented 2 months ago

Updated in https://github.com/spencerlepine/printify-sdk-js/commit/ba03c0e67a4147a88013d0e6ca06dd5a293bd645