How to enable dynamic files in Shopify

This approach will allow you to use the dynamically created product files after a customer places an order at Shopify.

You just need to implement the API  endpoint that generates the product pdf and returns the link to the file.

This endpoint is called by our app before the order is placed to Cloudprinter.com.


Go to the Settings of the Cloudprinter Shopify app  (Settings - Advanced), where you need to specify the link to the API end and generate a security token.



If your infrastructure supports it, make sure HTTP/2 is enabled on the endpoint.


Request:

Here is an example of the call sent to your service:


HTTP request:

Tables can't be imported directly. Please insert an image of your table which can be found here.

POST https://your-service.example.com/get-products-files-endpoint

Content-Type: application/json

Authorization: Bearer


Body:

Tables can't be imported directly. Please insert an image of your table which can be found here.

{

  "orderId": "*",

  "itemId": "*",

  "fileTypes": ['product']

}


Parameters:

Tables can't be imported directly. Please insert an image of your table which can be found here.

Shopify order ID


Response:

  • Your endpoint must respond with a 2XX status code (e.g. 200, 201, 204, etc).
  • Your endpoint must respond within 5 seconds

Response data:

Tables can't be imported directly. Please insert an image of your table which can be found here.

  files: [

    {

        type: "product",

        url: "https://link-to-the-file",

        md5sum: "md5 sum of the file"

    }

  ]

}


File item parameters:

Tables can't be imported directly. Please insert an image of your table which can be found here.

Md5 sum of the file - used for validation