Need help in calling backend workflows

I have an API endpoint which receives data from shopify. This contains information about return items for a particular order.

I can have multiple line-items under each order. I need to update the status of these line items based on the data I get from shopify return webhooks. The response looks like below:

    "return_line_items": [
        {
            "id": 1234567890,
            "admin_graphql_api_id": "gid://shopify/ReturnLineItem/1234567890",
            "quantity": 1,
            "return_reason": "size_too_large",
            "return_reason_note": "",
            "customer_note": null,
            "fulfillment_line_item": {
                "id": 1234567890,
                "admin_graphql_api_id": "gid://shopify/FulfillmentLineItem/1234567890",
                "line_item": {
                    "id": 1234567890,
                    "admin_graphql_api_id": "gid://shopify/LineItem/1234567890"
                }
            },
            "unit_price": null,
            "type": "ReturnLineItem",
            "restocking_fee": null
        },
		{
            "id": 1234567890,
            "admin_graphql_api_id": "gid://shopify/ReturnLineItem/1234567890",
            "quantity": 1,
            "return_reason": "size_too_large",
            "return_reason_note": "",
            "customer_note": null,
            "fulfillment_line_item": {
                "id": 1234567890,
                "admin_graphql_api_id": "gid://shopify/FulfillmentLineItem/1234567890",
                "line_item": {
                    "id": 1234567890,
                    "admin_graphql_api_id": "gid://shopify/LineItem/1234567890"
                }
            },
            "unit_price": null,
            "type": "ReturnLineItem",
            "restocking_fee": null
        }
    ]

There are 2 items in return_line_items array. I have a table which has return_data which also has fulfillment_line_item.id (I can use this to identify the record). So when I receive this endpoint, I need to update all the records in return_data table with the new return status. How can I do this?

Can you share your backend workflow?
Also is this a webhook or a normal public api workflow thats able to recieve data? In this case you would need to set every key value pair in the api workflow

This topic was automatically closed after 70 days. New replies are no longer allowed.