`Shipping line price can't be blank` error when creating draft order

Adam132
Shopify Partner
2 0 2

Hello.

I have always been creating draft orders with shippingLine value set to:

shippingLine: {shippingRateHandle: "Standard"}

And it was working all good. Since 30.10.2023 I am getting such errors:

 

            "userErrors": [
                {
                    "field": [
                        "shippingLine",
                        "price"
                    ],
                    "message": "Shipping line price isn't a number."
                },
                {
                    "field": [
                        "shippingLine",
                        "price"
                    ],
                    "message": "Shipping line price can't be blank"
                },
                {
                    "field": [
                        "shippingLine",
                        "title"
                    ],
                    "message": "Shipping line title can't be blank"
                }
            ]

When I set custom price and title, it works. But I want to use shop's default shipping costs. What should I do?

 

Replies 8 (8)

Liam
Shopify Staff
2731 299 769

Hi Adam,

 

That does seem unusual, thanks for flagging the issue you're having. Ideally you should be able to rely on existing shipping settings rather than specify custom ones each time. I'll check if there was a recent change with this. Are you using the `2023-10` API version?

 

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Adam132
Shopify Partner
2 0 2

Thank you for the quick reply. I am using API version 2023-01, but I checked that the problem also appears on version `2023-10`.

Mickeydtails
Shopify Partner
8 1 7

We are experiencing the exact same issue, and also see the error coming out of nowhere. It stopped worked since yesterday I think, one of our clients reported about the error today. We haven't changed API version or any code, I've tried API versions 2023-01 up to unstable, all of them having the same problem

 

Setting the price field doesn't really work for us when creating draft orders in a non-shop currency, as it's the shop currency being used when the price is added manually, which makes it very hard to match the correct price of the shipping method

 

/Mickey

Liam
Shopify Staff
2731 299 769

Thanks for the extra context Mickey - we're looking into this now

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Dmitry-Skipify
Shopify Partner
1 0 0

We have an identical issue, and we are on the '2023-01' API.

 

Liam, how would you suggest to proceed?

Liam
Shopify Staff
2731 299 769

We shipped an update related to this yesterday - can you test again and see if you're still receiving an error?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Liam
Shopify Staff
2731 299 769

We shipped an update related to this yesterday - can you test again and see if you're still receiving an error?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Mickeydtails
Shopify Partner
8 1 7

@Liam I just made a quick test using PostMan and it looks like it's working as it used to. I will test a bit more and let you know how the result

 

Do you know if this is a change that will come in a future API version, or was it simply an error?

 

Thanks for the quick resolution, much appreciated