curl -X POST https://api.yucepay.com/api/payment/pay \
-H "X-Api-Key: pk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"idempotencyKey": "ord-2026-0002",
"amount": 79.00,
"currency": "TRY",
"installment": 1,
"cardNo": "4111111111111111",
"cardHolderName": "AHMET YILMAZ",
"expireMonth": "12",
"expireYear": "28",
"cvv": "123",
"products": [ { "id": "SKU-9", "name": "Abonelik", "amount": 79.00 } ]
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "pk_live_xxxxxxxxxxxxxxxx");
var body = new {
idempotencyKey = "ord-2026-0002",
amount = 79.00m, currency = "TRY", installment = 1,
cardNo = "4111111111111111", cardHolderName = "AHMET YILMAZ",
expireMonth = "12", expireYear = "28", cvv = "123",
products = new[] { new { id = "SKU-9", name = "Abonelik", amount = 79.00m } }
};
var res = await http.PostAsJsonAsync("https://api.yucepay.com/api/payment/pay", body);
<?php
$ch = curl_init('https://api.yucepay.com/api/payment/pay');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-Api-Key: pk_live_xxxxxxxxxxxxxxxx','Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'idempotencyKey' => 'ord-2026-0002',
'amount' => 79.00, 'currency' => 'TRY', 'installment' => 1,
'cardNo' => '4111111111111111', 'cardHolderName' => 'AHMET YILMAZ',
'expireMonth' => '12', 'expireYear' => '28', 'cvv' => '123',
'products' => [['id' => 'SKU-9','name' => 'Abonelik','amount' => 79.00]],
]),
]);
$response = curl_exec($ch);
const res = await fetch('https://api.yucepay.com/api/payment/pay', {
method: 'POST',
headers: { 'X-Api-Key': 'pk_live_xxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
body: JSON.stringify({
idempotencyKey: 'ord-2026-0002',
amount: 79.00, currency: 'TRY', installment: 1,
cardNo: '4111111111111111', cardHolderName: 'AHMET YILMAZ',
expireMonth: '12', expireYear: '28', cvv: '123',
products: [{ id: 'SKU-9', name: 'Abonelik', amount: 79.00 }],
}),
});
const data = await res.json();
{
"success": true,
"message": "Ödeme başarılı",
"data": {
"paymentId": "7a1b...",
"paymentReferenceNumber": "PAY-20260819-0002",
"status": "Başarılı",
"bankReferenceNumber": "000012345678"
},
"errorCode": null,
"timestamp": "2026-08-19T10:31:00Z"
}