Guida Partner API - Localhost Booking
Questa pagina descrive come integrare il tuo software con le API Partner di Localhost Booking per inserire prenotazioni nel Social Calendar.
Credenziali
Le credenziali API non sono pubbliche. Vengono rilasciate solo su richiesta e dopo abilitazione del partner.
- Partner ID
- Partner Secret
Endpoint
POST https://www.atlocalhost.it/wp-json/lhb/v1/partner/bookings GET https://www.atlocalhost.it/wp-json/lhb/v1/partner/presence?date=YYYY-MM-DD
Header richiesti
Content-Type: application/jsonX-Partner-Id: <partner_id>X-Partner-Secret: <secret>X-Timestamp: <unix_seconds>X-Signature: <hmac_sha256_hex(timestamp.body)>
Payload richiesto
{
"external_booking_id": "UPF-2026-000123",
"guest_email": "ospite@example.com",
"guest_name": "Mario Rossi",
"booking_dates": ["2026-05-10"]
}
Esempio payload completo
{
"external_booking_id": "UPF-2026-000124",
"guest_email": "ospite@example.com",
"guest_name": "Mario Rossi",
"booking_dates": ["2026-05-10", "2026-05-12"],
"phone": "+391234567890",
"linkedin": "https://www.linkedin.com/in/mariorossi",
"website": "https://mariorossi.it",
"photo_url": "https://example.com/avatar.jpg",
"notes": "Arrivo dopo le 20:00",
"privacy": {
"show_photo": true,
"show_name": true,
"show_email": false,
"show_phone": false,
"show_linkedin": false,
"show_website": false
}
}
Campi supportati
external_booking_id(obbligatorio)guest_email(obbligatorio)guest_name(obbligatorio)booking_dates(obbligatorio, array di dateYYYY-MM-DD)phone(opzionale, formato E.164)linkedin(opzionale)website(opzionale)photo_url(opzionale, estensioni ammesse: jpg, jpeg, png, gif, webp)privacy(opzionale, flagshow_*)
Regole su external_booking_id
- Deve essere generato dal sistema partner (es. UpFlex).
- Deve essere univoco per ogni nuova prenotazione.
- Per aggiornare una prenotazione esistente, riutilizzare lo stesso external_booking_id.
- Se viene inviato due volte con gli stessi dati non crea duplicati (idempotenza).
Regole validazione
- Massimo 5 date per richiesta.
- Date passate non ammesse.
- Le date duplicate vengono deduplicate automaticamente.
Risposte API
200: created / updated401: autenticazione o firma non valida422: payload non valido
Lettura presenze per giorno
Puoi richiedere chi e' presente in un giorno specifico via endpoint GET:
GET https://www.atlocalhost.it/wp-json/lhb/v1/partner/presence?date=2026-05-10
Per la firma GET usa body vuoto: la stringa da firmare e' "timestamp.".
const signature = hmac_sha256(secret, `${timestamp}.`)
curl -G "https://www.atlocalhost.it/wp-json/lhb/v1/partner/presence" \ --data-urlencode "date=2026-05-10" \ -H "X-Partner-Id: <partner_id>" \ -H "X-Partner-Secret: <secret>" \ -H "X-Timestamp: <timestamp>" \ -H "X-Signature: <firma_hmac_get>"
La risposta applica automaticamente le preferenze privacy: i campi non consentiti vengono restituiti vuoti.
Contatti
Per richiedere credenziali, onboarding o supporto tecnico, contatta il team Localhost Booking.