Skip to main content
Best answer

How do I get order costs from Printify using their API?


Forum|alt.badge.img

Hi everyone. I’ve got a Shopify store with Printify as my supplier. My cost of goods changes with every order, so I’m trying to find a way to use a Zap to pull this information from Printify into Shopify. I’ve tried to set this up first with a Google Sheet (which is just about there, but relies on some manual input), but then found this post on the Shopify help site and wondered if it would be possible to set up:
 

Automate Cost Tracking with Metafields

You can store Printify order costs in Shopify using metafields:

Steps:

  1. Set Up Metafields:

    • Go to your Shopify admin.
    • Navigate to Settings > Custom Data > Orders and add a metafield for "Printify Cost."
  2. Connect Printify Data: Use a tool like ZapierIntegromat, or custom scripts to fetch the Printify order cost (via Printify API) and automatically update the Shopify order metafield.

  3. Display Metafields:

    • Use a metafield app or Liquid code in Shopify to display the cost alongside order details in the admin.
  4. Calculate Profit: Add a script or app that subtracts the Printify cost (stored in the metafield) from the order total to calculate profit.

 

It’s step 2 I’m struggling with. I’ve managed to get my API key from Printify, but I can’t seem to find a way to use it in a Zap - however, I’m totally out of my depth here. I’ve got as far as having the trigger as a new order in Shopify, then a webhook to get the information from Printify, but on the Configure step of the webhook I honestly don’t know how to fill this in and the co-pilot hasn’t been helpful, and ChatGPT has been giving me options that don’t exist. 

Any help gratefully appreciated, either to get this working or to use a better method. Thanks!

Best answer by tarka33Best answer by tarka33

Putting this here for anyone else who comes across this thread with the same problem:

I have tried every which way to make this work, and it wouldn’t - even a separate Zap with a Catch Raw Webhook (which I found as a saved answer in another thread) wouldn’t work, I kept getting errors trying to post the webhook to Printify. There are way, way more reasons than this, and I have been fighting to make this work for several months now, and just coming up with problem after problem.

SOLUTION: Just use Make. I’ve set up a Scenario using an HTTP module, 2 iterators (one for order level data, one for line item data), and Add Row to Google Sheets, and it works like a charm. And it took me about 30 minutes to set up. 
I’m sorry Zapier, because I really do love you, and I tried, but this has been a nightmare.

View original
Did this topic help you find an answer to your question?

10 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@tarka33 

What is the link to the mentioned post you found?

What is the link to the Printify API endpoint documentation you are trying to use to configure the Webhook step?

 

NOTE: A helpful resource is to use ChatGPT to help you configure the Webhook fields.

You can post screenshots of the Zap step configuration and ask ChatGPT questions to get guidance.


JammerS
Forum|alt.badge.img+6
  • Zapier Staff
  • 2602 replies
  • February 10, 2025

Hi ​@tarka33,
 
We just wanted to see how everything is going with your Zap. Did Troy's recommendation get the job done? Feel free to reach out if you need further assistance with your Zap. We're glad to address any concerns and assist you.
 
We're looking forward to your response.


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • February 10, 2025

Hi ​@Troy Tessalone and ​@JammerS - thanks for your replies.

Troy, here are the links you asked for:
Shopify help post regarding how to set up a Zap to automate reporting COGS from Printify

Printify API Documentation


I did ask ChatGPT for help setting up the webhook in Zapier and did exactly as you suggested, sending screenshots, but it was telling me to fill in fields that weren’t available on the Zap despite this. Hence I ended up here hoping for help. Any further advice is most welcome! 
Thank you both!


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31359 replies
  • February 10, 2025

@tarka33 

Which specific Printify API endpoint are you trying to use?


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • February 10, 2025

Hi ​@Troy Tessalone - I’m not 100% sure if this is what you mean, but ChatGPT suggested I use https://api.printify.com/v1/shops.json to connect to my shop. Is that what you are asking for?


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31359 replies
  • February 10, 2025

@tarka33 

If you are trying to interact with Prinity Orders, then these are the available Printify API endpoints: https://developers.printify.com/#orders

 

 

You will need to set these fields:

  • URL
    • Include your Printify Shop ID
    • Include the Printify Order ID
  • Headers
    • Authorization: Bearer PAT
      • Reference the section in the documentation about personal access token (PAT
    • Content-Type: application/json;charset=utf-8
      • Search the API docs for “content type”

 

 

 

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • February 22, 2025

Hi ​@Troy Tessalone - thanks for this answer, and apologies I didn’t get back to look at this until now. I hadn’t understood what I was looking at until I read your response, but after you pointed me in the right direction, between the Printify API documentation and ChatGPT, I’ve managed to just about get there.

I’ve focused firstly on getting the information into Google Sheets, as then I can analyse it further. Getting it into Shopify as metadata as mentioned in my original post is a nice to have after I get this working. 

So, I’ve got the webhook to Printify working in Zapier, but it sends information through as comma separated values. I’ve put a loop and filter in to try to match the order numbers from Shopify and Printify, which seems to mostly work - I can get the total order cost, shipping cost, tax, order number, and date no problem. Here’s how my Zap is set up, for reference:
 

Zap setup

However, if an order has more than one line item, I can’t get the line item cost, shipping, or retail price. It appears to be nested within the comma separated values from Printify. Here’s a screenshot to show what I mean:
 


If you’ve got any suggestions, I’d be very grateful for the help. Also, if you need more info, please just let me know. Many thanks, again!


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31359 replies
  • February 22, 2025

@tarka33 

You are likely dealing with arrays within arrays.

Nested arrays get flattened.

So you need to handle each Shopify Line Item separately in order to get the nested metadata.

 

From the screenshots it’s unclear how Zap steps 3-4 are configured in EDIT mode with the field mappings visible.


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • February 26, 2025

Hi ​@Troy Tessalone, ok, I get that. I’m not sure how to go about handling each line item separately though; are you able to point me in the right direction, please?

If it’s of any use, here are some screenshots of the Configure sections of steps 3 and 4. I’ve added Line Item Cost back in on Step 4, but this is one of the fields that is nested so hasn’t been working. If there’s anything else you need to know, please just let me know - I’m very thankful for the help!


 

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 5 replies
  • Answer
  • March 30, 2025

Putting this here for anyone else who comes across this thread with the same problem:

I have tried every which way to make this work, and it wouldn’t - even a separate Zap with a Catch Raw Webhook (which I found as a saved answer in another thread) wouldn’t work, I kept getting errors trying to post the webhook to Printify. There are way, way more reasons than this, and I have been fighting to make this work for several months now, and just coming up with problem after problem.

SOLUTION: Just use Make. I’ve set up a Scenario using an HTTP module, 2 iterators (one for order level data, one for line item data), and Add Row to Google Sheets, and it works like a charm. And it took me about 30 minutes to set up. 
I’m sorry Zapier, because I really do love you, and I tried, but this has been a nightmare.


Reply