Integration Python and Shopify?

Highlighted
New Member
1 0 0

I am an intermediate programmer in Python and I developed a model that, given a few inputs, returns a pdf file with some analysis information. I am trying to set up a Shopify store where customers can provide these inputs, pay a small fee and get the pdf file back as the digital product. Setting up the input code in liquid was easy, but now I am struggling to understand how I could integrate my Python model in this workflow. 

 

1) Where is  the information that the customer gave me stored? (I'm using line-item-property__field for this)

 

2) How can I programatically import the input information into a python environment?

 

3) From there, how can I return the customer product (pdf file)?

--> For this one, I thought about the solution getting customer email --> producing pdf locally --> setting up some sort of automatic email template outside shopify (although if I could integrate it as well would be preferred).

 

Thank you!

0 Likes
Shopify Staff
Shopify Staff
387 53 62

Hey @bbvillar,

 

Where is  the information that the customer gave me stored? (I'm using line-item-property__field for this)

Line item properties are stored in the order with each line item. You should be able to see them in the admin and also the Order API (line_items -> properties).

 

How can I programatically import the input information into a python environment?

Using the Order API.  Consider subscribing to a webhook and running the code when an order is placed.

 

From there, how can I return the customer product (pdf file)

An email is attached to the order, perhaps you could use this? You'll need to handle sending the email from your server.

0 Likes