Send HTTP Request: How to reference the response data with another HTTP request in same automation?

Solved
Mussty
Excursionist
30 3 6

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)

 

Mussty_0-1678987527047.png

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! 🙂

Accepted Solution (1)
Mussty
Excursionist
30 3 6

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.

Mussty_1-1679366778701.png

Send HTTP body content: { "OrderNumber": "{{order.name}}", "FulfillmentID": "{{fulfillment.id | remove: "gid://shopify/Fulfillment/"}}" }

 

Mussty_0-1679366681379.png

 

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. 

View solution in original post

Replies 3 (3)
paul_n
Shopify Staff
Shopify Staff
603 97 154

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. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
Mussty
Excursionist
30 3 6

Hi Paul, thank you for clarifying that. I think that would give Flow super powers when you do!! 😄

Mussty
Excursionist
30 3 6

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.

Mussty_1-1679366778701.png

Send HTTP body content: { "OrderNumber": "{{order.name}}", "FulfillmentID": "{{fulfillment.id | remove: "gid://shopify/Fulfillment/"}}" }

 

Mussty_0-1679366681379.png

 

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.