Ana içeriğe geç

POST /backend/landing/token — Landing Page Token Exchange

📋 Genel Bilgi

Müşteri doğrulama linkini açtıktan sonra, authorization_code ile token exchange yapılır ve müşteri bilgisi döner.

Base URL: {{wentro}}/backend/landing/token Method: POST Content-Type: application/json


🔐 Headers

HeaderValue
Content-Typeapplication/json

📥 Request Body

{
"grant_type": "authorization_code",
"code": "{{auth_code}}",
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}",
"redirect_uri": "https://example.com/callback"
}

Parametreler

AlanTipZorunluAçıklamaÖrnek
grant_typestringGrant türü (sabit: authorization_code)"authorization_code"
codestringAuthorization code"{{auth_code}}"
client_idstringOAuth client ID"{{client_id}}"
client_secretstringOAuth client secret-
redirect_uristringYönlendirme URI'si (registered)"https://example.com/callback"

✅ Response — 200 OK

{
"success": true,
"context": {
"requestId": "e423339b-620e-4c5f-bdeb-bc3e627e2c68",
"timestamp": "2026-07-13T12:43:02.132Z",
"ip": "127.0.0.1",
"deviceContext": {
"deviceName": "Desktop Computer",
"deviceVendor": "",
"deviceModel": "",
"deviceType": "desktop",
"osName": "Windows",
"osVersion": "10",
"browserName": "Chrome",
"browserVersion": "150.0.0.0",
"cpuArchitecture": "amd64"
},
"ipContext": {
"country": null,
"countryCode": null,
"city": null,
"region": null,
"regionCode": null,
"latitude": null,
"longitude": null,
"timezone": null,
"postalCode": null,
"accuracyRadius": null
}
},
"referanceId": "",
"parsedAt": "2026-07-13T12:43:02.132Z",
"code": "{{auth_code}}",
"msisdn": "{{customer_msisdn}}",
"status": "verified",
"verifiedAt": "2026-07-13 15:43:03"
}

Response Alanları

AlanTipAçıklama
successbooleanDoğrulama sonucu
context.requestIdstringİstek benzersiz ID (UUID)
context.timestampstringİşlem zamanı (ISO 8601)
context.ipstringİstemci IP adresi
context.deviceContextobjectCihaz detayları
context.ipContextobjectCoğrafi konum bilgisi (null: localhost)
referanceIdstringİşlem referans ID'si (EFT-98765)
parsedAtstringİşlem zamanı (ISO 8601)
codestringAuthorization code
msisdnstringMüşteri telefon numarası
statusstringDurum (verified)
verifiedAtstringDoğrulama zamanı (YYYY-MM-DD HH:mm:ss)

✅ Response — 200 OK (IVT ile)

{
"success": true,
"context": {
"requestId": "89d4d1b5-2f2d-4d3b-b20b-16fc8444f131",
"timestamp": "2026-07-19T13:17:03.303Z",
"ip": "{{customer_ip}}",
"deviceContext": {
"deviceName": "Desktop Computer",
"deviceVendor": "",
"deviceModel": "",
"deviceType": "desktop",
"osName": "Windows",
"osVersion": "10",
"browserName": "Chrome",
"browserVersion": "150.0.0.0",
"cpuArchitecture": "amd64"
},
"ipContext": {
"country": "Türkiye",
"countryCode": "TR",
"city": "Küçükçekmece",
"region": "Istanbul",
"regionCode": "34",
"latitude": {{customer_latitude}},
"longitude": {{customer_longitude}},
"timezone": "Europe/Istanbul",
"postalCode": "{{customer_postal_code}}",
"accuracyRadius": 500
}
},
"parsedAt": "2026-07-19T13:17:03.303Z",
"referanceId": "EFT-98765",
"code": "{{auth_code}}",
"msisdn": "{{customer_msisdn}}",
"status": "verified",
"verifiedAt": "2026-07-19 16:17:03",
"ivt": {
"etk": {
"sms": 1,
"call": 1,
"email": 1,
"share": 1
},
"kvkk": {
"process": 1,
"share": 1,
"international": 1
},
"loyalty": -1
}
}

IVT Response Alanları

AlanTipAçıklama
ivt.etk.smsintegerSMS onayı (1: onaylı, -1: onaysız)
ivt.etk.callintegerCall onayı (1: onaylı, -1: onaysız)
ivt.etk.emailintegerEmail onayı (1: onaylı, -1: onaysız)
ivt.etk.shareintegerShare onayı (1: onaylı, -1: onaysız)
ivt.kvkk.processintegerKVKK process onayı (1: onaylı, -1: onaysız)
ivt.kvkk.shareintegerKVKK share onayı (1: onaylı, -1: onaysız)
ivt.kvkk.internationalintegerKVKK international onayı (1: onaylı, -1: onaysız)
ivt.loyaltyintegerSadakat puanı (-1: bilinmiyor)

❌ Error Responses

⚠️ Önemli: Bu endpoint, AppError/Response+Success:false formatını kullanmıyor. OAuth2 spesifikasyonuna uygun standart error/error_description formatını kullanıyor:

{
"error": "invalid_grant",
"error_description": "Geçersiz yetkilendirme kodu"
}
errorerror_descriptionNe Zaman Oluşur
invalid_requestGerekli parametreler eksik: grant_type, code, client_id, client_secretgrant_type, code, client_id veya client_secret alanlarından biri boş
unsupported_grant_typeDesteklenmeyen grant_type. Sadece 'authorization_code' destekleniyor.grant_type değeri authorization_code dışında bir şey
invalid_clientClient bulunamadıGönderilen client_id'ye karşılık gelen bir OAuth client kaydı yok
invalid_grantRedirect URI uyuşmuyorGönderilen redirect_uri, client'ta kayıtlı redirect_uri ile eşleşmiyor
invalid_clientGeçersiz client_secretclient_secret yanlış
invalid_grantGeçersiz yetkilendirme koducode'a karşılık gelen bir landing_auth_logs kaydı bulunamadı
invalid_grantYetkilendirme Linki henüz kullanılmamışMüşteri, landing page linkini henüz açıp onaylamamış (status hâlâ pending) — token exchange, ancak müşteri linki açıp doğruladıktan (verified) sonra yapılabilir
invalid_grantYetkilendirme kodu bu client için geçerli değilcode, farklı bir client_id için üretilmiş

📝 Notlar

  • Bu endpoint landing page doğrulama akışının son adımındadır.
  • referanceId alanı auth request'inde gönderilen reference_id değeridir.
  • status: verified → Müşteri başarıyla doğrulanmıştır.
  • IVT response'ta etk ve kvkk onay durumları bulunur.