-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: cleanup README and update documentation
- Loading branch information
1 parent
afeb530
commit d079c13
Showing
61 changed files
with
250 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Printify SDK Examples | ||
|
||
## Usage | ||
|
||
```sh | ||
$ npm install | ||
$ npm start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const Printify = require('printify-sdk-js'); | ||
|
||
const printify = new Printify({ | ||
shopId: '123456', | ||
accessToken: 'asdf0123asdf0123asdf0123', | ||
enableLogging: true, | ||
}); | ||
|
||
printify.orders | ||
.list({ limit: 5, status: 'fulfilled' }) | ||
.then(orders => console.log(orders)) | ||
.catch(error => console.error(error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "printify-node-examples", | ||
"type": "module", | ||
"scripts": { | ||
"start": "node app.js" | ||
}, | ||
"dependencies": { | ||
"printify-sdk-js": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Printify from 'printify-sdk-js'; | ||
|
||
const printify = new Printify({ | ||
shopId: '123456', | ||
accessToken: 'asdfasdf', | ||
enableLogging: true, | ||
}); | ||
|
||
const orderData = { | ||
external_id: 'unique_external_id', | ||
label: 'Order Label', | ||
line_items: [ | ||
{ | ||
print_provider_id: 12345, | ||
blueprint_id: 67890, | ||
variant_id: 112233, | ||
print_areas: { | ||
front: 'https://example.com/path/to/sticker.png', | ||
}, | ||
quantity: 1, | ||
}, | ||
// ... | ||
], | ||
shipping_method: 1, | ||
is_printify_express: true, | ||
is_economy_shipping: false, | ||
send_shipping_notification: true, | ||
address_to: { | ||
first_name: 'string', | ||
last_name: 'string', | ||
email: 'string', | ||
phone: 'string', | ||
region: 'NY', | ||
address1: '123 Main Street', | ||
address2: '', | ||
city: 'New York', | ||
zip: '10001', | ||
country: 'US', | ||
}, | ||
}; | ||
|
||
(async () => { | ||
const result = await printify.orders.submit(orderData); | ||
console.log(result); // { "id": "5a96f649b2439217d070f507" } | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "printify-node-examples", | ||
"scripts": { | ||
"start": "node app.js" | ||
}, | ||
"dependencies": { | ||
"printify-sdk-js": "*" | ||
} | ||
} |
Oops, something went wrong.