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": "<string>",
"email": "<string>"
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"address": "<string>",
"notes": "<string>",
"shipping_fee": 1,
"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": "<string>",
"email": "<string>"
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"address": "<string>",
"notes": "<string>",
"shipping_fee": 1,
"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: '<string>', email: '<string>'},
items: [
{
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 50,
notes: '<string>',
modifier_option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
address: '<string>',
notes: '<string>',
shipping_fee: 1,
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' => '<string>',
'email' => '<string>'
],
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50,
'notes' => '<string>',
'modifier_option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'address' => '<string>',
'notes' => '<string>',
'shipping_fee' => 1,
'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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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",
"created_at": "2023-11-07T05:31:56Z",
"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>"
}
}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.
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.
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": "<string>",
"email": "<string>"
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"address": "<string>",
"notes": "<string>",
"shipping_fee": 1,
"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": "<string>",
"email": "<string>"
},
"items": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 50,
"notes": "<string>",
"modifier_option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"address": "<string>",
"notes": "<string>",
"shipping_fee": 1,
"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: '<string>', email: '<string>'},
items: [
{
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 50,
notes: '<string>',
modifier_option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
address: '<string>',
notes: '<string>',
shipping_fee: 1,
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' => '<string>',
'email' => '<string>'
],
'items' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 50,
'notes' => '<string>',
'modifier_option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'address' => '<string>',
'notes' => '<string>',
'shipping_fee' => 1,
'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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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\": \"<string>\",\n \"email\": \"<string>\"\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 \"address\": \"<string>\",\n \"notes\": \"<string>\",\n \"shipping_fee\": 1,\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",
"created_at": "2023-11-07T05:31:56Z",
"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>"
}
}Authorizations
API key del restaurante, generada en el panel de administración (Integraciones → API pública): fd_live_... para producción o fd_test_... para sandbox (modo prueba sobre el mismo restaurante).
Body
delivery, retiro Show child attributes
Show child attributes
1 - 100 elementsShow child attributes
Show child attributes
Obligatorio si type = delivery.
Costo de envío en CLP que paga el cliente (default 0; se ignora en retiro). Obtenlo de POST /delivery/quote (campo fee).
x >= 0external = cobras tú fuera de la plataforma; online = devolvemos payment_link con la página de pago Fintoc del restaurante.
external, online Solo con payment online; método preseleccionado en Fintoc.
transferencia, tarjeta Obligatorio con payment online (https). El cliente final vuelve aquí tras pagar, con ?order_id= y payment=success|failed|pending (o cancelled si abandona).
Response
Pedido creado. Con payment: "online" incluye payment_link.
Número corto visible para el cliente.
"#0041-150726"
pendiente_pago = esperando el pago online; programado = pagado pero retenido hasta su fecha-hora (pedidos programados); el resto es el flujo de cocina y despacho.
pendiente_pago, programado, recibido, en_preparacion, listo, en_reparto, entregado, cancelado delivery, retiro Show child attributes
Show child attributes
Dirección de entrega (solo pedidos delivery).
Show child attributes
Show child attributes
Costo de envío cobrado al cliente, en CLP.
Descuento aplicado (cupones/promociones), en CLP.
Total pagado por el cliente, en CLP.
Show child attributes
Show child attributes
null en pedidos de retiro o sin despacho asociado.
Show child attributes
Show child attributes
Fecha-hora comprometida si es un pedido programado.
Solo con payment "online".
Show child attributes
Show child attributes
