Geliştirici API

Ayarlio Appointment API ile harici sistemlerden güvenli şekilde randevu oluşturabilir, müşteri bilgilerini doğrudan sisteme aktarabilirsiniz.

Endpoint

POST Endpoint

https://api.ayarlio.com/api/public/appointment

Headers

Content-Type: application/json

Örnek Request

{
  "tenantId": "69e6c6cdbdf8985d0b2ba46a",
  "customerName": "Jhosdn",
  "customerEmail": "jhdas2o12333n@example.com",
  "customerPhone": "905424978185",
  "date": "2026-08-31T23:00:00.000Z",
  "serviceId": "69f364c65544141c14cd3823",
  "staffId": "69f365745544141c14cd3825",
  "notes": ""
}

Alan Açıklamaları

tenantId

İşletme / tenant kimliği

customerName

Müşteri adı

customerEmail

Müşteri e-posta adresi

customerPhone

Müşteri telefon numarası

date

ISO 8601 formatında randevu tarihi

serviceId

Hizmet kimliği

staffId

Personel kimliği

notes

Opsiyonel müşteri notu

cURL Örneği

curl --location 'https://api.ayarlio.com/api/public/appointment' \
--header 'Content-Type: application/json' \
--data-raw '{
  "tenantId": "69e6c6cdbdf8985d0b2ba46a",
  "customerName": "Jhosdn",
  "customerEmail": "jhdas2o12333n@example.com",
  "customerPhone": "905424978185",
  "date": "2026-08-31T23:00:00.000Z",
  "serviceId": "69f364c65544141c14cd3823",
  "staffId": "69f365745544141c14cd3825",
  "notes": ""
}'

JavaScript Fetch Örneği

const response = await fetch(
  "https://api.ayarlio.com/api/public/appointment",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      tenantId: "69e6c6cdbdf8985d0b2ba46a",
      customerName: "Jhosdn",
      customerEmail: "jhdas2o12333n@example.com",
      customerPhone: "905424978185",
      date: "2026-08-31T23:00:00.000Z",
      serviceId: "69f364c65544141c14cd3823",
      staffId: "69f365745544141c14cd3825",
      notes: ""
    })
  }
);

const data = await response.json();

console.log(data);

Başarılı Response

{
  "success": true,
  "message": "Appointment created successfully",
  "data": {
    "appointmentId": "70a123456789abcdef123456"
  }
}

Önemli Notlar

  • date alanı ISO 8601 formatında gönderilmelidir.
  • notes alanı opsiyoneldir.
  • tenantId, serviceId ve staffId sistemde kayıtlı olmalıdır.
  • Telefon numarası uluslararası formatta gönderilmelidir.