Skip to content

Instantly share code, notes, and snippets.

@mikepaszkiewicz
Last active June 30, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikepaszkiewicz/eb8dda823264e492f9ee09290bcb5a78 to your computer and use it in GitHub Desktop.
Save mikepaszkiewicz/eb8dda823264e492f9ee09290bcb5a78 to your computer and use it in GitHub Desktop.
curl -X GET https://dispatch.tryhabitat.com/api/v1/rates/ \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/json' \
-d '{ "api_key": "YOUR_API_KEY",
"vendorId": "VENDOR_ID",
"destination": "ADDRESS_OR_COORDS"
"bagCount": "NUMBER_OF_DELIVERY_BAGS"
"allowedTransport": "[Walk,Skate,Bike,DeliveryBike,Car,Van]"
}'
NOTES:
- the ```destination``` param can either be an address or coords:
- address: '2198 N Broad St' //can be any format of address, mapbox is pretty good at parsing
- coords: '-75.156812,39.986591' //for now just a string, mapbox does lng first
RETURNS: {
quoteId: 'QUOTE_ID',
isAvailable: false, //can we do the delivery?
rate: 5, //returns false if insideZone is false
currency: 'USD',
companyName: 'Sangkee Noodle House',
vendorId: 'thm89eD8so6ERG8qn',
coordinates: [ -75.156812, 39.986591 ],
address: '1413 W Susquehanna Ave, Philadelphia, Pennsylvania 19132, United States'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment