curl --request POST \
--url https://app.fooddelivery.cl/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "+56912345678",
"email": "<string>",
"marketing_opt_in": false
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"delivery_mode": "express",
"scheduled_for": "2023-11-07T05:31:56Z",
"address": "<string>",
"dropoff": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"notes": "<string>",
"shipping_fee": 1,
"discount": 6580,
"coupon_code": "VUELVE10",
"payment": "external",
"payment_method": "transferencia",
"return_url": "<string>"
}
'import requests
url = "https://app.fooddelivery.cl/api/v1/orders"
payload = {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "+56912345678",
"email": "<string>",
"marketing_opt_in": False
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"delivery_mode": "express",
"scheduled_for": "2023-11-07T05:31:56Z",
"address": "<string>",
"dropoff": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"notes": "<string>",
"shipping_fee": 1,
"discount": 6580,
"coupon_code": "VUELVE10",
"payment": "external",
"payment_method": "transferencia",
"return_url": "<string>"
}
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',
customer: {
name: '<string>',
phone: '+56912345678',
email: '<string>',
marketing_opt_in: false
},
items: [
{
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 50,
notes: '<string>',
modifier_option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
delivery_mode: 'express',
scheduled_for: '2023-11-07T05:31:56Z',
address: '<string>',
dropoff: {
street: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
latitude: 123,
longitude: 123
},
notes: '<string>',
shipping_fee: 1,
discount: 6580,
coupon_code: 'VUELVE10',
payment: 'external',
payment_method: 'transferencia',
return_url: '<string>'
})
};
fetch('https://app.fooddelivery.cl/api/v1/orders', 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/orders",
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',
'customer' => [
'name' => '<string>',
'phone' => '+56912345678',
'email' => '<string>',
'marketing_opt_in' => false
],
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50,
'notes' => '<string>',
'modifier_option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'delivery_mode' => 'express',
'scheduled_for' => '2023-11-07T05:31:56Z',
'address' => '<string>',
'dropoff' => [
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'notes' => '<string>',
'shipping_fee' => 1,
'discount' => 6580,
'coupon_code' => 'VUELVE10',
'payment' => 'external',
'payment_method' => 'transferencia',
'return_url' => '<string>'
]),
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/orders"
payload := strings.NewReader("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.fooddelivery.cl/api/v1/orders")
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 \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "#0041-150726",
"status": "pendiente_pago",
"type": "delivery",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"address": "<string>",
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 123,
"unit_price": 123,
"notes": "<string>",
"modifiers": [
{
"group": "<string>",
"name": "<string>",
"price": 123
}
]
}
],
"subtotal": 123,
"shipping_fee": 123,
"discount": 123,
"total": 123,
"payment": {
"method": "<string>",
"paid": true
},
"delivery": {
"provider": "uber",
"status": "<string>",
"tracking_url": "<string>"
},
"scheduled_for": "2023-11-07T05:31:56Z",
"next_day": true,
"created_at": "2023-11-07T05:31:56Z",
"delivery_mode": "express",
"delivery_window": "<string>",
"payment_link": {
"payment_url": "<string>",
"session_id": "<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>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Crear un pedido
Requiere permiso de escritura. Crea un pedido. Los precios se calculan SIEMPRE desde el catálogo del restaurante (no se aceptan precios del cliente). Respeta el inventario (409 si no hay stock) y exige la sucursal abierta (salvo delivery_mode: "next_day" o scheduled_for).
Dos modos según payment:
external(default): el cobro ocurre fuera de FoodDelivery; el pedido entra directo a la cocina (KDS) en estadorecibidoconpayment.method = "efectivo".online: el pedido queda enpendiente_pagoy la respuesta incluyepayment_link.payment_url— una página de pago Fintoc del restaurante donde paga el cliente final. Al confirmarse el pago, el pedido pasa a la cocina automáticamente y el cliente vuelve a tureturn_url(con?order_id=...&payment=success|failed|pending; si abandona,payment=cancelled). Los pedidos no pagados se cancelan solos después de un rato y reponen su stock.
Con llave sandbox (fd_test_) el pedido nace marcado como PRUEBA (visible en la cocina con etiqueta, sin stock/analítica/facturación reales, sin exigir local abierto) y payment_url apunta a un simulador donde eliges pago exitoso o fallido — el flujo de confirmación y redirección es idéntico al real.
Entrega al día siguiente (delivery_mode: "next_day", solo delivery): no exige la sucursal abierta. El pedido se agenda para el próximo día con horario de atención (si mañana está cerrado, el siguiente día hábil), en una ventana de 4 horas desde la apertura. Nace en programado (o en pendiente_pago → programado al pagarse online), con scheduled_for = hora comprometida, y entra a la cocina solo a la apertura de ese día. La respuesta trae delivery_window. Requiere que la sucursal opere por horario (no en modo caja).
Pedidos programados (scheduled_for, delivery o retiro): el cliente final elige el día y la hora de entrega o retiro y el pedido no exige la sucursal abierta ahora. Se valida que la sucursal acepte programados (scheduling.enabled en GET /locations), que la hora caiga dentro de su horario (schedule), dentro del horizonte (scheduling.max_days) y con el tiempo de preparación por delante (scheduling.lead_minutes); si no, responde scheduling_unavailable (409) o invalid_scheduled_for (400) con el motivo. Nace en programado (o en pendiente_pago → programado al pagarse online) y entra a la cocina en scheduled_for − lead_minutes. No se combina con delivery_mode: "next_day".
Productos Next Day (next_day_only: true en GET /menu): un pedido compuesto solo por ellos nace con next_day: true — lo despacha el propio local, no se envía al POS ni a un courier y queda en Pedidos > Next Day del panel. Mezclarlos con productos normales en el mismo pedido responde 400 (invalid_request): créalos como dos pedidos. Se combina con scheduled_for o delivery_mode: "next_day" para fijar el día de entrega.
Courier (delivery con payment: "online", express o programado): al crear el pedido FoodDelivery confirma quién lo reparte con las mismas reglas de POST /delivery/quote y el despacho sigue la configuración del restaurante, igual que en su tienda. Si nadie llega a la dirección responde delivery_unavailable (409) y si no se pudo confirmar, delivery_unavailable (503, reintenta): en ambos casos no hay pedido ni cobro. Con payment: "external" no se asigna courier: el reparto corre por tu cuenta. En sandbox nunca se llama a un repartidor.
curl --request POST \
--url https://app.fooddelivery.cl/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "+56912345678",
"email": "<string>",
"marketing_opt_in": false
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"delivery_mode": "express",
"scheduled_for": "2023-11-07T05:31:56Z",
"address": "<string>",
"dropoff": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"notes": "<string>",
"shipping_fee": 1,
"discount": 6580,
"coupon_code": "VUELVE10",
"payment": "external",
"payment_method": "transferencia",
"return_url": "<string>"
}
'import requests
url = "https://app.fooddelivery.cl/api/v1/orders"
payload = {
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "+56912345678",
"email": "<string>",
"marketing_opt_in": False
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"delivery_mode": "express",
"scheduled_for": "2023-11-07T05:31:56Z",
"address": "<string>",
"dropoff": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"notes": "<string>",
"shipping_fee": 1,
"discount": 6580,
"coupon_code": "VUELVE10",
"payment": "external",
"payment_method": "transferencia",
"return_url": "<string>"
}
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',
customer: {
name: '<string>',
phone: '+56912345678',
email: '<string>',
marketing_opt_in: false
},
items: [
{
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 50,
notes: '<string>',
modifier_option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
delivery_mode: 'express',
scheduled_for: '2023-11-07T05:31:56Z',
address: '<string>',
dropoff: {
street: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
latitude: 123,
longitude: 123
},
notes: '<string>',
shipping_fee: 1,
discount: 6580,
coupon_code: 'VUELVE10',
payment: 'external',
payment_method: 'transferencia',
return_url: '<string>'
})
};
fetch('https://app.fooddelivery.cl/api/v1/orders', 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/orders",
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',
'customer' => [
'name' => '<string>',
'phone' => '+56912345678',
'email' => '<string>',
'marketing_opt_in' => false
],
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50,
'notes' => '<string>',
'modifier_option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'delivery_mode' => 'express',
'scheduled_for' => '2023-11-07T05:31:56Z',
'address' => '<string>',
'dropoff' => [
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'notes' => '<string>',
'shipping_fee' => 1,
'discount' => 6580,
'coupon_code' => 'VUELVE10',
'payment' => 'external',
'payment_method' => 'transferencia',
'return_url' => '<string>'
]),
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/orders"
payload := strings.NewReader("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.fooddelivery.cl/api/v1/orders")
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 \"customer\": {\n \"name\": \"<string>\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"marketing_opt_in\": false\n },\n \"items\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 50,\n \"notes\": \"<string>\",\n \"modifier_option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"delivery_mode\": \"express\",\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"address\": \"<string>\",\n \"dropoff\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\n \"discount\": 6580,\n \"coupon_code\": \"VUELVE10\",\n \"payment\": \"external\",\n \"payment_method\": \"transferencia\",\n \"return_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "#0041-150726",
"status": "pendiente_pago",
"type": "delivery",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"name": "<string>",
"phone": "<string>",
"email": "<string>"
},
"address": "<string>",
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 123,
"unit_price": 123,
"notes": "<string>",
"modifiers": [
{
"group": "<string>",
"name": "<string>",
"price": 123
}
]
}
],
"subtotal": 123,
"shipping_fee": 123,
"discount": 123,
"total": 123,
"payment": {
"method": "<string>",
"paid": true
},
"delivery": {
"provider": "uber",
"status": "<string>",
"tracking_url": "<string>"
},
"scheduled_for": "2023-11-07T05:31:56Z",
"next_day": true,
"created_at": "2023-11-07T05:31:56Z",
"delivery_mode": "express",
"delivery_window": "<string>",
"payment_link": {
"payment_url": "<string>",
"session_id": "<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>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Authorizations
Body
Pedido programado (delivery o retiro): fecha-hora de entrega o retiro elegida por el cliente final, ISO 8601 con zona (ej. 2026-11-05T13:00:00-03:00). Debe caer dentro del horario de la sucursal (schedule), dentro de scheduling.max_days y al menos scheduling.lead_minutes en el futuro (todo en GET /locations). No se combina con delivery_mode: "next_day".
Descuento del integrador en CLP (default 0): promociones de su propio sitio, por ejemplo packs por cantidad. Se resta del subtotal (total = subtotal + shipping_fee − discount), el cliente paga el total con descuento y queda en discount del pedido. No puede superar el subtotal (400).
x >= 06580
Cupón creado en el panel del restaurante. FoodDelivery calcula el monto con los precios del catálogo, lo suma a discount y registra el canje. Si no vale responde 400 invalid_coupon. Si envías también discount, los dos se acumulan. Un cupón sobre productos no descuenta más que el subtotal; uno de delivery gratis descuenta shipping_fee. Los cupones de delivery gratis con radio máximo no están disponibles en la API.
64"VUELVE10"
Response
Pedido creado. Con payment: "online" incluye payment_link.
