Why I am getting shipping line invalid error even shipping line is correct?

sumit_israni
New Member
10 0 0

Hi, I am working on the sales channel app. For create checkout I am using checkout api. When I have update the shipping lines through checkout api, I got the below error, even shipping lines are correct. See below error

{"errors"=>{"shipping_line"=>{"base"=>[{"code"=>"invalid", "message"=>"is invalid", "options"=>{}}], "id"=>[{"code"=>"invalid", "message"=>"is invalid", "options"=>{}}]}, "shipping_rate"=>{"base"=>[{"code"=>"invalid", "message"=>"is invalid", "options"=>{}}], "id"=>[{"code"=>"invalid", "message"=>"is invalid", "options"=>{}}]}}}

I have looked for the reason for shipping line error but I couldn't able to find the reason. I want to know all the reasons of above errors when update shipping lines through checkout api. Please respond on above ASAP. Thanks

 

0 Likes
sumit_israni
New Member
10 0 0

Find request and payload below

PUT: https://devsquard-2.myshopify.com/admin/api/2020-04/checkouts/b06f117efdf7057bce2faa4d5898954d.json

{:checkout=>{:line_items=>[{:variant_id=>"36612219011240", :quantity=>1}, {:variant_id=>"36612218847400", :quantity=>1}], :token=>"b06f117efdf7057bce2faa4d5898954d", :email=>"tess01@shopoff.co", :buyer_accepts_marketing=>true, :billing_address=>{:first_name=>"Claire", :last_name=>"Clark", :address1=>"325 N La Salle Dr #300", :city=>"Chicago", :province=>"Illinois", :country=>"United States", :phone=>"(980) 279-8666", :zip=>"60654"}, :shipping_line=>{:handle=>"shopify-Standard-0.00"}, :applied_discount=>{:amount=>0, :title=>"Truupit Discount Order", :description=>"Promotional item for check handle"}}}

0 Likes
csam
Shopify Staff
Shopify Staff
35 5 4

Hi @sumit_israni 

If you're creating a checkout, you'll want to use the POST method rather than PUT. PUT can be used to update/modify an existing checkout.

 

CS | API Support @ 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

0 Likes
sumit_israni
New Member
10 0 0

@csamI am updating existing checkout as mention above payload.

0 Likes