GET /plugin-api/customers/list ✓ CanlıPIIMağazanın tüm müşteri kataloğunu sayfalı döner (CRM/sadakat/müşteri-senkron). Müşteri sayısı binlerce olabileceğinden cursor (keyset) pagination kullanılır — offset YOKTUR. Her öğe customers/get ile aynı allowlist şeklidir; PII consent kuralı geçerlidir.
← API Uçları · Detay: customers/get · ortak kurallar API Uçları'nda.
GET {RESTOMENUM_BASE}/plugin-api/customers/list?limit=200
Authorization: Bearer {serverId}.{pluginId}.{secret} // install API key (token exchange)
# sonraki sayfa — önceki yanıtın nextCursor'ı:
GET {RESTOMENUM_BASE}/plugin-api/customers/list?limit=200&after=<nextCursor>| Param | Zorunlu | Varsayılan | Açıklama |
|---|---|---|---|
| limit | hayır | 100 | Sayfa boyutu — max 500 (aşılırsa 500'e kırpılır) |
| after | hayır | — | Önceki sayfanın son id'si (nextCursor). İlk sayfada gönderme. Maks. 200 karakter, '/' içeremez. |
Authorization: Bearer <apiKey> — install API key.customers:read (PII) zorunlu (yoksa 403).limit sessizce kırpılır — hata vermez.after SESSİZCE yok sayılır — baştan sayfalanır, 400 DÖNMEZ. Geçersiz/bilinmeyen bir cursor ise BOŞ sonuç döndürür ({ data: [], hasMore: false }) — veri sızıntısı olmaz.{
"success": true,
"data": [
{ "id": "abc123", "region": "Kadıköy", "name": "Ali Veli", "phone": "+9055...", "address": "...", "total": 1240 }
],
"nextCursor": "abc123", // son dönen id — bir sonraki ?after= bu
"hasMore": true // false → son sayfa, nextCursor null
}// PII consent YOKSA → her öğe yalnız {id, region}
{ "success": true, "data": [ { "id": "abc123", "region": "Kadıköy" } ], "nextCursor": "abc123", "hasMore": true }data — müşteri dizisi; her öğe customers/get ile aynı allowlist şekli.nextCursor — son dönen id; bir sonraki isteği ?after=<nextCursor> ile yap. Son sayfada null.hasMore — true: daha fazla sayfa var · false: son sayfa.Her öğe (consent ile) şu allowlist alanlarını taşır:
| Alan | Tip | Açıklama | PII |
|---|---|---|---|
| id | string | Müşteri ID'si | — |
| region | string | null | Bölge/şube etiketi (kaba coğrafi — PII değil, consent'siz de döner) | — |
| name | string | null | Müşteri adı | evet |
| phone | string | null | Telefon | evet |
| address | string | null | Adres | evet |
| total | number | Ömür boyu toplam harcama (finansal, varsayılan 0 — null olmaz). PII değil ama consent'siz allowlist { id, region }'a indiğinden yine de gizlenir. | — |
hasMore true olduğu sürece nextCursor'ı bir sonraki isteğin after'ına ver. offset yok — keyset pagination ekleme/silmede kayma yaratmaz.
// Tüm müşterileri cursor ile sayfa sayfa çek (offset YOK)
let after = null;
let hasMore = true;
while (hasMore) {
const url = '/plugin-api/customers/list?limit=200' + (after ? '&after=' + after : '');
const r = await fetch(BASE + url, { headers: { Authorization: 'Bearer ' + apiKey } });
if (!r.ok) break; // HTTP hatasında döngüyü kır (sonsuz döngüye girme)
const res = await r.json();
for (const c of res.data) process(c);
// data boşken hasMore===true → platform anomalisi: dönme, çık
if (res.hasMore && res.data.length === 0) break;
after = res.nextCursor;
hasMore = res.hasMore; // hasMore===false → son sayfa, dur
}hasMore === false VEYA bir HTTP hatasında döngüyü kır. data boş gelirken hasMore === true ise bu bir platform anomalisidir — sonsuz döngüye girme; tekrar deneme/çık.name, phone, address) yalnız customers:read VE kullanıcı consent'i (dataConsent.piiShared — katı boolean true; 1/"true"/"yes" reddedilir) birlikte varsa döner. Consent yoksa HER öğe { id, region }'a iner — bu indirgeme yalnız PII'yi değil, finansal total alanını da düşürür (allowlist { id, region }). Alanları undefined varsay. region kaba coğrafidir (PII değil, consent'siz de akar). Bu, webhook customer redaction'ı ile birebir aynı kuraldır.| Durum | HTTP | message |
|---|---|---|
| Scope yok | 403 | plugin.scope.denied |
| Geçersiz/eksik key | 401 | unauthorized |
Rate limit aşıldı (+Retry-After) | 429 | plugin.rateLimited |
| Sunucu hatası | 500 | internal |
Her yanıt X-RateLimit-* başlıkları taşır (X-RateLimit-Limit/-Remaining/-Reset; 429'da ayrıca Retry-After) — bkz. Limitler & Kotalar.