Covers all questions related to inventory management, order fulfillment, and shipping.
Hi guys, I'm working on an app and I'd like to show the shipping information on my order detail page. Is there any any api could help?
This is the information I want to show on my app. I don't find a field in order API to show the shipping details.
https://shopify.dev/docs/api/admin-rest/2024-07/resources/order
The mailing address of the customer.
or you can use GraphQL:
https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Order
Key fields from the Order API for shipping information:
shipping_lines: This contains the details of the shipping method applied to the order, including the title, price, and other details.
shipping_address: This contains the shipping destination, which can help you display where the items are being shipped to.
Here’s an example of how to retrieve this data using the Shopify Admin REST API.
Example API Response (Order API):
{
"order": {
"id": 123456789,
"email": "[email protected]",
"shipping_lines": [
{
"title": "Standard Delivery (4-7 days)",
"price": "5.00",
"code": "Standard",
"source": "shopify",
"requested_fulfillment_service_id": null,
"delivery_category": null,
"carrier_identifier": null,
"discounted_price": "5.00",
"phone": null
}
],
"shipping_address": {
"first_name": "John",
"address1": "123 Shipping St",
"city": "Cityville",
"province": "State",
"country": "United States",
"zip": "12345"
},
"line_items": [
{
"name": "Product Name",
"quantity": 1,
"grams": 29
}
]
}
}
Breakdown:
shipping_lines.title: "Standard Delivery (4-7 days)"
shipping_lines.price: €5.00
line_items.grams: 29 grams
Integration Steps:
Call the Shopify Admin API: Use the order ID to retrieve the necessary information.
Extract the relevant fields: Parse out the shipping lines, shipping address, and weight from the line items.
Display the data in your app: Format and present this data similarly to the receipt shown in your image.
Thank!I'm using 2024-01 version API. But the thing is I can only retrieve the total weight of my order, I didn't find a field that show the package's weight. In the Shopify console, there's a field in order called financial summery, and it contains the shipping and weight information.