Printify API
Printify's REST API allows your application to manage a Printify shop on behalf of a Printify Merchant. Create products, submit orders, and more...
API Usage Guidelines
If you don't know Node.js
How To Build a Blog with Nest.js, MongoDB, and Vue.js
Machine Learning In Node.js With TensorFlow.js
Install
npm i printify-api --save
Example
var Printify = ; var API = shop_id: 123456 // global query by shop_id, if not set you must set each function access_token:'xxxxxxxxxxxxxxxxxxxxxxxxxx';
// Retrieve a list of all products APIProduct; // support async var result = await APIProduct; // or custom shop_id var result = await APIProduct;
// Retrieve a productvar result = await APIProduct; // or custom shop_idvar result = await APIProduct;
// Create a new product var data = "title": "Product" "description": "Good product" "blueprint_id": 384 "print_provider_id": 1 "variants": "id": 45740 "price": 400 "id": 45742 "price": 400 "id": 45744 "price": 400 "id": 45746 "price": 400 "print_areas": "variant_ids": 45740457424574445746 "placeholders": "position": "front" "images": "id": "5d15ca551163cde90d7b2203" "x": 05 "y": 05 "scale": 1 "angle": 0 ; var result = APIProduct; // or var result = APIProduct;
// Update a product var data = id: 1234 title:'Product 1' ; var result = await APIProduct; // or var result = await APIProduct;
// Delete a product var result = await APIProduct;
// Publish a productvar result = await APIProduct; // Notify that a product was successfully publishedvar result = await APIProduct; // Notify that a product publishing has failedvar result = await APIProduct;
// Retrieve a list of ordersvar result = await APIOrder; // or custom shop_idvar result = await APIOrder;
// Get order details by idvar result = await APIOrder; // or custom shop_idvar result = await APIOrder;
// Submit an order var data = "external_id": "2750e210-39bb-11e9-a503-452618153e4a" "line_items": "product_id": "5bfd0b66a342bcc9b5563216" "variant_id": 17887 "quantity": 1 "shipping_method": 1 "send_shipping_notification": false "address_to": "first_name": "John" "last_name": "Smith" "email": "example@msn.com" "phone": "0574 69 21 90" "country": "BE" "region": "" "address1": "ExampleBaan 121" "address2": "45" "city": "Retie" "zip": "2470" ; var result = await APIOrder; // or custom shop_idvar result = await APIOrder;
// Send an existing order to productionvar result = await APIOrder; // or custom shop_idvar result = await APIOrder;
// Calculate the shipping cost of an order var order = "line_items": "product_id": "5bfd0b66a342bcc9b5563216" "variant_id": 17887 "quantity": 1 "print_provider_id": 5 "blueprint_id": 9 "variant_id": 17887 "quantity": 1 "sku": "MY-SKU" "quantity": 1 "address_to": "first_name": "John" // not required "last_name": "Smith" // not required "email": "example@msn.com" // not required "phone": "0574 69 21 90" // not required "country": "BE" "region": "" "address1": "ExampleBaan 121" "address2": "45" "city": "Retie" "zip": "2470" ; var result = await APIOrder; // or custom shop_idvar result = await APIOrder;
// Retrieve a list of webhooksvar result = await APIWebhook; // or custom shop_idvar result = await APIWebhook;
// Retrieve a webhookvar result = await APIWebhook; // or custom shop_idvar result = await APIWebhook;
// Create a new webhookvar data = "topic": "order:created" "url": "https://morioh.com/webhooks/order/created" var result = await APIWebhook; // or custom shop_idvar result = await APIWebhook;
// Modify a webhookvar data = id: 12345 "url": "https://othersite.com/callback/order/created";var result = await APIWebhook; // or custom shop_idvar result = await APIWebhook;
// Events, no test// The product was deleted.API; // The product publishing was started.API; // The product published successfully.API; // The product publishing has failed.API; // The order was created.API; // The order was updated.API; // The order was sent to production.API; // Some/all items have been fulfilled.API; // Some/all items have been deliveredAPI; // see more: https://developers.printify.com/#events