Is it possible to adjust the shipping method based on certain criteria, like the country in the shipping address?
I have a size exchange app for my customers that automatically generates new orders for product size exchanges. However, all the outgoing orders from this app have the same shipping method ("Free shipping for exchanges"). I need the shipping title to be unique for each country, so I can properly link the shipping title to the shipping method in my shipping app.
So I need to flow that works like this:
Shipping method = Free shipping for exchanges
Receiver country = Finland
Rename shipping method = UPS Finland
If you have Shopify Plus, you can do this. You can use APIs like Local Pickup Delivery Option Generator API, Delivery Customization Function API, and Shipping Discount Function API.
If you don't have it, you can use a custom-made app for yourself.
For checking the shipping method, check order / shippingLine / title (or one of the other fields on shippingLine): https://shopify.dev/docs/api/admin-graphql/2024-01/objects/ShippingLine
To check the country, you would check order / shippingAddress / country.
You cannot rename a shipping method. I'm not sure you can actually change the shipping line on the order.
Seems you may not be able to change the shipping line :
That said, there is a OrderStagedChangeAddShippingLine object in the api that could indicate it's possible:
Seems like it is possible in draft orders, though I'm not sure how useful that would be here.
Dive into the world of Print-on-Demand and discover how it can transform your online busin...By Imogen Feb 19, 2024
Discover how to transform your online store into a delightful shopping destination. Learn ...By Ollie Feb 13, 2024