My store sells custom sewing patterns which come as a zip file with a bunch of PDFs in them. Each of these is custom generated for each order. What I want to know is what is the best way to upload these to shopify so that the user can download them?
Also I want to mark the order as finished (is that what Order.closed is for?)
Shopify doesn’t directly support attaching files to orders via the API, so you’ll need a workaround to achieve what you’re looking for. Are the PDFs created by you after an order is made? Once the file is ready to be sent to the customer, you could upload it to Shopify via the fileCreate mutation, which will give you a unique URL for the file. Then you could use the orderUpdate mutation to store that URL as a metafield that is associated with a specific order.
Finally, you’ll need to inform the customer about how to access their custom sewing pattern. This can be done via an automated email containing the secure URL, or by creating a customer account area on your Shopify store where links to their purchased files are available.