Created
July 2, 2020 16:14
-
-
Save dmurawsky/8148176d5c0003d3391f9cbb3d6b311e to your computer and use it in GitHub Desktop.
Place an order for a printful item
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
const Axios = require('axios') | |
Axios({ | |
method: 'POST', | |
headers: { | |
Authorization: 'Basic thisisyourbase64authtoken', | |
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
}, | |
data: JSON.stringify({ | |
recipient: { | |
name: 'Jill Smith', | |
address1: '123 Main Street', | |
city: 'Happyton', | |
state_code: 'FL', | |
country_code: 'US', | |
zip: '12345', | |
}, | |
items: [{ variant_id: 6882, quantity: 1, files: [{ url: 'https://lowdowntext.com/fullPage-print.pdf' }] }], | |
}), | |
url: 'https://api.printful.com/orders?confirm=1', | |
}).then(console.log) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment