Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi All,
I am trying to create a flow automation when I mark an order fulfilled, I want to change the order status to "Ready to Pickup" in my local delivery management platform, Shipday, and retrieve the tracking link and add it to my order via HTTP Requests.
Shipday allows me to have access to their API and I can do a Get call to retrieve order data.
How do I then use this data back into to another HTTP request with Shipday and with Shopify? (I have created a shopify custom app and have API access to update data, I can successfully update shopify inventory data already via Flow automations)
Examples:
Using shopify's order number I am able to make a successful Get order details API call to Shipday and part of that data is their platforms unique orderID and order TrackingLink. (https://docs.shipday.com/reference/retrieve-order-details)
To update Shipday that the order is Ready to Pickup when order status is fulfilled in shopify I need to add Shipdays unique OrderID in their API url link when I'm carrying out the Send HTTP Request. (https://docs.shipday.com/reference/order-ready-to-pickup)
How do I reference this variable orderID from the previous GET request and place it in the url above where I have marked it {{Shipday.orderID}}?
I then need to create another parallel action to insert the TrackingLink via the API call here: https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillment#post-fulfillments-fulfillment-...
Again, I am not sure how to reference the data I got from the previous HTTP request and insert "trackingLink" to the request body:
{"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "Shipday.TrackingLink", "company": "my-company"}}},
});
Any help will be greatly appreciated! 🙂
Solved! Go to the solution
This is an accepted solution.
Thanks to @paul_n clarification I used Make.com platform to perform the desired results.
For anyone interested I created a shopify flow automation to send the Order number and fulfilment number to make.com via a webhook I created on their platform. I was then able to use the data returned in make.com environment and carry out further https request calls to get the order number from Shipday, then using the trackingLink that I got from the GET request, I was able to update tracking info in shopify.
Send HTTP body content: { "OrderNumber": "{{order.name}}", "FulfillmentID": "{{fulfillment.id | remove: "gid://shopify/Fulfillment/"}}" }
Further info here: https://community.shopify.com/c/shopify-apis-and-sdks/error-422-tracking-information-update-failed/t...on how I fixed some errors.
This is currently not possible as Flow actions don't return data into the environment. Enabling this is very much something we want to do, but it might be awhile before you see it.
Hi Paul, thank you for clarifying that. I think that would give Flow super powers when you do!! 😄
yeah - that would be a nice feature. hitting this wall today - I think Mechanic can do what you need usually here.
Hi Paul
Does "This is currently not possible as Flow actions don't return data into the environment" also apply to the returned http status code from the "Send HTTP Request" action?
Yes, but Flow does intercept that status code and will automatically try 5xx type errors. We will be adding fetch capabilities to Run code later this year, allowing you to call almost any API (and return data).
Paul,
Just out of curiosity, why not leverage the "Send HTTP request" flow block instead of implementing "fetch" in the Run Code? I mean, is there a security or other reason not to simply add the values to the environment so they're accessible everywhere without needing a Run Code block?
Also, speaking of Run Code blocks. Would love to be able to name them.... Just sayin'.
In a lot of http requests you'll need to handle things like paging and authentication that might not be available is a Send HTTP Request in exactly the way you need it.
When I first read of the HTTP block, I envisioned something like a Postman call, where it handles a lot of it for you. Now, if you’re looking to make it simple, why not have the Devs trick out the HTTP block? If you use fetch(), you’ve still got plenty of configuring to do. As the HTTP block stands now, you CAN configure it by hand, just as you would in a Run Code block (adding header info as necessary), it’s just a pain.
This is an accepted solution.
Thanks to @paul_n clarification I used Make.com platform to perform the desired results.
For anyone interested I created a shopify flow automation to send the Order number and fulfilment number to make.com via a webhook I created on their platform. I was then able to use the data returned in make.com environment and carry out further https request calls to get the order number from Shipday, then using the trackingLink that I got from the GET request, I was able to update tracking info in shopify.
Send HTTP body content: { "OrderNumber": "{{order.name}}", "FulfillmentID": "{{fulfillment.id | remove: "gid://shopify/Fulfillment/"}}" }
Further info here: https://community.shopify.com/c/shopify-apis-and-sdks/error-422-tracking-information-update-failed/t...on how I fixed some errors.
Wow. Here I was so impressed with Shopify Flow initially. Now it's just like the rest of Shopify -- lots of potential but not when you get into the weeds. *sigh*
Thanks for sharing, always good to see someone share the solution that worked for them! Helps others get in to it too.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024