Belge Şeması
Hangi belgenin kimden isteneceğini tanımlayan on uç: alan havuzu ve onu kullanan filtreler.
Genel Bakış
Belge şeması iki katmandır. Alanlar paylaşılan bir havuzdur — "kimlik fotokopisi", "vergi levhası" gibi tek tek girdiler. Filtreler bu havuzdan bir küme seçer ve o kümenin kimden isteneceğini söyleyen kuralları taşır.
Aynı alan birden çok filtrede kullanılabilir; havuz bunun içindir. Bir alanı güncellemek onu kullanan bütün filtreleri aynı anda etkiler.
Referans
Filtreleri Listeleme
Tanımlı belge filtrelerini döndürür. Her filtre bir alan kümesi ve o kümenin kimden isteneceğini söyleyen kurallar taşır.
active ya da inactive.active ya da inactive.email_provider, vpn_proxy, account_age, service_count, total_spending, country_mismatch, country.yes, sayısal eşik ya da ülke kimliği. extra değeri between olan age kuralı 18-30 gibi uçları dahil bir aralık alır; başka bir değer rule_value_invalid ile reddedilir.curl -G 'https://panel.ornek.com/api/v1/admin/clients/document-filters' \
-H "Authorization: Bearer $API_KEY" \
-d status=activeconst url = new URL('https://panel.ornek.com/api/v1/admin/clients/document-filters');
url.searchParams.set('status', 'active');
const res = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
const body = await res.json();$url = 'https://panel.ornek.com/api/v1/admin/clients/document-filters?' . http_build_query(['status' => 'active']);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetDocumentFilters([], ['status' => 'active']);Filtre Ekleme
Yeni bir filtre tanımlar. Alan kimlikleri havuzda var olmalıdır.
[3, 1].false; filtre inactive doğar.email_provider, vpn_proxy, account_age, service_count, total_spending, country_mismatch, country.yes, sayısal eşik ya da ülke kimliği. extra değeri between olan age kuralı 18-30 gibi uçları dahil bir aralık alır; başka bir değer rule_value_invalid ile reddedilir.active ya da inactive. active göndermediyseniz yeni filtre pasif doğar.type / value / extra şeklinin aynısı.name boş.fields boş ya da geçersiz.curl -X POST 'https://panel.ornek.com/api/v1/admin/clients/document-filters' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"Yuksek harcama","fields":[3,1],"active":true,"rules":[{"type":"total_spending","value":"5000","extra":""}]}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-filters', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"Yuksek harcama","fields":[3,1],"active":true,"rules":[{"type":"total_spending","value":"5000","extra":""}]}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-filters');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Yuksek harcama',
'fields' => [3, 1],
'active' => true,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->CreateDocumentFilter([
'name' => 'Yuksek harcama',
'fields' => [3, 1],
'active' => true,
'rules' => [
['type' => 'total_spending', 'value' => '5000', 'extra' => ''],
],
]);Filtre Detayı
Tek bir filtreyi döndürür; şema listedekiyle aynıdır.
active ya da inactive.type / value / extra şeklinin aynısı.curl 'https://panel.ornek.com/api/v1/admin/clients/document-filters/7' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-filters/7', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-filters/7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetDocumentFilter(['fid' => 7]);Filtre Güncelleme
Filtrenin adını, alan sırasını, durumunu ya da kurallarını değiştirir.
active ya da inactive.name boş gönderildi.fields boş ya da geçersiz gönderildi.curl -X PATCH 'https://panel.ornek.com/api/v1/admin/clients/document-filters/7' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"active":false}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-filters/7', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ active: false }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-filters/7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['active' => false]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->UpdateDocumentFilter([
'fid' => 7,
'active' => false,
]);Filtre Silme
Filtreyi siler. Alan havuzuna dokunmaz; alanlar başka filtrelerde durmaya devam eder.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/clients/document-filters/7' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-filters/7', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-filters/7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->DeleteDocumentFilter(['fid' => 7]);Alanları Listeleme
Paylaşılan alan havuzunu döndürür. Filtreler alanlarını buradan seçer.
active ya da inactive.fields listesi buraya işaret eder.active ya da inactive. Pasif alan müşteriye gösterilmez.input, textarea, selectbox, radio, checkbox, file.{"tr": "Kimlik fotokopisi"}.file tipinde.file tipinde.[{ id, name }].curl -G 'https://panel.ornek.com/api/v1/admin/clients/document-fields' \
-H "Authorization: Bearer $API_KEY" \
-d type=fileconst url = new URL('https://panel.ornek.com/api/v1/admin/clients/document-fields');
url.searchParams.set('type', 'file');
const res = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
const body = await res.json();$url = 'https://panel.ornek.com/api/v1/admin/clients/document-fields?' . http_build_query(['type' => 'file']);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetDocumentFields([], ['type' => 'file']);Alan Ekleme
Havuza yeni bir alan ekler. Etiket en az bir dilde verilmelidir.
true.file tipinde.file tipine özgü.active ya da inactive.type izinli giriş tiplerinden değil.curl -X POST 'https://panel.ornek.com/api/v1/admin/clients/document-fields' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"type":"file","labels":{"tr":"Kimlik fotokopisi","en":"ID copy"},"allowed_ext":"jpg,png,pdf","max_size":5}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-fields', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'file',
labels: {"tr":"Kimlik fotokopisi","en":"ID copy"},
allowed_ext: 'jpg,png,pdf',
max_size: 5,
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-fields');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'file',
'labels' => ['tr' => 'Kimlik fotokopisi', 'en' => 'ID copy'],
'allowed_ext' => 'jpg,png,pdf',
'max_size' => 5,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->CreateDocumentField([
'type' => 'file',
'labels' => ['tr' => 'Kimlik fotokopisi', 'en' => 'ID copy'],
'allowed_ext' => 'jpg,png,pdf',
'max_size' => 5,
]);Alan Detayı
Tek bir alanı döndürür. used_in ile hangi filtrelerde kullanıldığı da gelir.
fields listesi buraya işaret eder.active ya da inactive. Pasif alan, bir filtre onu hâlâ listelese bile müşteriye gösterilmez.input, textarea, selectbox, radio, checkbox, file.{ "en": "Passport copy" }.file tipine özgü.file tipine özgü.{ id, name } biçiminde. Silmeden önce okuyun — hepsi bu alanı kaybeder.curl 'https://panel.ornek.com/api/v1/admin/clients/document-fields/3' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-fields/3', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-fields/3');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetDocumentField(['fid' => 3]);
// Silmeden önce: bu alan hangi filtrelerde duruyor?
$usedIn = $response['data']['used_in'] ?? [];Alan Güncelleme
Alanı günceller. Değişiklik onu kullanan bütün filtrelere aynı anda yansır.
true.file tipinde.file tipine özgü.active ya da inactive.type izinli giriş tiplerinden değil.curl -X PATCH 'https://panel.ornek.com/api/v1/admin/clients/document-fields/3' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"max_size":10}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-fields/3', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ max_size: 10 }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-fields/3');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['max_size' => 10]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->UpdateDocumentField([
'fid' => 3,
'max_size' => 10,
]);Alan Silme
Alanı havuzdan siler.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/clients/document-fields/3' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/document-fields/3', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/document-fields/3');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->DeleteDocumentField(['fid' => 3]);Tuzaklar
fields bir küme değil, sıralı bir listedir; müşteri alanları o sırada görür. Güncellerken gönderdiğiniz liste eskisinin yerine geçer, üstüne eklenmez.
Bir alanı güncellemek ya da silmek onu kullanan her filtreyi etkiler. Silmeden önce alan detayındaki used_in listesine bakın.
active göndermezseniz filtre inactive oluşur ve kimseden belge istemez. Kurup unutmak, çalışmayan bir doğrulama bırakır.
İlgili Makaleler
Geri bildiriminiz için teşekkürler!
Yukarıda bulamadığınız her şey için destek ekibimiz her zaman yanınızda.