I need to know how to get shipping rate request that contains shipping address

yazidelbadri93
Shopify Partner
8 0 0

Hello,

 

I created a custom app in Shopify partners with node js, this is the steps I did:

 

1- create a carrier service with callback_url as a public Url

2- in the URL endpoint its a post as this doc says https://shopify.dev/api/admin-rest/2022-04/resources/carrierservice#top.

3- in this Post now I'm return the rates to shopify like this 

{ "rates": [ { "service_name": "canadapost-overnight", "service_code": "ON", "total_price": "1295", "description": "This is the fastest option by far", "currency": "CAD", "min_delivery_date": "2013-04-12 14:48:45 -0400", "max_delivery_date": "2013-04-12 14:48:45 -0400" }, { "service_name": "fedex-2dayground", "service_code": "2D", "total_price": "2934", "currency": "USD", "min_delivery_date": "2013-04-12 14:48:45 -0400", "max_delivery_date": "2013-04-12 14:48:45 -0400" }, { "service_name": "fedex-priorityovernight", "service_code": "1D", "total_price": "3587", "currency": "USD", "min_delivery_date": "2013-04-12 14:48:45 -0400", "max_delivery_date": "2013-04-12 14:48:45 -0400" } ] }

 

i get the total_price for each shipping method from an external service calling it by API. 

 

the problem i have is that now the external service need a shipping address and quantity to give me back the rates. for now i'm using a hardcoded shipping address and quantity, what i want is to have the real shipping address and quantity.

 

the documentation says that shopify will provide that to me before i return the rates, but i don't know how to get it. i tried to see in the req.body but there is nothing.

 

can any help please

 

Regards.

 

Yazid.

Replies 0 (0)