Issues with CarrierService REST API

Solved
ON-SHIPPING
New Member
3 0 0

Hello

We want to show the shipping rates for our app. With the consent of the user

test store currency : KRW

I will show you my request value and shipping cost.

 

response json : { "rates": [ { "max_delivery_date": "2020-09-12 14:48:45 -0400", "total_price": "23333", "min_delivery_date": "2020-09-12 14:48:45 -0400", "service_name": "canadapost-overnight", "service_code": "ON", "description": "This is the fastest option by far", "currency": "KRW" }, { "max_delivery_date": "2020-09-12 14:48:45 -0400", "total_price": "29345", "min_delivery_date": "2020-09-12 14:48:45 -0400", "service_name": "fedex-2dayground", "service_code": "2D", "currency": "USD" }, { "max_delivery_date": "2020-09-12 14:48:45 -0400", "total_price": "35875", "min_delivery_date": "2020-09-12 14:48:45 -0400", "service_name": "fedex-priorityovernight", "service_code": "1D", "currency": "CAD" } ] }

 

it 's shopify carrier select view

shopify_view.png

 

Since the currency of the service name "canada post-overnight" is KRW, ₩23,333 should be displayed, but ₩233 is displayed on the Shopify Select screen.

and service name " fedex-2dayground" is Currency USD 29,345, 1 USD =  1,000 KRW

min 29,345,000 should be displayed, but 347,707 is displayed on the Shopify Select screen

0 Likes
rajasekar_b
Tourist
9 2 0

This is an accepted solution.


Shopify expects you to return a response in the lowest currency denomination. For eg. 1USD should be returned as 100.

In your case, when you return back ₩23,333, Shopify considers this as ₩23,3.33. You should return the total_price as ₩2333300. 

For the same reason, ₩29,345,000 is displayed as ₩347,707. Shopify treats the total_price as ₩293450.00. With a conversion rate as 1186.41, the shipping cost arrives at ₩347,707.

Solution: Return the total_price at lowest denomination for that currency. Typically, multiple by 100.

Thanks.

0 Likes
ON-SHIPPING
New Member
3 0 0

Thank you very much, for suggesting a solution. Where can I find a description of the CarrierService REST API for multiples of tot_price 100?

0 Likes
rajasekar_b
Tourist
9 2 0

We figured this out by trial-error. I could not find any documentation on this. We figured this out by seeing the sample responses from here - https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice?api[versio...

Thanks.

0 Likes
ON-SHIPPING
New Member
3 0 0

Thanks for sharing the test information. !!

0 Likes