curl -X POST https://api.yucepay.com/api/payment/link \
-H "X-Api-Key: pk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 250.00,
"currency": "TRY",
"installment": 1,
"orderNumber": "SIP-10500",
"description": "Danışmanlık hizmeti",
"successUrl": "https://magaza.com/basarili",
"failUrl": "https://magaza.com/hata",
"expiryDate": "2026-09-01T23:59:59Z",
"maxUsageCount": 1,
"products": [ { "id": "SRV-1", "name": "Danışmanlık", "amount": 250.00 } ]
}'
var body = new {
amount = 250.00m, currency = "TRY", installment = 1,
orderNumber = "SIP-10500", description = "Danışmanlık hizmeti",
successUrl = "https://magaza.com/basarili", failUrl = "https://magaza.com/hata",
expiryDate = "2026-09-01T23:59:59Z", maxUsageCount = 1,
products = new[] { new { id = "SRV-1", name = "Danışmanlık", amount = 250.00m } }
};
var res = await http.PostAsJsonAsync("https://api.yucepay.com/api/payment/link", body);
<?php
$ch = curl_init('https://api.yucepay.com/api/payment/link');
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([
'amount' => 250.00, 'currency' => 'TRY', 'installment' => 1,
'orderNumber' => 'SIP-10500', 'description' => 'Danışmanlık hizmeti',
'successUrl' => 'https://magaza.com/basarili', 'failUrl' => 'https://magaza.com/hata',
'expiryDate' => '2026-09-01T23:59:59Z', 'maxUsageCount' => 1,
'products' => [['id' => 'SRV-1','name' => 'Danışmanlık','amount' => 250.00]],
]),
]);
$response = curl_exec($ch);
const res = await fetch('https://api.yucepay.com/api/payment/link', {
method: 'POST',
headers: { 'X-Api-Key': 'pk_live_xxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
body: JSON.stringify({
amount: 250.00, currency: 'TRY', installment: 1,
orderNumber: 'SIP-10500', description: 'Danışmanlık hizmeti',
successUrl: 'https://magaza.com/basarili', failUrl: 'https://magaza.com/hata',
expiryDate: '2026-09-01T23:59:59Z', maxUsageCount: 1,
products: [{ id: 'SRV-1', name: 'Danışmanlık', amount: 250.00 }],
}),
});
const data = await res.json();
{
"success": true,
"message": "Ödeme linki oluşturuldu",
"data": {
"paymentLinkUrl": "https://pay.yucepay.com/l/aB3xY9",
"expiryDate": "2026-09-01T23:59:59Z",
"maxUsageCount": 1
},
"errorCode": null,
"timestamp": "2026-08-19T10:32:00Z"
}