curl --request POST \
--url https://backend.unihop.app/api/v1/{platform}/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pickup_address_street": "<string>",
"pickup_address_city": "<string>",
"pickup_address_country": "<string>",
"pickup_name": "<string>",
"dropoff_address_street": "<string>",
"dropoff_address_city": "<string>",
"dropoff_address_country": "<string>",
"dropoff_name": "<string>",
"email": "jsmith@example.com",
"pickup_address_number": "<string>",
"pickup_address_secondary_number": "<string>",
"pickup_address_county": "<string>",
"pickup_address_state": "<string>",
"pickup_address_postal_code": "<string>",
"pickup_address_latitude": 123,
"pickup_address_longitude": 123,
"pickup_phone_number": "<string>",
"pickup_instructions": "<string>",
"dropoff_start_time": "2023-11-07T05:31:56Z",
"pickup_start_time": "2023-11-07T05:31:56Z",
"weight": 1,
"dropoff_address_number": "<string>",
"dropoff_address_secondary_number": "<string>",
"dropoff_address_county": "<string>",
"dropoff_address_state": "<string>",
"dropoff_address_postal_code": "<string>",
"dropoff_address_latitude": 123,
"dropoff_address_longitude": 123,
"dropoff_phone_number": "<string>",
"dropoff_instructions": "<string>",
"dropoff_email": "jsmith@example.com",
"package_description": "<string>",
"package_requirements": [],
"items": [
{
"name": "<string>",
"quantity": 123,
"description": "<string>",
"external_id": "<string>",
"external_instance_id": "<string>",
"price": 123,
"barcode": "<string>"
}
],
"items_count": 123,
"delivery_date": "2023-12-25",
"package_value": 1,
"tip": 1,
"currency": "<string>",
"platform_payload": {
"store_id": "corner-bakery-cambridge",
"order_id": "10482"
}
}
'import requests
url = "https://backend.unihop.app/api/v1/{platform}/quote"
payload = {
"pickup_address_street": "<string>",
"pickup_address_city": "<string>",
"pickup_address_country": "<string>",
"pickup_name": "<string>",
"dropoff_address_street": "<string>",
"dropoff_address_city": "<string>",
"dropoff_address_country": "<string>",
"dropoff_name": "<string>",
"email": "jsmith@example.com",
"pickup_address_number": "<string>",
"pickup_address_secondary_number": "<string>",
"pickup_address_county": "<string>",
"pickup_address_state": "<string>",
"pickup_address_postal_code": "<string>",
"pickup_address_latitude": 123,
"pickup_address_longitude": 123,
"pickup_phone_number": "<string>",
"pickup_instructions": "<string>",
"dropoff_start_time": "2023-11-07T05:31:56Z",
"pickup_start_time": "2023-11-07T05:31:56Z",
"weight": 1,
"dropoff_address_number": "<string>",
"dropoff_address_secondary_number": "<string>",
"dropoff_address_county": "<string>",
"dropoff_address_state": "<string>",
"dropoff_address_postal_code": "<string>",
"dropoff_address_latitude": 123,
"dropoff_address_longitude": 123,
"dropoff_phone_number": "<string>",
"dropoff_instructions": "<string>",
"dropoff_email": "jsmith@example.com",
"package_description": "<string>",
"package_requirements": [],
"items": [
{
"name": "<string>",
"quantity": 123,
"description": "<string>",
"external_id": "<string>",
"external_instance_id": "<string>",
"price": 123,
"barcode": "<string>"
}
],
"items_count": 123,
"delivery_date": "2023-12-25",
"package_value": 1,
"tip": 1,
"currency": "<string>",
"platform_payload": {
"store_id": "corner-bakery-cambridge",
"order_id": "10482"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pickup_address_street: '<string>',
pickup_address_city: '<string>',
pickup_address_country: '<string>',
pickup_name: '<string>',
dropoff_address_street: '<string>',
dropoff_address_city: '<string>',
dropoff_address_country: '<string>',
dropoff_name: '<string>',
email: 'jsmith@example.com',
pickup_address_number: '<string>',
pickup_address_secondary_number: '<string>',
pickup_address_county: '<string>',
pickup_address_state: '<string>',
pickup_address_postal_code: '<string>',
pickup_address_latitude: 123,
pickup_address_longitude: 123,
pickup_phone_number: '<string>',
pickup_instructions: '<string>',
dropoff_start_time: '2023-11-07T05:31:56Z',
pickup_start_time: '2023-11-07T05:31:56Z',
weight: 1,
dropoff_address_number: '<string>',
dropoff_address_secondary_number: '<string>',
dropoff_address_county: '<string>',
dropoff_address_state: '<string>',
dropoff_address_postal_code: '<string>',
dropoff_address_latitude: 123,
dropoff_address_longitude: 123,
dropoff_phone_number: '<string>',
dropoff_instructions: '<string>',
dropoff_email: 'jsmith@example.com',
package_description: '<string>',
package_requirements: [],
items: [
{
name: '<string>',
quantity: 123,
description: '<string>',
external_id: '<string>',
external_instance_id: '<string>',
price: 123,
barcode: '<string>'
}
],
items_count: 123,
delivery_date: '2023-12-25',
package_value: 1,
tip: 1,
currency: '<string>',
platform_payload: {store_id: 'corner-bakery-cambridge', order_id: '10482'}
})
};
fetch('https://backend.unihop.app/api/v1/{platform}/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend.unihop.app/api/v1/{platform}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pickup_address_street' => '<string>',
'pickup_address_city' => '<string>',
'pickup_address_country' => '<string>',
'pickup_name' => '<string>',
'dropoff_address_street' => '<string>',
'dropoff_address_city' => '<string>',
'dropoff_address_country' => '<string>',
'dropoff_name' => '<string>',
'email' => 'jsmith@example.com',
'pickup_address_number' => '<string>',
'pickup_address_secondary_number' => '<string>',
'pickup_address_county' => '<string>',
'pickup_address_state' => '<string>',
'pickup_address_postal_code' => '<string>',
'pickup_address_latitude' => 123,
'pickup_address_longitude' => 123,
'pickup_phone_number' => '<string>',
'pickup_instructions' => '<string>',
'dropoff_start_time' => '2023-11-07T05:31:56Z',
'pickup_start_time' => '2023-11-07T05:31:56Z',
'weight' => 1,
'dropoff_address_number' => '<string>',
'dropoff_address_secondary_number' => '<string>',
'dropoff_address_county' => '<string>',
'dropoff_address_state' => '<string>',
'dropoff_address_postal_code' => '<string>',
'dropoff_address_latitude' => 123,
'dropoff_address_longitude' => 123,
'dropoff_phone_number' => '<string>',
'dropoff_instructions' => '<string>',
'dropoff_email' => 'jsmith@example.com',
'package_description' => '<string>',
'package_requirements' => [
],
'items' => [
[
'name' => '<string>',
'quantity' => 123,
'description' => '<string>',
'external_id' => '<string>',
'external_instance_id' => '<string>',
'price' => 123,
'barcode' => '<string>'
]
],
'items_count' => 123,
'delivery_date' => '2023-12-25',
'package_value' => 1,
'tip' => 1,
'currency' => '<string>',
'platform_payload' => [
'store_id' => 'corner-bakery-cambridge',
'order_id' => '10482'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.unihop.app/api/v1/{platform}/quote"
payload := strings.NewReader("{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://backend.unihop.app/api/v1/{platform}/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.unihop.app/api/v1/{platform}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Quote created successfully",
"data": {
"price": {
"delivery_fee": 12.5,
"tip": 23,
"currency": "USD"
},
"distance": 0.61
}
}{
"code": "<string>",
"message": "<string>"
}{
"message": "The dropoff name field is required.",
"errors": {}
}Quote a Delivery
Price and distance, without creating anything
curl --request POST \
--url https://backend.unihop.app/api/v1/{platform}/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pickup_address_street": "<string>",
"pickup_address_city": "<string>",
"pickup_address_country": "<string>",
"pickup_name": "<string>",
"dropoff_address_street": "<string>",
"dropoff_address_city": "<string>",
"dropoff_address_country": "<string>",
"dropoff_name": "<string>",
"email": "jsmith@example.com",
"pickup_address_number": "<string>",
"pickup_address_secondary_number": "<string>",
"pickup_address_county": "<string>",
"pickup_address_state": "<string>",
"pickup_address_postal_code": "<string>",
"pickup_address_latitude": 123,
"pickup_address_longitude": 123,
"pickup_phone_number": "<string>",
"pickup_instructions": "<string>",
"dropoff_start_time": "2023-11-07T05:31:56Z",
"pickup_start_time": "2023-11-07T05:31:56Z",
"weight": 1,
"dropoff_address_number": "<string>",
"dropoff_address_secondary_number": "<string>",
"dropoff_address_county": "<string>",
"dropoff_address_state": "<string>",
"dropoff_address_postal_code": "<string>",
"dropoff_address_latitude": 123,
"dropoff_address_longitude": 123,
"dropoff_phone_number": "<string>",
"dropoff_instructions": "<string>",
"dropoff_email": "jsmith@example.com",
"package_description": "<string>",
"package_requirements": [],
"items": [
{
"name": "<string>",
"quantity": 123,
"description": "<string>",
"external_id": "<string>",
"external_instance_id": "<string>",
"price": 123,
"barcode": "<string>"
}
],
"items_count": 123,
"delivery_date": "2023-12-25",
"package_value": 1,
"tip": 1,
"currency": "<string>",
"platform_payload": {
"store_id": "corner-bakery-cambridge",
"order_id": "10482"
}
}
'import requests
url = "https://backend.unihop.app/api/v1/{platform}/quote"
payload = {
"pickup_address_street": "<string>",
"pickup_address_city": "<string>",
"pickup_address_country": "<string>",
"pickup_name": "<string>",
"dropoff_address_street": "<string>",
"dropoff_address_city": "<string>",
"dropoff_address_country": "<string>",
"dropoff_name": "<string>",
"email": "jsmith@example.com",
"pickup_address_number": "<string>",
"pickup_address_secondary_number": "<string>",
"pickup_address_county": "<string>",
"pickup_address_state": "<string>",
"pickup_address_postal_code": "<string>",
"pickup_address_latitude": 123,
"pickup_address_longitude": 123,
"pickup_phone_number": "<string>",
"pickup_instructions": "<string>",
"dropoff_start_time": "2023-11-07T05:31:56Z",
"pickup_start_time": "2023-11-07T05:31:56Z",
"weight": 1,
"dropoff_address_number": "<string>",
"dropoff_address_secondary_number": "<string>",
"dropoff_address_county": "<string>",
"dropoff_address_state": "<string>",
"dropoff_address_postal_code": "<string>",
"dropoff_address_latitude": 123,
"dropoff_address_longitude": 123,
"dropoff_phone_number": "<string>",
"dropoff_instructions": "<string>",
"dropoff_email": "jsmith@example.com",
"package_description": "<string>",
"package_requirements": [],
"items": [
{
"name": "<string>",
"quantity": 123,
"description": "<string>",
"external_id": "<string>",
"external_instance_id": "<string>",
"price": 123,
"barcode": "<string>"
}
],
"items_count": 123,
"delivery_date": "2023-12-25",
"package_value": 1,
"tip": 1,
"currency": "<string>",
"platform_payload": {
"store_id": "corner-bakery-cambridge",
"order_id": "10482"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pickup_address_street: '<string>',
pickup_address_city: '<string>',
pickup_address_country: '<string>',
pickup_name: '<string>',
dropoff_address_street: '<string>',
dropoff_address_city: '<string>',
dropoff_address_country: '<string>',
dropoff_name: '<string>',
email: 'jsmith@example.com',
pickup_address_number: '<string>',
pickup_address_secondary_number: '<string>',
pickup_address_county: '<string>',
pickup_address_state: '<string>',
pickup_address_postal_code: '<string>',
pickup_address_latitude: 123,
pickup_address_longitude: 123,
pickup_phone_number: '<string>',
pickup_instructions: '<string>',
dropoff_start_time: '2023-11-07T05:31:56Z',
pickup_start_time: '2023-11-07T05:31:56Z',
weight: 1,
dropoff_address_number: '<string>',
dropoff_address_secondary_number: '<string>',
dropoff_address_county: '<string>',
dropoff_address_state: '<string>',
dropoff_address_postal_code: '<string>',
dropoff_address_latitude: 123,
dropoff_address_longitude: 123,
dropoff_phone_number: '<string>',
dropoff_instructions: '<string>',
dropoff_email: 'jsmith@example.com',
package_description: '<string>',
package_requirements: [],
items: [
{
name: '<string>',
quantity: 123,
description: '<string>',
external_id: '<string>',
external_instance_id: '<string>',
price: 123,
barcode: '<string>'
}
],
items_count: 123,
delivery_date: '2023-12-25',
package_value: 1,
tip: 1,
currency: '<string>',
platform_payload: {store_id: 'corner-bakery-cambridge', order_id: '10482'}
})
};
fetch('https://backend.unihop.app/api/v1/{platform}/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend.unihop.app/api/v1/{platform}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pickup_address_street' => '<string>',
'pickup_address_city' => '<string>',
'pickup_address_country' => '<string>',
'pickup_name' => '<string>',
'dropoff_address_street' => '<string>',
'dropoff_address_city' => '<string>',
'dropoff_address_country' => '<string>',
'dropoff_name' => '<string>',
'email' => 'jsmith@example.com',
'pickup_address_number' => '<string>',
'pickup_address_secondary_number' => '<string>',
'pickup_address_county' => '<string>',
'pickup_address_state' => '<string>',
'pickup_address_postal_code' => '<string>',
'pickup_address_latitude' => 123,
'pickup_address_longitude' => 123,
'pickup_phone_number' => '<string>',
'pickup_instructions' => '<string>',
'dropoff_start_time' => '2023-11-07T05:31:56Z',
'pickup_start_time' => '2023-11-07T05:31:56Z',
'weight' => 1,
'dropoff_address_number' => '<string>',
'dropoff_address_secondary_number' => '<string>',
'dropoff_address_county' => '<string>',
'dropoff_address_state' => '<string>',
'dropoff_address_postal_code' => '<string>',
'dropoff_address_latitude' => 123,
'dropoff_address_longitude' => 123,
'dropoff_phone_number' => '<string>',
'dropoff_instructions' => '<string>',
'dropoff_email' => 'jsmith@example.com',
'package_description' => '<string>',
'package_requirements' => [
],
'items' => [
[
'name' => '<string>',
'quantity' => 123,
'description' => '<string>',
'external_id' => '<string>',
'external_instance_id' => '<string>',
'price' => 123,
'barcode' => '<string>'
]
],
'items_count' => 123,
'delivery_date' => '2023-12-25',
'package_value' => 1,
'tip' => 1,
'currency' => '<string>',
'platform_payload' => [
'store_id' => 'corner-bakery-cambridge',
'order_id' => '10482'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.unihop.app/api/v1/{platform}/quote"
payload := strings.NewReader("{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://backend.unihop.app/api/v1/{platform}/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.unihop.app/api/v1/{platform}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pickup_address_street\": \"<string>\",\n \"pickup_address_city\": \"<string>\",\n \"pickup_address_country\": \"<string>\",\n \"pickup_name\": \"<string>\",\n \"dropoff_address_street\": \"<string>\",\n \"dropoff_address_city\": \"<string>\",\n \"dropoff_address_country\": \"<string>\",\n \"dropoff_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"pickup_address_number\": \"<string>\",\n \"pickup_address_secondary_number\": \"<string>\",\n \"pickup_address_county\": \"<string>\",\n \"pickup_address_state\": \"<string>\",\n \"pickup_address_postal_code\": \"<string>\",\n \"pickup_address_latitude\": 123,\n \"pickup_address_longitude\": 123,\n \"pickup_phone_number\": \"<string>\",\n \"pickup_instructions\": \"<string>\",\n \"dropoff_start_time\": \"2023-11-07T05:31:56Z\",\n \"pickup_start_time\": \"2023-11-07T05:31:56Z\",\n \"weight\": 1,\n \"dropoff_address_number\": \"<string>\",\n \"dropoff_address_secondary_number\": \"<string>\",\n \"dropoff_address_county\": \"<string>\",\n \"dropoff_address_state\": \"<string>\",\n \"dropoff_address_postal_code\": \"<string>\",\n \"dropoff_address_latitude\": 123,\n \"dropoff_address_longitude\": 123,\n \"dropoff_phone_number\": \"<string>\",\n \"dropoff_instructions\": \"<string>\",\n \"dropoff_email\": \"jsmith@example.com\",\n \"package_description\": \"<string>\",\n \"package_requirements\": [],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"description\": \"<string>\",\n \"external_id\": \"<string>\",\n \"external_instance_id\": \"<string>\",\n \"price\": 123,\n \"barcode\": \"<string>\"\n }\n ],\n \"items_count\": 123,\n \"delivery_date\": \"2023-12-25\",\n \"package_value\": 1,\n \"tip\": 1,\n \"currency\": \"<string>\",\n \"platform_payload\": {\n \"store_id\": \"corner-bakery-cambridge\",\n \"order_id\": \"10482\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Quote created successfully",
"data": {
"price": {
"delivery_fee": 12.5,
"tip": 23,
"currency": "USD"
},
"distance": 0.61
}
}{
"code": "<string>",
"message": "<string>"
}{
"message": "The dropoff name field is required.",
"errors": {}
}Authorizations
The merchant's UniHop API key, sent as Authorization: Bearer <key>. It identifies the merchant and is what their deliveries are billed against.
Body
A delivery to create. The same body is accepted by POST /quote.
Street name of the pickup address.
City of the pickup address.
Country of the pickup address.
Name of the contact person at the pickup location.
Street name of the dropoff address.
City of the dropoff address.
Country of the dropoff address.
Name of the contact person at the dropoff location.
Customer email address for notifications.
Street number of the pickup address.
Apartment or suite number for the pickup address.
County of the pickup address.
State of the pickup address.
Postal or ZIP code of the pickup address.
Latitude coordinate of the pickup address.
Longitude coordinate of the pickup address.
Phone number of the pickup contact person.
15Additional instructions for the pickup.
512Start of the dropoff window as an ISO 8601 UTC datetime with a trailing Z (YYYY-MM-DDTHH:MM:SSZ). Numeric offsets (e.g. +01:00) are not accepted. Required unless package_delivery_mode is NOW.
Start of the pickup window as an ISO 8601 UTC datetime with a trailing Z (YYYY-MM-DDTHH:MM:SSZ). Numeric offsets (e.g. +01:00) are not accepted.
Weight of the package in lbs.
x >= 0Dimensions of the package.
Show child attributes
Show child attributes
Street number of the dropoff address.
Apartment or suite number for the dropoff address.
County of the dropoff address.
State of the dropoff address.
Postal or ZIP code of the dropoff address.
Latitude coordinate of the dropoff address.
Longitude coordinate of the dropoff address.
Phone number of the dropoff contact person.
15Additional instructions for the dropoff.
512Email address of the dropoff contact person.
Minimum vehicle type required to transport the package.
SEDAN, CAR, SUV, PICKUP_TRUCK, VAN, TRUCK, LARGE_VAN, EXTRA_LARGE_VAN, PICKUP Mode of delivery (NOW or SCHEDULED).
NOW, SCHEDULED Description of the package contents.
512Special delivery or pickup requirements.
PHOTO_PROOF_OF_DELIVERY, SIGNATURE_PROOF_OF_DELIVERY, TWO_PERSON_TEAM List of items included in the delivery.
Show child attributes
Show child attributes
Total count of items.
Delivery date (YYYY-MM-DD). Required unless package_delivery_mode is NOW. If a time component is included it is honoured; otherwise dropoff_start_time is used to determine the scheduled moment.
Monetary value of the package.
x >= 0Optional tip for the delivery.
x >= 0The intended currency.
3The delivery style. Can be Standard or Special Handling. Please contact us to unlock more delivery styles and associated features.
Standard, Special Handling An arbitrary object of your own: order IDs, store IDs, anything you need to match this delivery back to your system. Stored untouched and returned on every read and webhook.
{
"store_id": "corner-bakery-cambridge",
"order_id": "10482"
}

