cURL
curl -X POST https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token \
-H "Authorization: Bearer $PAYVEN_TOKEN" \
-H "Idempotency-Key: order-1001" \
-d '{ ...payload... }'const res = await fetch(
"https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Idempotency-Key": "order-1001",
"Content-Type": "application/json",
},
body: JSON.stringify({ /* payload */ }),
},
);
const data = await res.json();import httpx
res = httpx.post(
"https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token",
headers={
"Authorization": f"Bearer {access_token}",
"Idempotency-Key": "order-1001",
},
json={ ... },
)
data = res.json()var req = new HttpRequestMessage(HttpMethod.Post, "https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
req.Headers.Add("Idempotency-Key", "order-1001");
// Content = JsonContent.Create(payload);
var resp = await http.SendAsync(req);req, _ := http.NewRequest("POST", "https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token", nil)
req.Header.Set("Authorization", "Bearer "+accessToken)
req.Header.Set("Idempotency-Key", "order-1001")
// req.Body = bytes.NewReader(payloadJSON)
resp, _ := http.DefaultClient.Do(req)$ch = curl_init("https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken",
"Idempotency-Key: order-1001",
],
CURLOPT_POSTFIELDS => json_encode(\$payload),
]);
$data = json_decode(curl_exec($ch), true);HttpResponse<String> response = Unirest.post("https://identity-sandbox.payven.com.tr/api/v1/auth/{slug}/token")
.header("Content-Type", "application/json; ver=1.0")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity-sandbox.payven.com.tr/api/v1/auth/{slug}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json; ver=1.0'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"refresh_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"token_type": "<string>",
"scope": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "https://docs.payven.com.tr/errors/forbidden",
"title": "Yetki yok",
"status": 403,
"code": "forbidden",
"detail": "Bu rol bu kaynağı göremez."
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "https://docs.payven.com.tr/errors/idempotency_key_in_use",
"title": "Idempotency-Key çakışması",
"status": 409,
"code": "idempotency_key_in_use",
"detail": "Bu Idempotency-Key daha önce farklı bir istek gövdesi ile kullanıldı."
}{
"type": "https://docs.payven.com.tr/errors/bank_declined",
"title": "Banka işlemi reddetti",
"status": 422,
"code": "bank_declined",
"detail": "Yetersiz bakiye (banka kodu: 51)",
"provider_error_code": "51"
}{
"type": "https://docs.payven.com.tr/errors/rate_limit_exceeded",
"title": "İstek limiti aşıldı",
"status": 429,
"code": "rate_limit_exceeded"
}{
"type": "https://docs.payven.com.tr/errors/internal_server_error",
"title": "Sunucu hatası",
"status": 500,
"code": "internal_server_error"
}{
"type": "https://docs.payven.com.tr/errors/connector_unavailable",
"title": "Konnektör erişilemez",
"status": 503,
"code": "connector_unavailable"
}Auth
Access token al
OAuth 2.0 Client Credentials akışıyla yeni access token üretir.
Token cache’leyin — her API çağrısında yeniden almayın. Identity’de rate limit vardır (token endpoint’i IP başına dakikada 10). Token expire olmadan refresh ile yenileyin.
Detay: Kimlik Doğrulama.
POST
/
api
/
v1
/
auth
/
{slug}
/
token
cURL
curl -X POST https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token \
-H "Authorization: Bearer $PAYVEN_TOKEN" \
-H "Idempotency-Key: order-1001" \
-d '{ ...payload... }'const res = await fetch(
"https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Idempotency-Key": "order-1001",
"Content-Type": "application/json",
},
body: JSON.stringify({ /* payload */ }),
},
);
const data = await res.json();import httpx
res = httpx.post(
"https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token",
headers={
"Authorization": f"Bearer {access_token}",
"Idempotency-Key": "order-1001",
},
json={ ... },
)
data = res.json()var req = new HttpRequestMessage(HttpMethod.Post, "https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
req.Headers.Add("Idempotency-Key", "order-1001");
// Content = JsonContent.Create(payload);
var resp = await http.SendAsync(req);req, _ := http.NewRequest("POST", "https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token", nil)
req.Header.Set("Authorization", "Bearer "+accessToken)
req.Header.Set("Idempotency-Key", "order-1001")
// req.Body = bytes.NewReader(payloadJSON)
resp, _ := http.DefaultClient.Do(req)$ch = curl_init("https://identity-sandbox.payven.com.tr/api/v1/auth/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6/token");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken",
"Idempotency-Key: order-1001",
],
CURLOPT_POSTFIELDS => json_encode(\$payload),
]);
$data = json_decode(curl_exec($ch), true);HttpResponse<String> response = Unirest.post("https://identity-sandbox.payven.com.tr/api/v1/auth/{slug}/token")
.header("Content-Type", "application/json; ver=1.0")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity-sandbox.payven.com.tr/api/v1/auth/{slug}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json; ver=1.0'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"refresh_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"token_type": "<string>",
"scope": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "https://docs.payven.com.tr/errors/forbidden",
"title": "Yetki yok",
"status": 403,
"code": "forbidden",
"detail": "Bu rol bu kaynağı göremez."
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "https://docs.payven.com.tr/errors/idempotency_key_in_use",
"title": "Idempotency-Key çakışması",
"status": 409,
"code": "idempotency_key_in_use",
"detail": "Bu Idempotency-Key daha önce farklı bir istek gövdesi ile kullanıldı."
}{
"type": "https://docs.payven.com.tr/errors/bank_declined",
"title": "Banka işlemi reddetti",
"status": 422,
"code": "bank_declined",
"detail": "Yetersiz bakiye (banka kodu: 51)",
"provider_error_code": "51"
}{
"type": "https://docs.payven.com.tr/errors/rate_limit_exceeded",
"title": "İstek limiti aşıldı",
"status": 429,
"code": "rate_limit_exceeded"
}{
"type": "https://docs.payven.com.tr/errors/internal_server_error",
"title": "Sunucu hatası",
"status": 500,
"code": "internal_server_error"
}{
"type": "https://docs.payven.com.tr/errors/connector_unavailable",
"title": "Konnektör erişilemez",
"status": 503,
"code": "connector_unavailable"
}Headers
Path Parameters
Body
application/json; ver=1.0text/json; ver=1.0application/*+json; ver=1.0
⌘I