Reputation: 163
We are looking to integrate this application:
https://postmates.com/developer/docs into our Shopify platform.
For how it works please check: http://blog.postmates.com/post/104856343907/a-technical-perspective-on-the-postmates-api.
So we are looking for add a Carrier Service to our store. And As Postmates provides services to few regions as follows we will add other mutiple shipping options for non-Postmates supported regions.
Postmates is currently available in the San Francisco Bay Area (San Francisco, East Bay, South Bay), New York City, Chicago, Los Angeles, Washington DC, Seattle, Austin, Boston, Philadelphia, Miami, San Diego, Denver, Las Vegas and Orange County.
I have contacted both Shopify and Postmates, who both say there is no app already built to directly integrate this into their account. With that said, Postmates claims that it has been done before where a user creates a Private App and connect it through API key that way. Could you please advice on below:
Also please note: So basically we want to add Postmates shipping service for some regions only ( as it supports few regions only https://postmates.com/help Topic : "What cities is Postmates available in?" ) and for other regions we will have different shipping charges+ methods etc...
So at backend which things & how we need to setup the things.As per this : http://docs.shopify.com/api/carrierservice
Are there any limitations or restrictions?
Please advice if I am missing any information or any specific detail to mention here.
Is there any creative folks who like to dive deep into space?
Upvotes: 2
Views: 1812
Reputation: 369
I'm working with shopify (developer store). And recently I have the same error.
Error description: I added a Carrier Service successfully. Add zone rates, and set in the callback function a default response to test it (I took this json from shopify doc):
$rates = [
"rates" =>
[
[
"service_name" => "BlueExpress",
"service_code" => "ON",
"total_price" => "1295",
"description" => "This is the fastest option by far",
"currency" => "PES",
"min_delivery_date" => "2021-04-20 14:48:45 -0400",
"max_delivery_date" => "2021-05-12 14:48:45 -0400"
]
]
];
return json_encode($rates);
But, when the customer is in the checkout...get the next message:
To solve it you have to add this options in the create/update Carrier Service request: "service_discovery": false, "register": true
In this way I solved it
Upvotes: 0
Reputation: 595
The Shopify API's carrier service resource (http://docs.shopify.com/api/carrierservice) is indeed the solution you're looking for.
Whenever a customer of your Shopify store is placing an order during checkout, after he has entered his billing & shipping address, Shopify can send a rate request to the carrier service you have registered. This post request contains all data about the items in cart and the customer.
Your carrier service app needs to accept this POST request, calculate the corresponding shipping rates - in your case by yet another API call to the Postmates API - and then return a JSON response in the format that Shopify defines in the docs. If all goes well, the shipping rate(s) your app has returned will then be shown in the checkout.
You can code your app such that for the cities that Postmates doesn't support, your carrier service will return no rates.
We've built such an integration with Shippo (https://apps.shopify.com/shippo), supporting many other carriers. Let me know if you need further help.
Upvotes: 4