Başlarken
API kullanmaya başlamak için önce bir API anahtarı oluşturmanız gerekir. Parsek uygulamasında Ayarlar → API Anahtarları bölümünden (yalnızca admin/super_admin) yeni bir anahtar üretebilirsiniz. Anahtar pk_ ön ekiyle başlar ve yalnızca oluşturulduğu anda tam görünür.
Kimlik Doğrulama
Tüm /v1/* istekleri, her istekte X-API-Key header’ı ile kimlik doğrular. Anahtar yönetimi endpoint’leri ise uygulama oturumunun Authorization: Bearer <token> header’ını kullanır. Her anahtar yalnızca kendisine tanımlı izinlere (scope) erişir; yetersiz izinde 403 insufficient_scope döner. Anahtarlar sunucuda hash’lenerek saklanır ve yalnızca oluşturulduğunda bir kez gösterilir.
Rate Limit
Her API anahtarının dakikalık istek limiti vardır (varsayılan 60 istek/dakika, anahtar oluştururken rate_limit ile ayarlanır). Her yanıtta X-RateLimit-Limit ve X-RateLimit-Remaining header’ları döner; limit aşıldığında 429 + Retry-After alırsınız. Tarayıcı tabanlı çağrılar için anahtara allowed_domains (origin whitelist) tanımlayabilirsiniz.
Hata Kodları
| Kod | Açıklama |
|---|---|
200 | Başarılı |
400 | Hatalı istek — eksik/geçersiz parametre |
401 | Yetkisiz — geçersiz veya eksik API anahtarı |
403 | Yasak — origin izinli değil / yetersiz yetki |
404 | Kaynak bulunamadı |
429 | İstek limiti aşıldı |
500 | Sunucu hatası |
Endpoint Referansı Aktif
Faturalar
/api/external/v1/invoices
X-API-Key
scope: einvoice
Fatura oluştur (opsiyonel anında gönder)
Yeni bir e-Arşiv/e-Fatura taslağı oluşturur. `send_immediately: true` verilirse fatura anında gönderilir.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
send_immediately | boolean | Hayır | true ise fatura anında gönderilir |
customer | object | Evet | Alıcı bilgileri (name zorunlu; vkn veya tckn) |
lines | array | Evet | Fatura kalemleri (en az 1) |
invoice_type | string | Hayır | Fatura tipi (varsayılan 'SATIS') |
currency | string | Hayır | Para birimi (varsayılan 'TRY') |
issue_date | string (date) | Hayır | Fatura tarihi YYYY-MM-DD (varsayılan bugün) |
notes | array | Hayır | Fatura notları |
curl -X POST "https://api.parsekpro.com/api/external/v1/invoices" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"send_immediately":false,"customer":{"name":"Örnek Müşteri A.Ş.","vkn":"1234567890","email":"[email protected]","tax_office":"Kadıköy","address":{"city":"İstanbul","country":"Türkiye"}},"lines":[{"name":"Danışmanlık Hizmeti","quantity":1,"unit_price":1000,"tax_percent":20,"unit_code":"C62"}],"invoice_type":"SATIS","currency":"TRY"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"send_immediately": false,
"customer": {
"name": "Örnek Müşteri A.Ş.",
"vkn": "1234567890",
"email": "[email protected]",
"tax_office": "Kadıköy",
"address": {
"city": "İstanbul",
"country": "Türkiye"
}
},
"lines": [
{
"name": "Danışmanlık Hizmeti",
"quantity": 1,
"unit_price": 1000,
"tax_percent": 20,
"unit_code": "C62"
}
],
"invoice_type": "SATIS",
"currency": "TRY"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/invoices",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"send_immediately": False,
"customer": {
"name": "Örnek Müşteri A.Ş.",
"vkn": "1234567890",
"email": "[email protected]",
"tax_office": "Kadıköy",
"address": {
"city": "İstanbul",
"country": "Türkiye"
}
},
"lines": [
{
"name": "Danışmanlık Hizmeti",
"quantity": 1,
"unit_price": 1000,
"tax_percent": 20,
"unit_code": "C62"
}
],
"invoice_type": "SATIS",
"currency": "TRY"
}
)
print(resp.json())
{
"success": true,
"invoice": {
"id": "9f1c2b7e-...",
"status": "draft",
"payable_amount": 1200
}
}/api/external/v1/invoices
X-API-Key
scope: einvoice
Faturaları listele
Şirkete ait faturaları sayfalı olarak listeler. `direction` ve `status` ile filtrelenebilir.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
direction | string | query | Hayır | 'outbound' / 'inbound' |
status | string | query | Hayır | Durum (draft, sent, error…) |
page | integer | query | Hayır | Sayfa (0 tabanlı, varsayılan 0) |
limit | integer | query | Hayır | Sayfa boyutu (varsayılan 20) |
curl -X GET "https://api.parsekpro.com/api/external/v1/invoices" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/invoices",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "9f1c2b7e-...",
"invoice_number": "PSK2026000000123",
"direction": "outbound",
"status": "sent",
"issue_date": "2026-02-10",
"customer_name": "Örnek Müşteri A.Ş.",
"payable_amount": 1200,
"tax_amount": 200
}
],
"total": 42,
"page": 0,
"limit": 20
}/api/external/v1/invoices/{id}
X-API-Key
scope: einvoice
Fatura detayı
Tek bir faturanın tüm alanlarını döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Fatura ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/invoices/{id}" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices/{id}", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/invoices/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"id": "9f1c2b7e-...",
"invoice_number": "PSK2026000000123",
"status": "sent",
"payable_amount": 1200,
"lines": [
{
"name": "Danışmanlık Hizmeti",
"quantity": 1,
"unitPrice": 1000,
"taxPercent": 20
}
]
}/api/external/v1/invoices/{id}/status
X-API-Key
scope: einvoice
Fatura durumu sorgula
Faturanın güncel durum kodunu ve mesajını döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Fatura ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/invoices/{id}/status" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices/{id}/status", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/invoices/{id}/status",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"id": "9f1c2b7e-...",
"invoice_uuid": "A1B2C3-...",
"status": "sent",
"status_code": 100,
"status_message": null
}/api/external/v1/invoices/{id}/pdf
X-API-Key
scope: einvoice
Fatura PDF indir
Faturanın PDF çıktısını (application/pdf) döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Fatura ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/invoices/{id}/pdf" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices/{id}/pdf", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/invoices/{id}/pdf",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
application/pdf (binary)/api/external/v1/invoices/{id}/cancel
X-API-Key
scope: einvoice
e-Arşiv fatura iptal
Yalnızca e-Arşiv (EARSIVFATURA) senaryosundaki faturalar iptal edilebilir.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Fatura ID |
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
cancel_date | string (date) | Hayır | İptal tarihi (varsayılan bugün) |
curl -X POST "https://api.parsekpro.com/api/external/v1/invoices/{id}/cancel" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"cancel_date":"2026-02-11"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/invoices/{id}/cancel", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"cancel_date": "2026-02-11"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/invoices/{id}/cancel",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"cancel_date": "2026-02-11"
}
)
print(resp.json())
{
"success": true,
"result": {}
}Yardımcılar
/api/external/v1/check-einvoice-user
X-API-Key
scope: einvoice
e-Fatura mükellefi kontrolü
Verilen VKN/TCKN’nin GİB e-Fatura mükellefi olup olmadığını kontrol eder.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
vkn | string | Hayır | Vergi Kimlik No |
tckn | string | Hayır | TC Kimlik No |
curl -X POST "https://api.parsekpro.com/api/external/v1/check-einvoice-user" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"vkn":"1234567890"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/check-einvoice-user", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"vkn": "1234567890"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/check-einvoice-user",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"vkn": "1234567890"
}
)
print(resp.json())
{
"is_einvoice_user": true
}Cari Hesaplar
/api/external/v1/current-accounts
X-API-Key
scope: current_accounts:read
Cari hesapları listele
Şirkete ait cari hesapları sayfalı listeler. Filtreler: `account_type` (CUSTOMER/VENDOR/SUBCONTRACTOR/EMPLOYEE), `status` (ACTIVE/PASSIVE), `q` (ad/kod arama), `updated_since` (delta senkron).
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
account_type | string | query | Hayır | CUSTOMER/VENDOR/SUBCONTRACTOR/EMPLOYEE |
status | string | query | Hayır | ACTIVE / PASSIVE |
q | string | query | Hayır | Ad/kod araması |
updated_since | string (ISO8601) | query | Hayır | Bu tarihten sonra güncellenenler |
page | integer | query | Hayır | Sayfa (0 tabanlı) |
limit | integer | query | Hayır | Sayfa boyutu (max 100) |
curl -X GET "https://api.parsekpro.com/api/external/v1/current-accounts" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/current-accounts",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"account_code": "MUS-00001",
"account_name": "Örnek Müşteri A.Ş.",
"account_type": "CUSTOMER",
"balance": 12500,
"base_currency": "TRY",
"status": "ACTIVE"
}
],
"total": 42,
"page": 0,
"limit": 20
}/api/external/v1/current-accounts/{id}
X-API-Key
scope: current_accounts:read
Cari hesap detayı
Tek bir cari hesabın tüm alanlarını döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Cari hesap ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/current-accounts/{id}" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts/{id}", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/current-accounts/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"id": "uuid",
"account_code": "MUS-00001",
"account_name": "Örnek Müşteri A.Ş.",
"account_type": "CUSTOMER",
"tax_number": "1234567890",
"iban": "TR..",
"balance": 12500,
"base_currency": "TRY",
"status": "ACTIVE"
}/api/external/v1/current-accounts
X-API-Key
scope: current_accounts:write
Cari hesap oluştur
Yeni cari hesap oluşturur. `account_code` verilmezse tipe göre otomatik üretilir (MUS/TED/TAS/PER). `Idempotency-Key` header desteklenir.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
account_name | string | Evet | Cari adı |
account_type | string | Evet | CUSTOMER/VENDOR/SUBCONTRACTOR/EMPLOYEE |
account_code | string | Hayır | Boşsa otomatik üretilir |
tax_number | string | Hayır | VKN/TCKN |
tax_office | string | Hayır | Vergi dairesi |
email | string | Hayır | E-posta |
phone | string | Hayır | Telefon |
iban | string | Hayır | IBAN |
base_currency | string | Hayır | Para birimi (varsayılan TRY) |
curl -X POST "https://api.parsekpro.com/api/external/v1/current-accounts" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"account_name":"Örnek Müşteri A.Ş.","account_type":"CUSTOMER","tax_number":"1234567890","email":"[email protected]","base_currency":"TRY"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"account_name": "Örnek Müşteri A.Ş.",
"account_type": "CUSTOMER",
"tax_number": "1234567890",
"email": "[email protected]",
"base_currency": "TRY"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/current-accounts",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"account_name": "Örnek Müşteri A.Ş.",
"account_type": "CUSTOMER",
"tax_number": "1234567890",
"email": "[email protected]",
"base_currency": "TRY"
}
)
print(resp.json())
{
"id": "uuid",
"account_code": "MUS-00007",
"account_name": "Örnek Müşteri A.Ş.",
"account_type": "CUSTOMER",
"status": "ACTIVE",
"base_currency": "TRY"
}/api/external/v1/current-accounts/{id}
X-API-Key
scope: current_accounts:write
Cari hesap güncelle
Verilen alanları günceller (yalnızca izinli alanlar).
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Cari hesap ID |
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
account_name | string | Hayır | Cari adı |
phone | string | Hayır | Telefon |
status | string | Hayır | ACTIVE/PASSIVE |
curl -X PUT "https://api.parsekpro.com/api/external/v1/current-accounts/{id}" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"phone":"05551112233","status":"PASSIVE"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts/{id}", {
method: "PUT",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"phone": "05551112233",
"status": "PASSIVE"
})
});
const data = await res.json();
import requests
resp = requests.put(
"https://api.parsekpro.com/api/external/v1/current-accounts/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"phone": "05551112233",
"status": "PASSIVE"
}
)
print(resp.json())
{
"id": "uuid",
"account_code": "MUS-00001",
"phone": "05551112233",
"status": "PASSIVE"
}/api/external/v1/current-accounts/{id}/balance
X-API-Key
scope: current_accounts:read
Cari hesap bakiyesi
Borç/alacak/net bakiye ve çoklu para birimi bakiyelerini döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Cari hesap ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/current-accounts/{id}/balance" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts/{id}/balance", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/current-accounts/{id}/balance",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"account_id": "uuid",
"debit_balance": 30000,
"credit_balance": 17500,
"balance": 12500,
"balance_base": 12500,
"base_currency": "TRY",
"balances": {
"TRY": 12500
}
}/api/external/v1/current-accounts/{id}/transactions
X-API-Key
scope: current_accounts:read
Cari hesap hareketleri
Cari hesabın hareketlerini sayfalı döndürür. `from`/`to` tarih filtresi.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Cari hesap ID |
from | string (date) | query | Hayır | Başlangıç tarihi |
to | string (date) | query | Hayır | Bitiş tarihi |
curl -X GET "https://api.parsekpro.com/api/external/v1/current-accounts/{id}/transactions" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/current-accounts/{id}/transactions", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/current-accounts/{id}/transactions",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"transaction_date": "2026-02-10",
"transaction_type": "DEBIT",
"amount": 1200,
"currency_code": "TRY",
"description": "Fatura",
"document_number": "PSK2026..."
}
],
"total": 12,
"page": 0,
"limit": 20
}Stok & Depo
/api/external/v1/products
X-API-Key
scope: inventory:read
Ürün/malzeme kataloğu
Malzeme kataloğunu listeler. Filtreler: `q` (ad arama), `material_type`, `updated_since`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
q | string | query | Hayır | Ad araması |
material_type | string | query | Hayır | CONSUMABLE / USABLE |
updated_since | string (ISO8601) | query | Hayır | Delta senkron |
page | integer | query | Hayır | Sayfa |
limit | integer | query | Hayır | Boyut (max 100) |
curl -X GET "https://api.parsekpro.com/api/external/v1/products" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/products", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/products",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"name": "Çimento CEM I 42.5",
"material_type": "CONSUMABLE",
"minimum_stock_level": 100,
"current_avg_cost": 250,
"sale_price": 300,
"default_currency": "TRY"
}
],
"total": 128,
"page": 0,
"limit": 20
}/api/external/v1/products/{id}
X-API-Key
scope: inventory:read
Ürün/malzeme detayı
Tek bir malzemenin tüm alanlarını döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Malzeme ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/products/{id}" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/products/{id}", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/products/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"id": "uuid",
"name": "Çimento CEM I 42.5",
"material_type": "CONSUMABLE",
"current_avg_cost": 250,
"total_stock_value": 32000
}/api/external/v1/inventory/levels
X-API-Key
scope: inventory:read
Stok seviyeleri
Depo/şube bazında güncel stok seviyeleri. Filtreler: `material_id`, `branch_id`, `warehouse_location_id`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
material_id | string (uuid) | query | Hayır | Malzeme filtresi |
branch_id | string (uuid) | query | Hayır | Şube filtresi |
warehouse_location_id | string (uuid) | query | Hayır | Depo filtresi |
curl -X GET "https://api.parsekpro.com/api/external/v1/inventory/levels" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/inventory/levels", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/inventory/levels",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"material_id": "uuid",
"material_name": "Çimento CEM I 42.5",
"branch_id": "uuid",
"warehouse_location_id": "uuid",
"current_quantity": 450,
"total_incoming": 900,
"total_outgoing": 450
}
],
"total": 12,
"page": 0,
"limit": 20
}/api/external/v1/inventory/movements
X-API-Key
scope: inventory:read
Stok hareketleri
Stok hareketlerini listeler. Filtreler: `material_id`, `branch_id`, `transaction_type`, `from`/`to`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
material_id | string (uuid) | query | Hayır | Malzeme |
transaction_type | string | query | Hayır | IN/OUT/ADJUSTMENT… |
from | string (date) | query | Hayır | Başlangıç |
to | string (date) | query | Hayır | Bitiş |
curl -X GET "https://api.parsekpro.com/api/external/v1/inventory/movements" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/inventory/movements", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/inventory/movements",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"material_id": "uuid",
"transaction_type": "IN",
"quantity": 100,
"unit_price": 250,
"currency_code": "TRY",
"created_at": "2026-02-10T10:00:00Z"
}
],
"total": 340,
"page": 0,
"limit": 20
}/api/external/v1/warehouses
X-API-Key
scope: inventory:read
Depo/lokasyon listesi
Depo ve lokasyonları listeler. Filtreler: `branch_id`, `is_active`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
branch_id | string (uuid) | query | Hayır | Şube |
is_active | boolean | query | Hayır | Aktif filtresi |
curl -X GET "https://api.parsekpro.com/api/external/v1/warehouses" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/warehouses", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/warehouses",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"code": "DEPO-01",
"name": "Merkez Depo",
"location_path": "Merkez Depo",
"is_active": true
}
],
"total": 6,
"page": 0,
"limit": 20
}/api/external/v1/inventory/movements
X-API-Key
scope: inventory:write
Stok hareketi oluştur
Stok girişi/çıkışı/düzeltmesi. `transaction_type`: IN, OUT, ADJUSTMENT, COUNT_ADJUSTMENT. Stok seviyesi ve değerleme (FIFO/Ortalama) otomatik güncellenir. OUT’ta yetersiz stokta 409. `Idempotency-Key` desteklenir.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
material_id | string (uuid) | Evet | Malzeme ID |
transaction_type | string | Evet | IN/OUT/ADJUSTMENT/COUNT_ADJUSTMENT |
quantity | number | Evet | Miktar (pozitif) |
branch_id | string (uuid) | Hayır | Şube (lokasyon modu zorunlu) |
warehouse_location_id | string (uuid) | Hayır | Depo lokasyonu |
unit_price | number | Hayır | Birim fiyat (IN için değerleme) |
notes | string | Hayır | Not |
curl -X POST "https://api.parsekpro.com/api/external/v1/inventory/movements" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"material_id":"uuid","transaction_type":"IN","quantity":100,"unit_price":250,"notes":"Satın alma girişi"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/inventory/movements", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"material_id": "uuid",
"transaction_type": "IN",
"quantity": 100,
"unit_price": 250,
"notes": "Satın alma girişi"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/inventory/movements",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"material_id": "uuid",
"transaction_type": "IN",
"quantity": 100,
"unit_price": 250,
"notes": "Satın alma girişi"
}
)
print(resp.json())
{
"id": "uuid",
"material_id": "uuid",
"transaction_type": "IN",
"quantity": 100,
"unit_price": 250,
"currency_code": "TRY",
"created_at": "2026-02-10T10:00:00Z"
}Puantaj / PDKS
/api/external/v1/employees
X-API-Key
scope: attendance:read
Personel dizini (eşleştirme)
PDKS cihazlarının kart/sicil eşleştirmesi için personel dizinini döndürür. Filtreler: `q` (ad/sicil/kart arama), `status`, `branch_id`, `updated_since`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
q | string | query | Hayır | Ad / sicil / kart araması |
status | string | query | Hayır | active / passive |
updated_since | string (date) | query | Hayır | ISO8601 delta senkron |
curl -X GET "https://api.parsekpro.com/api/external/v1/employees" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/employees", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/employees",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"employee_number": "SICIL-9001",
"pdks_card_no": "CARD-001",
"first_name": "Ali",
"last_name": "Yılmaz",
"full_name": "Ali Yılmaz",
"tc_identity_no": "12345678901",
"branch_id": "uuid",
"status": "active"
}
],
"total": 42,
"page": 0,
"limit": 20
}/api/external/v1/attendance
X-API-Key
scope: attendance:read
Günlük puantaj kayıtları
Günlük puantaj kayıtlarını listeler. Filtreler: `employee_id`, `branch_id`, `status_code`, `date`, `from`/`to` (tarih).
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
employee_id | string (uuid) | query | Hayır | Personel |
status_code | string | query | Hayır | X/I/R/YG/DD/UI |
from | string (date) | query | Hayır | Başlangıç (YYYY-MM-DD) |
to | string (date) | query | Hayır | Bitiş (YYYY-MM-DD) |
curl -X GET "https://api.parsekpro.com/api/external/v1/attendance" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/attendance", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/attendance",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"employee_id": "uuid",
"date": "2026-02-10",
"status_code": "X",
"work_hours": 9.5,
"overtime_hours": 1.5,
"check_in_time": "2026-02-10T05:00:00Z",
"check_out_time": "2026-02-10T14:30:00Z",
"source": "pdks_api"
}
],
"total": 120,
"page": 0,
"limit": 20
}/api/external/v1/attendance/punches
X-API-Key
scope: attendance:read
Ham PDKS giriş/çıkış olayları
Cihazlardan gelen ham giriş/çıkış (punch) olaylarını döndürür (hata ayıklama/denetim). Filtreler: `employee_id`, `device_id`, `matched`, `from`/`to`.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
employee_id | string (uuid) | query | Hayır | Personel |
device_id | string | query | Hayır | Cihaz kimliği |
matched | boolean | query | Hayır | Eşleşme durumu |
curl -X GET "https://api.parsekpro.com/api/external/v1/attendance/punches" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/attendance/punches", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/attendance/punches",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"employee_id": "uuid",
"card_no": "CARD-001",
"device_id": "GATE-1",
"direction": "IN",
"punch_time": "2026-02-10T05:00:00Z",
"attendance_date": "2026-02-10",
"matched": true,
"source": "pdks_api"
}
],
"total": 240,
"page": 0,
"limit": 20
}/api/external/v1/attendance
X-API-Key
scope: attendance:write
PDKS puantaj push (punch veya günlük)
PDKS donanım/entegratörleri için iki mod: (1) `punches` — ham giriş/çıkış olayları push edilir; günlük puantaj (çalışma saati IN→OUT eşleştirmesiyle) otomatik hesaplanır; tekrar gönderim idempotenttir (dedup). (2) `records` — günlük puantaj doğrudan yazılır (`status_code`: X/I/R/YG/DD/UI). Personel `card_no`, `employee_number`, `tc_identity_no` veya `employee_id` ile eşleştirilir. Eşleşmeyenler `unmatched` içinde döner. `standard_daily_hours` (varsayılan 8) fazla mesai için baz alınır. `Idempotency-Key` desteklenir. Başarıda `attendance.recorded` webhook’u tetiklenir.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
punches | array | Hayır | Punch modu: [{ card_no|employee_id|employee_number|tc_identity_no, timestamp (ISO8601), direction? (IN/OUT), device_id? }] |
records | array | Hayır | Günlük mod: [{ card_no|employee_id|..., date (YYYY-MM-DD), status_code, work_hours?, overtime_hours?, note? }] |
standard_daily_hours | number | Hayır | Fazla mesai bazı (varsayılan 8) |
curl -X POST "https://api.parsekpro.com/api/external/v1/attendance" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"standard_daily_hours":8,"punches":[{"card_no":"CARD-001","timestamp":"2026-02-10T05:00:00Z","direction":"IN","device_id":"GATE-1"},{"card_no":"CARD-001","timestamp":"2026-02-10T14:30:00Z","direction":"OUT","device_id":"GATE-1"}]}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/attendance", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"standard_daily_hours": 8,
"punches": [
{
"card_no": "CARD-001",
"timestamp": "2026-02-10T05:00:00Z",
"direction": "IN",
"device_id": "GATE-1"
},
{
"card_no": "CARD-001",
"timestamp": "2026-02-10T14:30:00Z",
"direction": "OUT",
"device_id": "GATE-1"
}
]
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/attendance",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"standard_daily_hours": 8,
"punches": [
{
"card_no": "CARD-001",
"timestamp": "2026-02-10T05:00:00Z",
"direction": "IN",
"device_id": "GATE-1"
},
{
"card_no": "CARD-001",
"timestamp": "2026-02-10T14:30:00Z",
"direction": "OUT",
"device_id": "GATE-1"
}
]
}
)
print(resp.json())
{
"mode": "punch",
"punches_received": 2,
"punches_inserted": 2,
"punches_skipped_duplicate": 0,
"attendance_upserted": 1,
"unmatched": []
}Webhooks
/api/external/v1/webhooks
X-API-Key
scope: webhooks:manage
Webhook uçlarını listele
Şirkete ait aktif/pasif webhook uçlarını ve abone olunabilecek event kataloğunu (`available_events`) döndürür.
curl -X GET "https://api.parsekpro.com/api/external/v1/webhooks" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/webhooks",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"url": "https://ornek.com/webhook",
"events": [
"invoice.status_changed",
"payment.received"
],
"is_active": true,
"secret_masked": "whsec_…a1b2"
}
],
"available_events": [
"current_account.created",
"current_account.updated",
"inventory.movement.created",
"inventory.low_stock",
"invoice.status_changed",
"payment.received",
"attendance.recorded",
"webhook.test"
]
}/api/external/v1/webhooks/{id}
X-API-Key
scope: webhooks:manage
Webhook detayı
Tek bir webhook ucunun detayını döndürür (secret maskeli).
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
curl -X GET "https://api.parsekpro.com/api/external/v1/webhooks/{id}" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"id": "uuid",
"url": "https://ornek.com/webhook",
"events": [
"payment.received"
],
"is_active": true,
"secret_masked": "whsec_…a1b2"
}/api/external/v1/webhooks
X-API-Key
scope: webhooks:manage
Webhook oluştur
Yeni bir webhook ucu ekler. Yalnızca `https://` genel adresler kabul edilir (özel/iç IP’ler SSRF koruması ile reddedilir). `secret` YALNIZCA oluşturmada bir kez tam döner — HMAC-SHA256 imza doğrulaması için saklayın.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
url | string (https) | Evet | Teslimat URL’i (yalnız https) |
events | array | Evet | Abone olunacak event(ler) |
description | string | Hayır | Açıklama |
curl -X POST "https://api.parsekpro.com/api/external/v1/webhooks" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://ornek.com/parsek-webhook","events":["invoice.status_changed","payment.received"],"description":"Muhasebe entegrasyonu"}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://ornek.com/parsek-webhook",
"events": [
"invoice.status_changed",
"payment.received"
],
"description": "Muhasebe entegrasyonu"
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/webhooks",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"url": "https://ornek.com/parsek-webhook",
"events": [
"invoice.status_changed",
"payment.received"
],
"description": "Muhasebe entegrasyonu"
}
)
print(resp.json())
{
"id": "uuid",
"url": "https://ornek.com/parsek-webhook",
"events": [
"invoice.status_changed",
"payment.received"
],
"is_active": true,
"secret": "whsec_9f1c2b7e...(yalnizca burada tam doner)"
}/api/external/v1/webhooks/{id}
X-API-Key
scope: webhooks:manage
Webhook güncelle
URL, event listesi, `is_active` (aktif/pasif) veya açıklamayı günceller. URL değişirse SSRF kontrolü tekrar uygulanır.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
url | string (https) | Hayır | Yeni URL |
events | array | Hayır | Yeni event listesi |
is_active | boolean | Hayır | Aktif/pasif |
description | string | Hayır | Açıklama |
curl -X PUT "https://api.parsekpro.com/api/external/v1/webhooks/{id}" \
-H "X-API-Key: pk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"is_active":false}'
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}", {
method: "PUT",
headers: {
'X-API-Key': 'pk_xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"is_active": false
})
});
const data = await res.json();
import requests
resp = requests.put(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" },
json={
"is_active": False
}
)
print(resp.json())
{
"id": "uuid",
"url": "https://ornek.com/parsek-webhook",
"events": [
"payment.received"
],
"is_active": false
}/api/external/v1/webhooks/{id}
X-API-Key
scope: webhooks:manage
Webhook sil
Webhook ucunu ve bağlı teslimat kayıtlarını siler.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
curl -X DELETE "https://api.parsekpro.com/api/external/v1/webhooks/{id}" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}", {
method: "DELETE",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.delete(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"success": true
}/api/external/v1/webhooks/{id}/test
X-API-Key
scope: webhooks:manage
Test teslimatı gönder
`webhook.test` olayını uca senkron gönderir ve sonucu (HTTP kodu, deneme sayısı) döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
curl -X POST "https://api.parsekpro.com/api/external/v1/webhooks/{id}/test" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}/test", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}/test",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"delivered": true,
"response_code": 200,
"error": null,
"attempts": 1
}/api/external/v1/webhooks/{id}/deliveries
X-API-Key
scope: webhooks:manage
Teslimat loglarını listele
Uca ait teslimat denemelerini (durum, deneme, HTTP kodu, hata) sayfalı döndürür. Hata ayıklama için.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
page | integer | query | Hayır | Sayfa (0 tabanlı) |
limit | integer | query | Hayır | Sayfa boyutu |
curl -X GET "https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries", {
method: "GET",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"data": [
{
"id": "uuid",
"event": "payment.received",
"status": "success",
"attempts": 1,
"response_code": 200,
"error": null,
"created_at": "2026-02-10T10:00:00Z"
}
],
"total": 12,
"page": 0,
"limit": 20
}/api/external/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver
X-API-Key
scope: webhooks:manage
Teslimatı yeniden gönder
Başarısız (veya herhangi bir) teslimatı deneme sayacını sıfırlayarak elle yeniden gönderir; sonucu senkron döndürür.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Webhook ID |
deliveryId | string (uuid) | path | Evet | Teslimat ID |
curl -X POST "https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver" \
-H "X-API-Key: pk_xxxxxxxx"
const res = await fetch("https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver", {
method: "POST",
headers: {
'X-API-Key': 'pk_xxxxxxxx'
}
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver",
headers={ "X-API-Key": "pk_xxxxxxxx" }
)
print(resp.json())
{
"delivered": true,
"response_code": 200,
"error": null,
"attempts": 1,
"will_retry": false
}API Anahtarları
/api/external/keys
Bearer
API anahtarlarını listele
Şirkete ait API anahtarlarını listeler (admin/super_admin). Anahtarlar maskeli döner.
curl -X GET "https://api.parsekpro.com/api/external/keys" \
-H "Authorization: Bearer <TOKEN>"
const res = await fetch("https://api.parsekpro.com/api/external/keys", {
method: "GET",
headers: {
'Authorization': 'Bearer <TOKEN>'
}
});
const data = await res.json();
import requests
resp = requests.get(
"https://api.parsekpro.com/api/external/keys",
headers={ "Authorization": "Bearer <TOKEN>" }
)
print(resp.json())
[
{
"id": "uuid",
"key_name": "Muhasebe Entegrasyonu",
"api_key_masked": "...a1b2c3d4",
"is_active": true,
"rate_limit": 60,
"request_count": 128
}
]/api/external/keys
Bearer
API anahtarı oluştur
Yeni bir API anahtarı üretir (pk_ ön ekli). Anahtar yalnızca oluşturulunca tam görünür.
İstek Gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
key_name | string | Hayır | Anahtar adı |
permissions | array | Hayır | İzinler (varsayılan ['einvoice']) |
rate_limit | integer | Hayır | Dakikalık limit (varsayılan 60) |
allowed_domains | array | Hayır | İzinli origin listesi (tarayıcıdan çağrı için) |
curl -X POST "https://api.parsekpro.com/api/external/keys" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"key_name":"Muhasebe Entegrasyonu","permissions":["einvoice"],"rate_limit":60}'
const res = await fetch("https://api.parsekpro.com/api/external/keys", {
method: "POST",
headers: {
'Authorization': 'Bearer <TOKEN>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key_name": "Muhasebe Entegrasyonu",
"permissions": [
"einvoice"
],
"rate_limit": 60
})
});
const data = await res.json();
import requests
resp = requests.post(
"https://api.parsekpro.com/api/external/keys",
headers={ "Authorization": "Bearer <TOKEN>" },
json={
"key_name": "Muhasebe Entegrasyonu",
"permissions": [
"einvoice"
],
"rate_limit": 60
}
)
print(resp.json())
{
"id": "uuid",
"api_key": "pk_9f...c3",
"message": "API anahtari olusturuldu. Bu anahtari guvenli bir yerde saklayin."
}/api/external/keys/{id}
Bearer
API anahtarı sil
Verilen API anahtarını siler.
Parametreler
| Alan | Tip | in | Zorunlu | Açıklama |
|---|---|---|---|---|
id | string (uuid) | path | Evet | Anahtar ID |
curl -X DELETE "https://api.parsekpro.com/api/external/keys/{id}" \
-H "Authorization: Bearer <TOKEN>"
const res = await fetch("https://api.parsekpro.com/api/external/keys/{id}", {
method: "DELETE",
headers: {
'Authorization': 'Bearer <TOKEN>'
}
});
const data = await res.json();
import requests
resp = requests.delete(
"https://api.parsekpro.com/api/external/keys/{id}",
headers={ "Authorization": "Bearer <TOKEN>" }
)
print(resp.json())
{
"success": true
}Webhooks Aktif
Parsek, abone olduğunuz olaylar gerçekleştiğinde HTTPS ucunuza giden POST istekleri gönderir. Uçları yukarıdaki Webhooks API ile yönetin.
Event kataloğu
| Event | Açıklama |
|---|---|
current_account.created | Yeni cari hesap oluşturuldu |
current_account.updated | Cari hesap güncellendi |
inventory.movement.created | Stok hareketi kaydedildi |
inventory.low_stock | Stok minimum seviyenin altına düştü |
invoice.status_changed | e-Fatura durumu değişti |
payment.received | Ödeme alındı (PayTR) |
webhook.test | Test teslimatı (manuel) |
Teslimat başlıkları
| Header | Açıklama |
|---|---|
X-Parsek-Event | Event adı |
X-Parsek-Delivery | Benzersiz teslimat ID’si |
X-Parsek-Timestamp | Unix zaman damgası (saniye) |
X-Parsek-Signature | t=<timestamp>,v1=<hmac_sha256> |
Payload yapısı
{
"id": "3f1c...",
"event": "payment.received",
"created": "2026-02-10T10:00:00.000Z",
"data": {
"merchant_oid": "SUB123",
"amount": 649,
"currency": "TL",
"request_type": "subscription",
"received_at": "2026-02-10T10:00:00.000Z"
}
}
İmza doğrulama (HMAC-SHA256)
const crypto = require('crypto');
// Express: gövdeyi HAM alın → express.raw({ type: 'application/json' })
function verifyParsekWebhook(req, secret) {
const header = req.headers['x-parsek-signature'] || ''; // 't=...,v1=...'
const parts = Object.fromEntries(header.split(',').map(p => p.split('=')));
const timestamp = parts.t, received = parts.v1;
const body = req.body.toString('utf8'); // ham JSON string
const expected = crypto.createHmac('sha256', secret)
.update(timestamp + '.' + body).digest('hex');
const ok = received && received.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
// Replay koruması: 5 dakikadan eski istekleri reddedin
const fresh = Math.abs(Date.now()/1000 - Number(timestamp)) < 300;
return ok && fresh;
}
Yeniden deneme & güvenilirlik
Başarısız teslimatlar (2xx dışı yanıt veya zaman aşımı) otomatik olarak 4 kez artan gecikmeyle (30sn, 2dk, 10dk, 30dk) yeniden denenir. Denemeleri teslimat log endpoint’inden inceleyebilir, redeliver endpoint’i ile elle yeniden gönderebilirsiniz. Yalnızca genel https adresleri kabul edilir (özel/iç IP’ler SSRF koruması ile engellenir).
Yakında Yakında
Aşağıdaki API’ler geliştirme aşamasındadır ve henüz canlı değildir. Yalnızca yukarıdaki “Aktif” endpoint’ler kullanılabilir.
ERP Veri API’si
Proje ve hakediş verilerine salt-okunur erişim.
İSG / İBYS API’si
Çalışan sağlık takibi, KKD zimmet ve İBYS bildirim entegrasyonu.
OSB API’si
Katılımcı firma, parsel, aidat tahakkuk ve altyapı sayaç verileri.