Filter shipping rates based on what option was selected on cart's customer widget.

3 0 1

I am new to Shopify and have researched a lot of this topic.

1. I am creating a Shopify app where customers can select an option from a widget which will be available on cart page, based on that selected option I want to filter out the shipping options available on shipping method page which comes from Shopify's carrier service api.

2. Is there a way to inform backend that which option is selected on cart's widget and check that value when Shopify asks for rates using carrier service api. So that we can manipulate the rates based on which option customer selected on cart's widget?

Please help anyone from Shopify or any Shopify expert.