Make a Printify product from a design
const url = 'https://digize.com/api/v1/printify/products';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"title":"example","description":"","blueprintId":1,"printProviderId":1,"variants":[{"id":1,"price":1}],"design":{"uploadId":"example","position":"front","x":0.5,"y":0.5,"scale":1,"angle":0},"importToStore":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://digize.com/api/v1/printify/products \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "title": "example", "description": "", "blueprintId": 1, "printProviderId": 1, "variants": [ { "id": 1, "price": 1 } ], "design": { "uploadId": "example", "position": "front", "x": 0.5, "y": 0.5, "scale": 1, "angle": 0 }, "importToStore": true }'Makes a product in the connected Printify shop from a design in its library (printify.designs.upload): a product type and print provider from the catalog, the variants to sell with each one’s price in cents, and where the design goes on them, fitted inside the print area unless scale says otherwise. Printify renders the mockups. With importToStore (the default), it then comes into the store as a draft, so paid orders for it go to Printify; if that fails, the product is made all the same and importError says why.
Needs the commerce:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
Plain text; paragraphs are kept.
A blueprint id from printify.catalog.blueprints.
A print provider id from printify.catalog.providers.
object
What it sells for, in the store currency’s minor unit (cents for dollars), as the store will price it. Printify keeps the same number as its own price.
object
The design’s width as a share of the print area’s width; 1 is as wide as the area. Left out, the design is fitted inside the print area whole.
Responses
Section titled “Responses”Done
object
Printify’s id for the new product.
Its first mockup, on Printify; they take a moment to render.
The store product it came in as, when importToStore was on.
Why it didn’t come into the store, when importToStore was on: it’s made in Printify all the same, and printify.products.import brings it in.
Variants left out of the store past its 100.
Example generated
{ "printifyId": "example", "title": "example", "image": "example", "variants": 1, "priceFrom": 1, "priceTo": 1, "costFrom": 1, "costTo": 1, "productId": "example", "importError": "example", "skipped": 1}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}