curl --request POST \
--url https://app.fooddelivery.cl/api/v1/delivery/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dropoff": {
"address": "<string>",
"latitude": 123,
"longitude": 123,
"city": "<string>",
"street": "<string>",
"state": "<string>",
"zip": "<string>"
},
"subtotal": 1,
"mode": "express"
}
'import requests
url = "https://app.fooddelivery.cl/api/v1/delivery/quote"
payload = {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dropoff": {
"address": "<string>",
"latitude": 123,
"longitude": 123,
"city": "<string>",
"street": "<string>",
"state": "<string>",
"zip": "<string>"
},
"subtotal": 1,
"mode": "express"
}
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({
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dropoff: {
address: '<string>',
latitude: 123,
longitude: 123,
city: '<string>',
street: '<string>',
state: '<string>',
zip: '<string>'
},
subtotal: 1,
mode: 'express'
})
};
fetch('https://app.fooddelivery.cl/api/v1/delivery/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://app.fooddelivery.cl/api/v1/delivery/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([
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dropoff' => [
'address' => '<string>',
'latitude' => 123,
'longitude' => 123,
'city' => '<string>',
'street' => '<string>',
'state' => '<string>',
'zip' => '<string>'
],
'subtotal' => 1,
'mode' => 'express'
]),
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://app.fooddelivery.cl/api/v1/delivery/quote"
payload := strings.NewReader("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\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://app.fooddelivery.cl/api/v1/delivery/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.fooddelivery.cl/api/v1/delivery/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 \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"mode": "express",
"provider": "uber",
"fee": 123,
"fee_original": 123,
"fee_subsidy": 123,
"currency": "<string>",
"duration_minutes": 123,
"expires": "<string>",
"delivery_window": "<string>",
"delivery_window_start": "2023-11-07T05:31:56Z",
"delivery_window_end": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"message": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Cotizar el envío a una dirección
Cotiza el reparto con el mismo motor del checkout de FoodDelivery: reparto propio si la sucursal lo tiene activado (validando cobertura), o Uber Direct / PedidosYa según la preferencia del local, con las reglas de subsidio de envío aplicadas. fee es lo que paga el cliente final: úsalo como shipping_fee al crear el pedido. Enviar latitude/longitude mejora la precisión y es obligatorio para validar cobertura de reparto propio.
Con mode: "next_day" devuelve además la ventana de entrega del próximo día hábil (delivery_window, delivery_window_start/end, scheduled_for). El fee es el precio del courier al momento de cotizar (sin expires): crea el pedido con ese mismo shipping_fee y delivery_mode: "next_day".
curl --request POST \
--url https://app.fooddelivery.cl/api/v1/delivery/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dropoff": {
"address": "<string>",
"latitude": 123,
"longitude": 123,
"city": "<string>",
"street": "<string>",
"state": "<string>",
"zip": "<string>"
},
"subtotal": 1,
"mode": "express"
}
'import requests
url = "https://app.fooddelivery.cl/api/v1/delivery/quote"
payload = {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dropoff": {
"address": "<string>",
"latitude": 123,
"longitude": 123,
"city": "<string>",
"street": "<string>",
"state": "<string>",
"zip": "<string>"
},
"subtotal": 1,
"mode": "express"
}
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({
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dropoff: {
address: '<string>',
latitude: 123,
longitude: 123,
city: '<string>',
street: '<string>',
state: '<string>',
zip: '<string>'
},
subtotal: 1,
mode: 'express'
})
};
fetch('https://app.fooddelivery.cl/api/v1/delivery/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://app.fooddelivery.cl/api/v1/delivery/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([
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dropoff' => [
'address' => '<string>',
'latitude' => 123,
'longitude' => 123,
'city' => '<string>',
'street' => '<string>',
'state' => '<string>',
'zip' => '<string>'
],
'subtotal' => 1,
'mode' => 'express'
]),
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://app.fooddelivery.cl/api/v1/delivery/quote"
payload := strings.NewReader("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\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://app.fooddelivery.cl/api/v1/delivery/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.fooddelivery.cl/api/v1/delivery/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 \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dropoff\": {\n \"address\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"city\": \"<string>\",\n \"street\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\"\n },\n \"subtotal\": 1,\n \"mode\": \"express\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"mode": "express",
"provider": "uber",
"fee": 123,
"fee_original": 123,
"fee_subsidy": 123,
"currency": "<string>",
"duration_minutes": 123,
"expires": "<string>",
"delivery_window": "<string>",
"delivery_window_start": "2023-11-07T05:31:56Z",
"delivery_window_end": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"message": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Authorizations
Body
Response
Resultado de la cotización. available: false significa que no hay reparto para esa dirección (fuera de cobertura o sin proveedores configurados); message explica el motivo.
