Understanding the "shipping_lines" collection

TezWingfield
Shopify Partner
8 0 0

Apologies for what may seem a "silly" question but I'm having trouble digesting the "shipping_lines" collection within my json response.

I have an order object that also contains customer, billing address, shipping adress and line items, which makes perfect sense but how/why do we use shipping lines?

Within my dev envirionment (C#) I can succesfully expose data pulled from a "Development store" using the Shopify API but before I proceed, I'd like to understand all.

Any help greatly appreciated!

Regards,

0 Likes
Jordan
Shopify Staff
Shopify Staff
297 3 69

Hey Tez,

No such thing as a silly questions here! 

So we define shipping_lines as an array of shipping line objects, each of which details the shipping methods used. You can read more about it here, but basically this means that a shipping_lines object will represent what shipping options were used in that order. For example, if I place an order from checkout and selected a $10 overnight shipping rate from Canada Post, the shipping_lines object may look something like:


"shipping_lines": [{
"id": 123456789,
"title": "Overnight Shipping",
"price": "10.00",
"code": "overnight",
"source": "Canada Post"
}]

If you have any questions or need further clarification, don't hesitate to let me know.

- Jordan
 

0 Likes
Stephen_Verdiec
New Member
1 0 0

Jordan,

     I'm trying to use the shipping_lines variable through another app that is pulling everything else I request, however the shipping_lines, no matter which variable I use, everything is coming back blank.  Any thoughts?

- Stephen

0 Likes
Jordan
Shopify Staff
Shopify Staff
297 3 69

Hey Stephen,

Could you describe the API request you're making? Is it to create a new order? If you provide the body of the request, I could look into our logs to better understand the problem.

 

- Jordan

0 Likes
jrleckie
New Member
1 0 0

Hi Jordan,

I was wondering with shipping_lines, is there a way to update the individual properties via API - i.e changing "code" to "usp tester". I notice in your below example, the "title" value and the "code" value are different, how did you do this? Also, can I update the "source" value via API?

Thanks,

Josh

0 Likes
jffordem
New Member
1 0 0

Hopefully this is an easy one. :)

Which field in the shipping_lines structure is the "Rate name" that I entered when I was setting up the shipping options?  Is it "title"?

Thanks!

0 Likes
Ari9
Excursionist
18 1 1

Does the shipping_lines contain the tracking number? I can't seem to find where the tracking number of the shipping is in the API.

0 Likes