curl --request POST \
--url https://api.oneclickdz.com/v3/ocpay/createLink \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: YOUR_API_KEY' \
--data '{
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
productInfo: {
title: "Premium Subscription",
description: "Monthly access to premium features",
amount: 5000,
},
feeMode: "NO_FEE",
successMessage: "Thank you for your purchase!",
redirectUrl: "https://yourstore.com/success?orderId=12345",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'productInfo' => [
'title' => 'Premium Subscription',
'description' => 'Monthly access to premium features',
'amount' => 5000
],
'feeMode' => 'NO_FEE',
'successMessage' => 'Thank you for your purchase!',
'redirectUrl' => 'https://yourstore.com/success?orderId=12345'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
Navio
إنشاء رابط دفع
أنشئ رابط دفع جديداً للاستخدام مرة واحدة لنظام الدفع OneClick (Navio)
POST
/
v3
/
ocpay
/
createLink
curl --request POST \
--url https://api.oneclickdz.com/v3/ocpay/createLink \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: YOUR_API_KEY' \
--data '{
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
productInfo: {
title: "Premium Subscription",
description: "Monthly access to premium features",
amount: 5000,
},
feeMode: "NO_FEE",
successMessage: "Thank you for your purchase!",
redirectUrl: "https://yourstore.com/success?orderId=12345",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'productInfo' => [
'title' => 'Premium Subscription',
'description' => 'Monthly access to premium features',
'amount' => 5000
],
'feeMode' => 'NO_FEE',
'successMessage' => 'Thank you for your purchase!',
'redirectUrl' => 'https://yourstore.com/success?orderId=12345'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
نظرة عامة
أنشئ رابط دفع آمن للاستخدام مرة واحدة مع إعدادات قابلة للتخصيص. مثالي لطلبات التجارة الإلكترونية ومدفوعات الخدمات وتجديدات الاشتراكات.التحقق من صحة التاجر مطلوب: أكمل التحقق من صحة التاجر على https://app.oneclickdz.com/profile قبل استخدام هذا الـ endpoint.
جسم الطلب
object
مطلوب
string
افتراضي:"NO_FEE"
يحدد من يدفع رسوم السحب -
NO_FEE - التاجر يدفع جميع الرسوم (الافتراضي) - SPLIT_FEE - الرسوم مقسَّمة 50/50 - CUSTOMER_FEE - العميل يدفع جميع الرسومstring
رسالة نجاح مخصصة (بحد أقصى 500 حرف) تُعرض بعد الدفع
string
URL إعادة التوجيه بعد الدفع الناجح (يجب أن يكون HTTP/HTTPS صالحاً)
الاستجابة
boolean
يشير إلى نجاح العملية
object
تفاصيل رابط الدفع
إظهار خصائص data
إظهار خصائص data
object
معلومات رابط الدفع الكاملة
string
URL الكامل لمشاركته مع العملاء للدفع
string
كود مرجع الدفع - احفظه لتتبع المدفوعات
object
الميزات الرئيسية
مرونة الرسوم
اختر من يدفع رسوم المعاملة - التاجر أو العميل أو مشتركَين
علامة تجارية مخصصة
رسائل نجاح مخصصة وURL إعادة توجيه
اختبار sandbox
اختبر تكاملك بأمان قبل الإطلاق
أمان الاستخدام الفردي
كل رابط للاستخدام مرة واحدة لأمان معزَّز
ملاحظات مهمة
حدود المبلغ: - الحد الأدنى: 500 دج - الحد الأقصى: 500,000 دج - يجب أن يكون عدداً صحيحاً (بدون كسور عشرية)
بنية الرسوم: - 0% عند استخدام رصيد OneClick - 1% رسوم سحب فقط (قابلة للتكوين لكل معاملة)
انتهاء صلاحية الرابط: تنتهي صلاحية روابط الدفع بعد 20 دقيقة من الإنشاء إذا لم يُبدأ الدفع
curl --request POST \
--url https://api.oneclickdz.com/v3/ocpay/createLink \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: YOUR_API_KEY' \
--data '{
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
productInfo: {
title: "Premium Subscription",
description: "Monthly access to premium features",
amount: 5000,
},
feeMode: "NO_FEE",
successMessage: "Thank you for your purchase!",
redirectUrl: "https://yourstore.com/success?orderId=12345",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'productInfo' => [
'title' => 'Premium Subscription',
'description' => 'Monthly access to premium features',
'amount' => 5000
],
'feeMode' => 'NO_FEE',
'successMessage' => 'Thank you for your purchase!',
'redirectUrl' => 'https://yourstore.com/success?orderId=12345'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
{
"success": true,
"data": {
"paymentLink": {
"uid": "user_123456789",
"ref": "OCPL-A1B2C3-D4E5",
"isSandbox": false,
"productInfo": {
"title": "Premium Subscription",
"description": "Monthly access to premium features",
"amount": 5000
},
"feeMode": "NO_FEE",
"successMessage": "Thank you for your purchase!",
"redirectUrl": "https://yourstore.com/success?orderId=12345",
"time": "2025-01-15T10:30:00Z"
},
"paymentUrl": "https://pay.ocdz.link/pay/OCPL-A1B2C3-D4E5",
"paymentRef": "OCPL-A1B2C3-D4E5"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": [
{
"field": "productInfo.amount",
"message": "Amount must be between 500 and 500,000 DZD"
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
الخطوات التالية
التحقق من حالة الدفع
تعلم كيفية التحقق من حالة الدفع
دليل التكامل
دليل تكامل Navio الكامل
⌘I

