GET /plugin-api/customers/get ✓ CanlıPIITek bir müşteriyi ID ile getirir (CRM/sadakat). Şekil customers/list öğesiyle birebir aynıdır. PII alanları (name/phone/address) yalnız customers:read + tenant consent birlikte varken döner; total (finansal) de consent yoksa düşer — aksi halde yalnız {id} (region varsa, non-PII). Tutarlar ondalık TL.
← API Uçları · Liste: customers/list · ortak kurallar (base, auth, hata zarfı) API Uçları'nda.
GET {RESTOMENUM_BASE}/plugin-api/customers/get?customerId=abc123
Authorization: Bearer {serverId}.{pluginId}.{secret} // install API key (token exchange){RESTOMENUM_BASE}): Sandbox https://sandbox.plugins.restomenum.app, Production https://plugins.restomenum.app.customerId (zorunlu) — müşteri doc id'si. Maks. 200 karakter, '/' içeremez (aksi halde 400 plugin.customers.missingParams). Ayrı bir /detail yolu yoktur (get = detay; products/get, categories/get ile aynı konvansiyon).Authorization: Bearer <apiKey> — token exchange'teki install API key (serverId.pluginId.secret).customers:read (PII) zorunlu (yoksa 403 plugin.scope.denied; scope var ama consent yoksa yalnız { id }, region varsa eklenir).PII consent VAR — tüm alanlar dolu:
{ "success": true, "data": {
"id": "iBe5oEvD4wcXF3sQc042",
"name": "Joe",
"phone": "90431212312",
"address": "Hürriyet Mah, Koçak Sokak 12-14 Aslan Apt Daire 1",
"total": 22.61
} }Consent YOK — yalnız id (PII + total gizli; region varsa eklenir):
// PII consent YOKSA → PII (name/phone/address) + total düşer; yalnız id (+ region varsa, non-PII)
{ "success": true, "data": { "id": "abc123" } }İç/finansal alanlar (bakiye, log, açık hesap…) sızmaz — yalnız aşağıdakiler döner:
| Alan | Tip | Açıklama | PII |
|---|---|---|---|
| id | string | Müşteri ID'si — her zaman gelir, asla null | — |
| region | string|null | Kaba bölge/şube etiketi — PII değil, consent'siz akar. Opsiyonel: müşteride tanımlıysa gelir, aksi halde alan hiç gelmez (canlı örnekte yoktu) | — |
| name | string|null | Müşteri adı (nullable) | evet |
| phone | string|null | Telefon (nullable) | evet |
| address | string|null | Adres (nullable). Kaynakta adress (typo) ya da address olabilir; çıktıda her zaman address olarak gelir | evet |
| total | number | Ömür boyu toplam harcama — ONDALIK TL (kuruş değil; ör. 22.61). Finansal, PII değil; varsayılan 0, asla null. Yine de consent yoksa düşer | — |
kalan, paid, log, closed, beforeClosed, group*, category, new — allowlist gereği bu iç/finansal alanlar consent'le bile dönmez. Yeni eklenen herhangi bir alan da varsayılan olarak düşer (fail-safe).name, phone, address) yalnız customers:read scope'u VE kullanıcı consent'i (dataConsent.piiShared === true, katı boolean; 1/"true"/"yes" reddedilir) birlikte varsa döner.total (finansal, PII değil) yine de consent yoksa düşer — consent'siz öğe yalnızca { id } içerir (region varsa eklenir; alanları undefined varsay, name ?? "—"). Bu, webhook customer redaction'ı ile birebir aynı kuraldır.| Durum | HTTP | message |
|---|---|---|
customerId eksik / NULL / boş string / 200+ karakter / '/' içeriyor | 400 | plugin.customers.missingParams |
| Müşteri bulunamadı | 404 | plugin.customers.notFound |
| Scope yok | 403 | plugin.scope.denied |
| Geçersiz/eksik key | 401 | unauthorized |
Rate limit aşıldı (+ Retry-After header) | 429 | plugin.rateLimited |
| Sunucu hatası | 500 | internal |
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset header'larını taşır; 429'da ayrıca Retry-After gelir. Ayrıntı: Rate Limit'ler.