All things Shopify and commerce
Hello,
I am using the REST API to create draft orders and send customers invoice URLs.
I want to be able to map the shipping line according to what a user selects.
Basically, a user can choose between UPS ground, UPS next day air, UPS next day saver, etc.
Based on what they select I want to apply that shipping handle to the draft order so the draft invoice is populated with the same shipping option.
The draft order is made up of line items which are newly created product variants for a pre-existing product. Shipping options have already been set up for the parent product. How can I get the handle for those shipping options so I can map it to a user's selected method?
What I have tried:
I have tried creating a draft order inside the Shopify admin UI, selecting a shipping method, and then sending a GET request to the REST API for that draft order, and copying the shipping handle in the shipping line.
This works sometimes, but I have found that the handle changes, and therefore is not programmable.
Example shipping handle that is returned: "337d83bdaf87bf6cb63641689df5d706"
Anyone have any guidance?
Thanks!
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025