I have a custom app that allows stores to enable the Shopify Carrier Service. When a customer enters their shipping details at checkout, Shopify sends our app a request with the shipping information and order items. Our app processes that data and returns the calculated shipping rates back to the checkout page. My question is: if the order is still in draft status, is it possible to receive the draft order ID in the request sent from the checkout page?
So here in my site i will create one draft order. and get checkout link of that draft order. when i redirect to checkout page from that checkout link then it is sending request to our app. so is there any way to get detail of that draft order?
Try line item properties
The carrier service request structure is limited and poorly documented.
So you’ll need to try to put extra info into line-item-properties for the orders items.
Or do a query to the shop on the backend to get the info but your apps response time in returning the rate still needs to be REALLY GOOD, and keep in mind the cache for the carrier service for similar requests.
I’d crosspost this as a feature request on the dev forums, keep in mind stuff like this has come up for over a decade but they’ve never really improved it even with simple attributes and now with the shopify-functions time investment i’m doubtful any improvements will ever happen for the carrier-service api ever again.