How to add Shipping or Shipping Rate using API

Highlighted

Hello There,

I am creating an order using order API. The order created successfully.
I want to pass the shipping rate while creating an order using API. How can I do that?

As per order API documentation, there is one field "shipping_lines" but in shipping_lines need an id, code, price, etc value I can not able to understand what is code and id.
No other details in Shopify order create API documentation.

rate:- https://help.shopify.com/en/api/reference/orders/order#create-2019-10

Thanks in advance.

0 Likes
Highlighted
Highlighted

Hey @Sound_Vault,

Thank you for your quick response.
we already try this but it's not working if you have any other solution please let us know.

0 Likes
Highlighted
Shopify Partner
10 0 2

Did you manage to get this to work?

 

I'm running into the same thing. On the order object we either populate the "shipping_lines" array or the "total_shipping_price_set" field. 

 

Either one returns me a 422 unprocessable entity. 

0 Likes