cURL
curl -X POST https://vpos-sandbox.payven.com.tr/api/v1/webhooks \
-H "Authorization: Bearer $PAYVEN_TOKEN" \
-H "Idempotency-Key: order-1001" \
-d '{ ...payload... }'const res = await fetch(
"https://vpos-sandbox.payven.com.tr/api/v1/webhooks",
{
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://vpos-sandbox.payven.com.tr/api/v1/webhooks",
headers={
"Authorization": f"Bearer {access_token}",
"Idempotency-Key": "order-1001",
},
json={ ... },
)
data = res.json()var req = new HttpRequestMessage(HttpMethod.Post, "https://vpos-sandbox.payven.com.tr/api/v1/webhooks");
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://vpos-sandbox.payven.com.tr/api/v1/webhooks", 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://vpos-sandbox.payven.com.tr/api/v1/webhooks");
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://vpos-sandbox.payven.com.tr/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": \"<string>\",\n \"description\": \"<string>\",\n \"max_retry_count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vpos-sandbox.payven.com.tr/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": \"<string>\",\n \"description\": \"<string>\",\n \"max_retry_count\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"secret": "<string>",
"events": "<string>",
"description": "<string>",
"max_retry_count": 123
}{
"type": "https://docs.payven.com.tr/errors/bad_request",
"title": "Geçersiz istek",
"status": 400,
"code": "bad_request",
"detail": "amount.amount alanı zorunlu.",
"correlation_id": "9f1c8e76-2a3b-4f12-9c8d-12cb24a8a8a8"
}{
"type": "https://docs.payven.com.tr/errors/invalid_token",
"title": "Geçersiz token",
"status": 401,
"code": "invalid_token",
"detail": "Access token geçersiz veya süresi dolmuş — refresh edin."
}{
"type": "https://docs.payven.com.tr/errors/forbidden",
"title": "Yetki yok",
"status": 403,
"code": "forbidden",
"detail": "Bu rol bu kaynağı göremez."
}{
"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": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"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"
}Webhooks
Webhook subscription oluştur
Belirli olay tipleri için sizin endpoint’inize teslim alacağı bir abonelik kurar. Yanıtta dönen secret değerini saklayın — gelen webhook’ların imzasını HMAC-SHA256 ile doğrularken bu secret’ı kullanırsınız.
Mevcut olaylar: bkz. Webhook Olay Kataloğu.
POST
/
api
/
v1
/
webhooks
cURL
curl -X POST https://vpos-sandbox.payven.com.tr/api/v1/webhooks \
-H "Authorization: Bearer $PAYVEN_TOKEN" \
-H "Idempotency-Key: order-1001" \
-d '{ ...payload... }'const res = await fetch(
"https://vpos-sandbox.payven.com.tr/api/v1/webhooks",
{
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://vpos-sandbox.payven.com.tr/api/v1/webhooks",
headers={
"Authorization": f"Bearer {access_token}",
"Idempotency-Key": "order-1001",
},
json={ ... },
)
data = res.json()var req = new HttpRequestMessage(HttpMethod.Post, "https://vpos-sandbox.payven.com.tr/api/v1/webhooks");
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://vpos-sandbox.payven.com.tr/api/v1/webhooks", 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://vpos-sandbox.payven.com.tr/api/v1/webhooks");
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://vpos-sandbox.payven.com.tr/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": \"<string>\",\n \"description\": \"<string>\",\n \"max_retry_count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vpos-sandbox.payven.com.tr/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": \"<string>\",\n \"description\": \"<string>\",\n \"max_retry_count\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"secret": "<string>",
"events": "<string>",
"description": "<string>",
"max_retry_count": 123
}{
"type": "https://docs.payven.com.tr/errors/bad_request",
"title": "Geçersiz istek",
"status": 400,
"code": "bad_request",
"detail": "amount.amount alanı zorunlu.",
"correlation_id": "9f1c8e76-2a3b-4f12-9c8d-12cb24a8a8a8"
}{
"type": "https://docs.payven.com.tr/errors/invalid_token",
"title": "Geçersiz token",
"status": 401,
"code": "invalid_token",
"detail": "Access token geçersiz veya süresi dolmuş — refresh edin."
}{
"type": "https://docs.payven.com.tr/errors/forbidden",
"title": "Yetki yok",
"status": 403,
"code": "forbidden",
"detail": "Bu rol bu kaynağı göremez."
}{
"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": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"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"
}Authorizations
Identity servisinden alinan Keycloak JWT. Format: Authorization: Bearer <token>. Token alma: POST /api/v1/auth/{slug}/token
Headers
Body
application/json
⌘I