My client has a third-party set-up that generates a PDF based on the products on a customer's order.
So the order is accessed via REST, which then grabs the products via the public /products/product-handle.json API.
The problem we're now facing, is if a product's handle gets updated due to misspelling etc, the PDF functionality can break because a customer's ordered product technically no longer exists at it's original handle.
I'm wondering if product redirects might be respected on a JSON level? So a redirect set up will automatically point to red-tshirt when the original purchased product was red-tshort.
From testing creating a product redirect does not create a new handle. Also removing the misspelled product from the online store product availability will not give access to that object.
Encourage to use product ID as the handle. I'm sure that's not always a possibility but if the order is accessed via Shopify REST API then the ID of the product should be in there. Assuming the logic that handles the order is pulling the title currently and then making a call to products/handle.json
Just a thought: If there is just one or two items that are causing this issue a hack would be to "hide" the product within the theme files. Like go into list-collections or similar and check for product.title !== 'misspelled' that could be something. With the current logic that product handle should exist so if the code can't be changed then the misspelled product should at the very least exist within Shopify.