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
| Header | Value |
|---|---|
| Content-Type | application/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
| Alan | Tip | Zorunlu | Açıklama | Örnek |
|---|---|---|---|---|
grant_type | string | ✅ | Grant türü (sabit: authorization_code) | "authorization_code" |
code | string | ✅ | Authorization code | "{{auth_code}}" |
client_id | string | ✅ | OAuth client ID | "{{client_id}}" |
client_secret | string | ✅ | OAuth client secret | - |
redirect_uri | string | ✅ | Yö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ı
| Alan | Tip | Açıklama |
|---|---|---|
success | boolean | Doğrulama sonucu |
context.requestId | string | İstek benzersiz ID (UUID) |
context.timestamp | string | İşlem zamanı (ISO 8601) |
context.ip | string | İstemci IP adresi |
context.deviceContext | object | Cihaz detayları |
context.ipContext | object | Coğrafi konum bilgisi (null: localhost) |
referanceId | string | İşlem referans ID'si (EFT-98765) |
parsedAt | string | İşlem zamanı (ISO 8601) |
code | string | Authorization code |
msisdn | string | Müşteri telefon numarası |
status | string | Durum (verified) |
verifiedAt | string | Doğ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ı
| Alan | Tip | Açıklama |
|---|---|---|
ivt.etk.sms | integer | SMS onayı (1: onaylı, -1: onaysız) |
ivt.etk.call | integer | Call onayı (1: onaylı, -1: onaysız) |
ivt.etk.email | integer | Email onayı (1: onaylı, -1: onaysız) |
ivt.etk.share | integer | Share onayı (1: onaylı, -1: onaysız) |
ivt.kvkk.process | integer | KVKK process onayı (1: onaylı, -1: onaysız) |
ivt.kvkk.share | integer | KVKK share onayı (1: onaylı, -1: onaysız) |
ivt.kvkk.international | integer | KVKK international onayı (1: onaylı, -1: onaysız) |
ivt.loyalty | integer | Sadakat 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"
}
| error | error_description | Ne Zaman Oluşur |
|---|---|---|
invalid_request | Gerekli parametreler eksik: grant_type, code, client_id, client_secret | grant_type, code, client_id veya client_secret alanlarından biri boş |
unsupported_grant_type | Desteklenmeyen grant_type. Sadece 'authorization_code' destekleniyor. | grant_type değeri authorization_code dışında bir şey |
invalid_client | Client bulunamadı | Gönderilen client_id'ye karşılık gelen bir OAuth client kaydı yok |
invalid_grant | Redirect URI uyuşmuyor | Gönderilen redirect_uri, client'ta kayıtlı redirect_uri ile eşleşmiyor |
invalid_client | Geçersiz client_secret | client_secret yanlış |
invalid_grant | Geçersiz yetkilendirme kodu | code'a karşılık gelen bir landing_auth_logs kaydı bulunamadı |
invalid_grant | Yetkilendirme 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_grant | Yetkilendirme kodu bu client için geçerli değil | code, farklı bir client_id için üretilmiş |
📝 Notlar
- Bu endpoint landing page doğrulama akışının son adımındadır.
referanceIdalanı auth request'inde gönderilenreference_iddeğeridir.status: verified→ Müşteri başarıyla doğrulanmıştır.- IVT response'ta
etkvekvkkonay durumları bulunur.