Reserva Actualizada
curl --request POST \
--url https://api.example.com/reservations.reservation.updated \
--header 'Content-Type: application/json' \
--data '
{
"type": "reservations.reservation.updated",
"data": {
"reservation": {
"_id": "res-xxxxxxxxxxxxxxxxx",
"storeId": "sto-xxxxxxxxxxxxxxxxx",
"websiteId": "web-xxxxxxxxxxxxxxxxx",
"startsAt": "2024-07-30T10:00:00Z",
"partySize": 2,
"status": "created",
"customerName": "Juan Pérez",
"customerEmail": "juan@example.com",
"customerPhone": "+56912345678",
"notes": "Mesa cerca de la ventana",
"createdAt": "2024-07-30T09:00:00Z",
"updatedAt": "2024-07-30T09:00:00Z"
}
},
"entityId": "res-xxxxxxxxxxxxxxxxx",
"entityType": "reservation",
"date": "2024-07-30T09:00:00Z",
"eventId": "swev-xxxxxxxxxxxxxxxxx"
}
'import requests
url = "https://api.example.com/reservations.reservation.updated"
payload = {
"type": "reservations.reservation.updated",
"data": { "reservation": {
"_id": "res-xxxxxxxxxxxxxxxxx",
"storeId": "sto-xxxxxxxxxxxxxxxxx",
"websiteId": "web-xxxxxxxxxxxxxxxxx",
"startsAt": "2024-07-30T10:00:00Z",
"partySize": 2,
"status": "created",
"customerName": "Juan Pérez",
"customerEmail": "juan@example.com",
"customerPhone": "+56912345678",
"notes": "Mesa cerca de la ventana",
"createdAt": "2024-07-30T09:00:00Z",
"updatedAt": "2024-07-30T09:00:00Z"
} },
"entityId": "res-xxxxxxxxxxxxxxxxx",
"entityType": "reservation",
"date": "2024-07-30T09:00:00Z",
"eventId": "swev-xxxxxxxxxxxxxxxxx"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'reservations.reservation.updated',
data: {
reservation: {
_id: 'res-xxxxxxxxxxxxxxxxx',
storeId: 'sto-xxxxxxxxxxxxxxxxx',
websiteId: 'web-xxxxxxxxxxxxxxxxx',
startsAt: '2024-07-30T10:00:00Z',
partySize: 2,
status: 'created',
customerName: 'Juan Pérez',
customerEmail: 'juan@example.com',
customerPhone: '+56912345678',
notes: 'Mesa cerca de la ventana',
createdAt: '2024-07-30T09:00:00Z',
updatedAt: '2024-07-30T09:00:00Z'
}
},
entityId: 'res-xxxxxxxxxxxxxxxxx',
entityType: 'reservation',
date: '2024-07-30T09:00:00Z',
eventId: 'swev-xxxxxxxxxxxxxxxxx'
})
};
fetch('https://api.example.com/reservations.reservation.updated', 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://api.example.com/reservations.reservation.updated",
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([
'type' => 'reservations.reservation.updated',
'data' => [
'reservation' => [
'_id' => 'res-xxxxxxxxxxxxxxxxx',
'storeId' => 'sto-xxxxxxxxxxxxxxxxx',
'websiteId' => 'web-xxxxxxxxxxxxxxxxx',
'startsAt' => '2024-07-30T10:00:00Z',
'partySize' => 2,
'status' => 'created',
'customerName' => 'Juan Pérez',
'customerEmail' => 'juan@example.com',
'customerPhone' => '+56912345678',
'notes' => 'Mesa cerca de la ventana',
'createdAt' => '2024-07-30T09:00:00Z',
'updatedAt' => '2024-07-30T09:00:00Z'
]
],
'entityId' => 'res-xxxxxxxxxxxxxxxxx',
'entityType' => 'reservation',
'date' => '2024-07-30T09:00:00Z',
'eventId' => 'swev-xxxxxxxxxxxxxxxxx'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/reservations.reservation.updated"
payload := strings.NewReader("{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/reservations.reservation.updated")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/reservations.reservation.updated")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}"
response = http.request(request)
puts response.read_bodyWebhooks
Reserva Actualizada
Evento que se dispara cuando se actualiza una reserva
POST
/
reservations.reservation.updated
Reserva Actualizada
curl --request POST \
--url https://api.example.com/reservations.reservation.updated \
--header 'Content-Type: application/json' \
--data '
{
"type": "reservations.reservation.updated",
"data": {
"reservation": {
"_id": "res-xxxxxxxxxxxxxxxxx",
"storeId": "sto-xxxxxxxxxxxxxxxxx",
"websiteId": "web-xxxxxxxxxxxxxxxxx",
"startsAt": "2024-07-30T10:00:00Z",
"partySize": 2,
"status": "created",
"customerName": "Juan Pérez",
"customerEmail": "juan@example.com",
"customerPhone": "+56912345678",
"notes": "Mesa cerca de la ventana",
"createdAt": "2024-07-30T09:00:00Z",
"updatedAt": "2024-07-30T09:00:00Z"
}
},
"entityId": "res-xxxxxxxxxxxxxxxxx",
"entityType": "reservation",
"date": "2024-07-30T09:00:00Z",
"eventId": "swev-xxxxxxxxxxxxxxxxx"
}
'import requests
url = "https://api.example.com/reservations.reservation.updated"
payload = {
"type": "reservations.reservation.updated",
"data": { "reservation": {
"_id": "res-xxxxxxxxxxxxxxxxx",
"storeId": "sto-xxxxxxxxxxxxxxxxx",
"websiteId": "web-xxxxxxxxxxxxxxxxx",
"startsAt": "2024-07-30T10:00:00Z",
"partySize": 2,
"status": "created",
"customerName": "Juan Pérez",
"customerEmail": "juan@example.com",
"customerPhone": "+56912345678",
"notes": "Mesa cerca de la ventana",
"createdAt": "2024-07-30T09:00:00Z",
"updatedAt": "2024-07-30T09:00:00Z"
} },
"entityId": "res-xxxxxxxxxxxxxxxxx",
"entityType": "reservation",
"date": "2024-07-30T09:00:00Z",
"eventId": "swev-xxxxxxxxxxxxxxxxx"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'reservations.reservation.updated',
data: {
reservation: {
_id: 'res-xxxxxxxxxxxxxxxxx',
storeId: 'sto-xxxxxxxxxxxxxxxxx',
websiteId: 'web-xxxxxxxxxxxxxxxxx',
startsAt: '2024-07-30T10:00:00Z',
partySize: 2,
status: 'created',
customerName: 'Juan Pérez',
customerEmail: 'juan@example.com',
customerPhone: '+56912345678',
notes: 'Mesa cerca de la ventana',
createdAt: '2024-07-30T09:00:00Z',
updatedAt: '2024-07-30T09:00:00Z'
}
},
entityId: 'res-xxxxxxxxxxxxxxxxx',
entityType: 'reservation',
date: '2024-07-30T09:00:00Z',
eventId: 'swev-xxxxxxxxxxxxxxxxx'
})
};
fetch('https://api.example.com/reservations.reservation.updated', 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://api.example.com/reservations.reservation.updated",
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([
'type' => 'reservations.reservation.updated',
'data' => [
'reservation' => [
'_id' => 'res-xxxxxxxxxxxxxxxxx',
'storeId' => 'sto-xxxxxxxxxxxxxxxxx',
'websiteId' => 'web-xxxxxxxxxxxxxxxxx',
'startsAt' => '2024-07-30T10:00:00Z',
'partySize' => 2,
'status' => 'created',
'customerName' => 'Juan Pérez',
'customerEmail' => 'juan@example.com',
'customerPhone' => '+56912345678',
'notes' => 'Mesa cerca de la ventana',
'createdAt' => '2024-07-30T09:00:00Z',
'updatedAt' => '2024-07-30T09:00:00Z'
]
],
'entityId' => 'res-xxxxxxxxxxxxxxxxx',
'entityType' => 'reservation',
'date' => '2024-07-30T09:00:00Z',
'eventId' => 'swev-xxxxxxxxxxxxxxxxx'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/reservations.reservation.updated"
payload := strings.NewReader("{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/reservations.reservation.updated")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/reservations.reservation.updated")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"reservations.reservation.updated\",\n \"data\": {\n \"reservation\": {\n \"_id\": \"res-xxxxxxxxxxxxxxxxx\",\n \"storeId\": \"sto-xxxxxxxxxxxxxxxxx\",\n \"websiteId\": \"web-xxxxxxxxxxxxxxxxx\",\n \"startsAt\": \"2024-07-30T10:00:00Z\",\n \"partySize\": 2,\n \"status\": \"created\",\n \"customerName\": \"Juan Pérez\",\n \"customerEmail\": \"juan@example.com\",\n \"customerPhone\": \"+56912345678\",\n \"notes\": \"Mesa cerca de la ventana\",\n \"createdAt\": \"2024-07-30T09:00:00Z\",\n \"updatedAt\": \"2024-07-30T09:00:00Z\"\n }\n },\n \"entityId\": \"res-xxxxxxxxxxxxxxxxx\",\n \"entityType\": \"reservation\",\n \"date\": \"2024-07-30T09:00:00Z\",\n \"eventId\": \"swev-xxxxxxxxxxxxxxxxx\"\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Payload del webhook de reserva
Estructura completa del payload enviado en webhooks de reservas
Tipo de evento de webhook
Available options:
reservations.reservation.updated Allowed value:
"reservations.reservation.updated"Example:
"reservations.reservation.created"
Datos del evento
Show child attributes
Show child attributes
ID de la entidad afectada (reserva)
Pattern:
^res-[a-zA-Z0-9]{17}$Example:
"res-xxxxxxxxxxxxxxxxx"
Tipo de entidad
Available options:
reservation Allowed value:
"reservation"Example:
"reservation"
Fecha y hora del evento
Example:
"2024-07-30T09:00:00Z"
ID único del evento de webhook
Pattern:
^swev-[a-zA-Z0-9]{17}$Example:
"swev-xxxxxxxxxxxxxxxxx"
Response
200
OK
⌘I