Covers all questions related to inventory management, order fulfillment, and shipping.
We have a headless Remix site which uses the Storefront API to perform all user/cart related functions, and as part of this we have some custom requests from our client.
One of these requests is that the delivery cost for customer orders is not defined in Shopify/Checkout, but instead gets defined as a separate delivery cost on each product PDP page... Essentially the user will fill out some form fields (e.g. date, postcode) which fires an external API call, and returns some costs.
We need to pass these costs via the Storefront API (I'm assuming in the top level "attributes" field on the cart) and then access them in Shopify to define a custom delivery cost for the users order.
I'm struggling to find specific information on how to achieve this, the only one through reading being that there may be a way of having a general delivery option in Shopify that you essentially set very high and discount down to the required value for each order, but this seems a little hacky, and I'm worried of how this would display to the end user.
My question is; is there any way of achieving this e.g. through the Shopify Admin API or Shopify Functions?
Thanks, Matt
Hi , there
I am interested to discuss about it I think there is no need to define a general delivery option in shopify .
When your order generated , you can use mutation orderEditAddShippingLine/orderEditUpdateShippingLine to update your current order shipping cost using Shopify admin api .
So does the "orderEditAddShippingLine" Admin API endpoint let you manipulate the checkout before the user has paid for the order? The way it is worded makes it sounds like it edits an existing order that's already been paid for?
Ideally I'd like to pass the delivery costs via the Storefront API cart object, do you know if that's possible with the endpoints you've referenced?