انتقل إلى المحتوى الرئيسي
شهادات SSL من DigiCert وSectigo وGeoTrust
+90 850 259 76 06 WhatsApp الدعم كن موزّعًا
شهادات SSL
العلامات التجارية
توقيع الكود رمز LEI
أدوات
الدعم اتصل بنا WhatsApp السلة
اللغة
العملة
الحصول على شهادة SSL
v3.0

توثيق API

اربط إدارة شهادات SSL بالأتمتة عبر DATASSL Reseller API

البدء

تتيح لك DATASSL Reseller API v3.0 إدارة طلبات شهادات SSL وعمليات الفوترة ومدفوعات الرصيد برمجيًا عبر حساب الموزّع الخاص بك.

المتطلبات
  • حساب موزّع نشط ومجموعة موزّعين معرّفة
  • مفتاح API (يمكنك إنشاؤه من لوحة الموزّع الخاصة بك)
  • API erişimi açık olmalı (Panel > API & Entegrasyonlar)

Base URL

https://www.datassl.com/api/reseller/

تنسيق الطلب

جميع الطلبات والاستجابات بصيغة JSON.

Content-Type: application/json
Accept: application/json

بنية الاستجابة العامة

// Başarılı
{
  "success": true,
  "message": "İşlem açıklaması",
  ...data
}

// Hata
{
  "success": false,
  "error": "Hata mesajı"
}

التحقق من الهوية

استخدم إحدى الطرق التالية في جميع طلبات API:

الطريقة 1: X-API-Key Header

X-API-Key: YOUR_API_KEY

الطريقة 2: Bearer Token

Authorization: Bearer YOUR_API_KEY
كيف أحصل على مفتاح API؟
  1. سجّل الدخول إلى لوحة الموزّع الخاصة بك
  2. API & Entegrasyonlar افتح الصفحة
  3. انقر على زر "إنشاء مفتاح API"
  4. احتفظ بالمفتاح الذي تم إنشاؤه في مكان آمن

جميع نقاط النهاية

الطريقة Endpoint الوصف
المنتجات
GET /products قائمة المنتجات (مع دعم التصفية)
GET /products/{id} تفاصيل المنتج + أسعار SAN
GET /san-pricing/{id} تسعير SAN/Wildcard SAN
الطلبات
GET /orders قائمة الطلبات (مع دعم التصفية)
GET /orders/{id} تفاصيل الطلب
POST /orders إنشاء طلب جديد (مع دعم SAN)
PUT /orders/{id} عمليات الطلب (الإلغاء)
إدارة SSL
POST /ssl/configure إعداد SSL (CSR وDCV وبيانات المسؤول)
GET /ssl/{order_id} استعلام حالة SSL + تفاصيل التحقق
POST /ssl/resend-validation إعادة إرسال رسالة التحقق
POST /ssl/change-dcv تغيير طريقة DCV
POST /ssl/reissue إعادة إصدار الشهادة (Reissue)
POST /csr/decode فك ترميز CSR (النطاق والمؤسسة وبيانات SAN)
الفواتير
GET /invoices قائمة الفواتير
GET /invoices/{id} تفاصيل الفاتورة
الرصيد والدفع
GET /credits رصيد الائتمان + سجل المعاملات
POST /credits دفع الطلب بالرصيد
GET /balance الرصيد وآخر المعاملات
الشهادة
GET /certificate/{order_id} معلومات حالة الشهادة
GET /certificate/{order_id}/download تنزيل الشهادة (PEM + CA Bundle)
الحساب والإحصائيات
GET /account معلومات الحساب
GET /stats الإحصائيات والرسوم البيانية

المنتجات

الوصول حسب المجموعة: تعيد واجهة API المنتجات المخصصة لمجموعة الموزّعين الخاصة بك فقط. تُحسب الأسعار تلقائيًا بأسعار المجموعة الخاصة.

قائمة المنتجات

GET /products
معلمات التصفية
Brand مرشح العلامة التجارية (Sectigo, DigiCert, Thawte...)
Type مرشح النوع (ssl, wildcard, multi-domain, code-signing)
التحقق نوع التحقق (dv, ov, ev)
GET /products?brand=Sectigo&type=ssl&validation=dv

الاستجابة

{
  "success": true,
  "products": [
    {
      "id": 1,
      "name": "Sectigo PositiveSSL",
      "brand": "Sectigo",
      "type": "ssl",
      "validation_type": "dv",
      "domain_type": "single",
      "list_price": 49.99,
      "list_pricing": { "1": 49.99, "2": 89.99, "3": 119.99 },
      "reseller_price": 12.99,
      "pricing": { "1": 12.99, "2": 22.99, "3": 29.99 },
      "max_years": 3,
      "warranty": "$50,000",
      "san_enabled": false
    }
  ],
  "count": 25,
  "group_id": 1,
  "note": "Sadece grubunuza tanımlanmış ürünler listelenmektedir."
}

تفاصيل المنتج

GET /products/{id}

تعيد أسعار SAN وجميع أسعار السنوات المتعددة وجميع معلومات التفاصيل لمنتج واحد.

تسعير SAN

GET /san-pricing/{product_id}

تعيد أسعار SAN وWildcard SAN الخاصة بالمنتج بالتفصيل.

الطلبات

قائمة الطلبات

GET /orders
معلمات التصفية
Status مرشح الحالة (pending, processing, completed, cancelled)
domain البحث عن النطاق
limit عدد السجلات في الصفحة (بحد أقصى 100، الافتراضي 50)
offset نقطة البداية (ترقيم الصفحات)
GET /orders?status=pending&limit=20&offset=0

تفاصيل الطلب

GET /orders/{id}

إنشاء طلب جديد

POST /orders
معلمات Body
product_id * معرّف المنتج (يجب أن يكون معرّفًا في مجموعتك)
domain * اسم النطاق (باستثناء توقيع الكود)
period المدة (بالأشهر، الافتراضي 12). هي مدة الاشتراك؛ وتبلغ صلاحية الشهادة 200 يوم كحد أقصى وتُجدَّد تلقائيًا.
san_count عدد SAN الإضافية
san_wildcard_count عدد Wildcard SAN الإضافية
الدفع التلقائي بالرصيد

عند إنشاء الطلب يُخصم المبلغ تلقائيًا من رصيدك. لا يمكن إنشاء الطلب إذا كان الرصيد غير كافٍ (HTTP 402).

// Örnek istek
{
  "product_id": 1,
  "domain": "example.com",
  "period": 12,
  "san_count": 2,
  "san_wildcard_count": 0
}

الاستجابة

{
  "success": true,
  "message": "Sipariş başarıyla oluşturuldu",
  "order_id": 12345,
  "order_number": "ORD-2026-0042",
  "domain": "example.com",
  "base_price": 49.99,
  "san_total": 15.98,
  "discount_amount": 37.00,
  "total": 28.97,
  "status": "pending",
  "payment_status": "paid",
  "credit_used": 28.97,
  "new_balance": 1221.03,
  "invoice_number": "INV-2026-0078",
  "auto_reissue_enabled": true,
  "max_validity_days": 200,
  "purchase_end_date": "2027-02-14",
  "next_reissue_at": "2026-08-19"
}

إلغاء الطلب

PUT /orders/{id}
// Body
{ "action": "cancel" }

فقط Pending أو Processing يمكن إلغاء الطلبات ذات هذه الحالة.

حالات الطلبات

Pending قيد الانتظار (بانتظار الدفع)
Processing قيد المعالجة
validation_pending بانتظار التحقق من النطاق
pending_configuration بانتظار الإعداد
Completed مكتمل / نشط
Cancelled ملغى
Expired منتهية الصلاحية

إدارة SSL

تُستخدم نقاط نهاية SSL بعد الطلب لإعداد الشهادة والاستعلام عن الحالة وتغيير DCV وعمليات إعادة الإصدار.

تكوين SSL

POST /ssl/configure

بعد إنشاء الطلب، قم بإعداد شهادة SSL بإرسال بيانات CSR وDCV.

order_id * معرّف الطلب
csr * Certificate Signing Request (PEM)
dcv_method طريقة التحقق: email, http, https, dns (الافتراضي: email)
approver_email بريد الموافقة (لـ DCV عبر البريد الإلكتروني)

استعلام حالة SSL

GET /ssl/{order_id}

تعيد الحالة في الوقت الفعلي وتفاصيل التحقق (تعليمات HTTP/DNS/Email) ومعلومات التحقق من SAN. تحفظ الشهادة تلقائيًا إذا كانت جاهزة.

تغيير طريقة DCV

POST /ssl/change-dcv
order_id * معرّف الطلب
dcv_method * طريقة DCV الجديدة: email, http, https, dns
approver_email بريد الموافقة الجديد

إعادة إرسال رسالة التحقق

POST /ssl/resend-validation
{ "order_id": 12345 }

إعادة إصدار الشهادة (Reissue)

POST /ssl/reissue
التجديد التلقائي: في إطار قاعدة 198 يومًا، يجري النظام تلقائيًا إعادة إصدار قبل انتهاء مدة صلاحية شهادتك. ويمكن أيضًا إجراء إعادة إصدار يدوية عبر نقطة النهاية هذه.
order_id * معرّف الطلب (يلزم وجود شهادة نشطة)
csr CSR جديد (اختياري، وإذا تُرك فارغًا يُستخدم الحالي)
dcv_method طريقة DCV
approver_email بريد الموافقة

CSR Decode

POST /csr/decode
{ "csr": "-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----" }

تستخرج النطاق والمؤسسة وقائمة SAN وبقية المعلومات من CSR.

قاعدة 198 يومًا والتجديد التلقائي

قرار CA/Browser Forum: اعتبارًا من 15 مارس 2026، لا يمكن أن تتجاوز صلاحية شهادات SSL/TLS 200 يوم (نحو 6.5 أشهر). أما شهادات توقيع الكود (Code Signing) فهي مستثناة من هذه القاعدة.

كيف تعمل؟

عندما يشتري العميل شهادة SSL لمدة 1 سنة:

  1. الشهادة 200 يوم كحد أقصى صلاحية عند الإصدار
  2. يُعاد إصدار الشهادة تلقائيًا (reissue) 14 يوم قبل انتهاء صلاحيتها
  3. تتكرر هذه العملية طوال مدة الشراء (1/2/3 سنوات) دون رسوم إضافية بشكل متكرر

حقول جديدة في استجابة الطلب

auto_reissue_enabled boolean — هل التجديد التلقائي مفعّل (في جميع منتجات SSL باستثناء توقيع الكود true)
max_validity_days integer — الحد الأقصى لمدة صلاحية الشهادة (بالأيام). حاليًا: 200
purchase_end_date string (YYYY-MM-DD) — تاريخ انتهاء الاشتراك (نهاية المدة المدفوعة)
next_reissue_at string (YYYY-MM-DD) — Sonraki otomatik yenileme tarihi
reissue_count integer — عدد عمليات التجديد التلقائي التي تمت حتى الآن

مراحل الصلاحية (خارطة الطريق)

التاريخ الحد الأقصى للصلاحية الحالة
15 مارس 2026 200 يوم نشط
15 مارس 2027 100 يوم القادم
15 مارس 2029 47 يوم القادم

سيناريو مثال: شهادة DV SSL لمدة 1 سنة

// Sipariş oluşturuldu: 21 Mart 2026
// Abonelik süresi: 1 yıl (21 Mart 2027'ye kadar)

// 1. Sertifika: 21 Mar 2026 → 7 Eki 2026 (200 gün)
// Otomatik reissue: 23 Eyl 2026 (bitiş - 14 gün)
// 2. Sertifika: 23 Eyl 2026 → 11 Nis 2027 (200 gün)
// Abonelik 21 Mar 2027'de bitiyor → reissue yapılmaz

{
  "order_id": 12345,
  "period": 12,
  "auto_reissue_enabled": true,
  "max_validity_days": 200,
  "purchase_end_date": "2027-03-21",
  "next_reissue_at": "2026-09-23",
  "reissue_count": 0,
  "cert_valid_from": "2026-03-21",
  "cert_valid_till": "2026-10-07"
}
استثناء توقيع الكود: شهادات Code Signing وEV Code Signing معفاة من قاعدة 198 يومًا. في هذه المنتجات auto_reissue_enabled يُرجع دائمًا false كقيمة.

Otomatik SSL (ACME) Abonelikleri

Sectigo ACME ve "Plan + Automate" ürünleri yıllık aboneliktir. Bu ürünlerde CSR ve doğrulama adımı yoktur; sertifikayı müşterinin sunucusundaki ACME istemcisi ya da AutoInstall SSL alır ve yeniler.

Ürünleri listeleme

Abonelik ürünleri yalnızca istendiğinde listelenir:

GET /products?include=acme

Bu ürünlerde şu alanlar döner: fulfillment: "acme_subscription", requires_csr: false, acme_type (caas = ACME istemcisi, ais = AutoInstall SSL), wildcard_only.

Abonelik siparişi

POST /orders
Alanإلزاميالوصف
product_idنعمAbonelik ürününün kimliği
domainنعمAlan adı. wildcard_only ürünlerde *.example.com biçiminde. www adresi kendiliğinden eklenir.
contact_emailais –Sertifika ve abonelik bildirimlerinin gideceği adres

Sipariş tutarı bakiyenizden düşülür ve abonelik hemen oluşturulur. Abonelik oluşturulamazsa sipariş iptal edilir ve tutar bakiyenize iade edilir.

{
  "success": true,
  "order_id": 1234,
  "status": "completed",
  "fulfillment": "acme_subscription",
  "acme": { "status": "created", "subscription_id": 12, "details_endpoint": "/orders/1234/acme" }
}

بيانات الإعداد

GET /orders/{order_id}/acme

ACME sunucu adresini ve EAB kimlik bilgilerini döndürür. Bilgiler sağlayıcıdan anlık alınır; EAB anahtarını parola gibi saklayın.

{
  "success": true,
  "acme": {
    "status": "active",
    "category": "caas",
    "domains": [ { "id": "123", "name": "ornek.com" }, { "id": "124", "name": "www.ornek.com" } ],
    "subscription": { "begin": "2026-10-04", "next_renewal": "2027-10-04", "end": null },
    "account": { "eab_kid": "...", "eab_hmac_key": "...", "server_url": "https://acme.sectigo.com/v2/DV", "status": "pending" },
    "autoinstall": null
  }
}

AutoInstall ürünlerinde autoinstall.login_url alanı kurulum panelinin bağlantısını verir. GET /orders/{order_id} yanıtında da aboneliğin özeti (acme) yer alır.

الفواتير

قائمة الفواتير

GET /invoices
Status مرشح الحالة (unpaid, paid, cancelled, sent)
limit عدد السجلات في الصفحة (بحد أقصى 100)
offset نقطة البداية

الاستجابة

{
  "success": true,
  "invoices": [
    {
      "id": 78,
      "invoice_number": "INV-2026-0078",
      "order_number": "ORD-2026-0042",
      "domain": "example.com",
      "total": 28.97,
      "currency": "USD",
      "status": "unpaid",
      "due_date": "2026-02-21",
      "created_at": "2026-02-14 10:30:00"
    }
  ],
  "pagination": { "total": 156, "limit": 50, "offset": 0 }
}

تفاصيل الفاتورة

GET /invoices/{id}

الرصيد والدفع

بالدولار الأمريكي: تُحتسب جميع أرصدة الائتمان والمعاملات بالدولار الأمريكي (USD).

رصيد الائتمان وسجل المعاملات

GET /credits
{
  "success": true,
  "balance": 1250.00,
  "currency": "USD",
  "transactions": [
    {
      "id": 45,
      "amount": -28.97,
      "type": "debit",
      "description": "Sipariş ödemesi: ORD-2026-0042",
      "balance_after": 1221.03,
      "created_at": "2026-02-14 10:31:00"
    },
    {
      "id": 44,
      "amount": 500.00,
      "type": "credit",
      "description": "Kredi yükleme",
      "balance_after": 1250.00,
      "created_at": "2026-02-13 09:00:00"
    }
  ],
  "pagination": { "total": 45, "limit": 50, "offset": 0 }
}

دفع الطلب بالرصيد

POST /credits
// İstek
{ "order_id": 12345 }

// Yanıt
{
  "success": true,
  "message": "Ödeme başarıyla alındı",
  "order_id": 12345,
  "amount_paid": 28.97,
  "new_balance": 1221.03
}
يتم إرجاع خطأ إذا كان الرصيد غير كافٍ. يُنصح بالتحقق من الرصيد قبل الدفع.

الاستعلام عن الرصيد (مختصر)

GET /balance

تعيد معلومات الرصيد مع آخر 10 معاملات.

الشهادة

حالة الشهادة

GET /certificate/{order_id}
{
  "success": true,
  "certificate": {
    "order_id": 12345,
    "domain": "example.com",
    "product": "Sectigo PositiveSSL",
    "brand": "Sectigo",
    "status": "completed",
    "valid_from": "2026-03-21",
    "valid_till": "2026-10-07",
    "has_certificate": true,
    "has_ca_bundle": true,
    "days_remaining": 200,
    "is_expired": false,
    "auto_reissue_enabled": true,
    "max_validity_days": 200,
    "next_reissue_at": "2026-09-23",
    "purchase_end_date": "2027-03-21",
    "reissue_count": 0
  }
}

تنزيل الشهادة

GET /certificate/{order_id}/download
{
  "success": true,
  "certificate": {
    "domain": "example.com",
    "valid_from": "2026-03-21",
    "valid_till": "2026-10-07",
    "certificate_pem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
    "ca_bundle": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
    "private_key_note": "Private key sipariş oluşturulurken size iletilmiştir."
  }
}

الإحصائيات

GET /stats

تعيد إحصائيات شاملة وبيانات الرسوم البيانية لحساب الموزّع الخاص بك.

{
  "success": true,
  "stats": {
    "total_orders": 156,
    "active_orders": 89,
    "pending_orders": 3,
    "total_revenue": 15420.00,
    "monthly_revenue": 2340.00,
    "credit_balance": 1250.00
  },
  "charts": {
    "daily_sales": [
      { "date": "2026-02-13", "orders": 5, "revenue": 245.50 },
      { "date": "2026-02-14", "orders": 3, "revenue": 189.97 }
    ],
    "brand_distribution": [
      { "brand": "Sectigo", "count": 78 },
      { "brand": "DigiCert", "count": 45 }
    ],
    "status_distribution": {
      "completed": 89,
      "pending": 3,
      "processing": 5,
      "cancelled": 12
    }
  }
}

معلومات الحساب

GET /account
{
  "success": true,
  "reseller": {
    "id": 42,
    "name": "Bayi Adı",
    "email": "bayi@example.com",
    "company": "Örnek Şirket Ltd.",
    "discount_rate": 30.0,
    "credit_balance": 1250.00,
    "stats": {
      "order_count": 156,
      "total_revenue": 15420.00
    }
  }
}

رموز الأخطاء

الرمز المعنى الوصف
400 Bad Request معاملات غير صالحة أو ناقصة
401 Unauthorized مفتاح API غير صالح أو الوصول إلى API معطّل
403 Forbidden مجموعة الموزّعين غير معرّفة أو لا يوجد وصول إلى المنتج
404 غير موجود المورد غير موجود (الطلب، الشهادة)
405 Method Not Allowed طريقة HTTP غير مدعومة لنقطة النهاية هذه
500 Server Error خطأ في الخادم

استجابة الخطأ

{
  "success": false,
  "error": "Yetersiz bakiye. Gerekli: $28.97 Mevcut: $10.00"
}

أمثلة برمجية

<?php
class DataSSLClient {
    private $apiKey;
    private $baseUrl = 'https://www.datassl.com/api/reseller';

    public function __construct($apiKey) {
        $this->apiKey = $apiKey;
    }

    private function request($method, $endpoint, $data = null) {
        $ch = curl_init($this->baseUrl . $endpoint);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER => [
                'Content-Type: application/json',
                'X-API-Key: ' . $this->apiKey
            ]
        ]);
        if ($method === 'POST') {
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        }
        if ($method === 'PUT') {
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        }
        if ($method === 'DELETE') {
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
        }
        $response = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        return json_decode($response, true);
    }

    // Ürünler
    public function getProducts($filters = []) {
        $query = $filters ? '?' . http_build_query($filters) : '';
        return $this->request('GET', '/products' . $query);
    }

    public function getProduct($id) {
        return $this->request('GET', '/products/' . $id);
    }

    // Siparişler
    public function getOrders($filters = []) {
        $query = $filters ? '?' . http_build_query($filters) : '';
        return $this->request('GET', '/orders' . $query);
    }

    public function createOrder($data) {
        return $this->request('POST', '/orders', $data);
    }

    public function cancelOrder($id) {
        return $this->request('PUT', '/orders/' . $id, ['action' => 'cancel']);
    }

    // Faturalar
    public function getInvoices($status = '') {
        $query = $status ? '?status=' . $status : '';
        return $this->request('GET', '/invoices' . $query);
    }

    // Kredi
    public function getCredits() {
        return $this->request('GET', '/credits');
    }

    public function payWithCredit($orderId) {
        return $this->request('POST', '/credits', ['order_id' => $orderId]);
    }

    // Sertifika
    public function getCertificateStatus($orderId) {
        return $this->request('GET', '/certificate/' . $orderId);
    }

    public function downloadCertificate($orderId) {
        return $this->request('GET', '/certificate/' . $orderId . '/download');
    }

    // Hesap & İstatistik
    public function getAccount() { return $this->request('GET', '/account'); }
    public function getBalance() { return $this->request('GET', '/balance'); }
    public function getStats()   { return $this->request('GET', '/stats'); }
}

// ─── Kullanım Örnekleri ───

$client = new DataSSLClient('YOUR_API_KEY');

// 1. Ürünleri listele
$products = $client->getProducts(['brand' => 'Sectigo', 'type' => 'ssl']);

// 2. Sipariş oluştur (kredi bakiyesinden otomatik kesilir)
$order = $client->createOrder([
    'product_id' => 1,
    'domain' => 'example.com',
    'period' => 12,
    'san_count' => 2
]);

// 3. Sipariş zaten ödenmiş, SSL yapılandırabilirsiniz
if ($order['success']) {
    echo "Sipariş: " . $order['order_number'] . "\n";
    echo "Tutar: $" . $order['total'] . "\n";
    echo "Kalan bakiye: $" . $order['new_balance'] . "\n";
}

// 4. Sertifika indir
$cert = $client->downloadCertificate(12345);
if ($cert['success']) {
    file_put_contents('certificate.pem', $cert['certificate']['certificate_pem']);
    file_put_contents('ca-bundle.pem', $cert['certificate']['ca_bundle']);
}
?>
import requests

class DataSSLClient:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = 'https://www.datassl.com/api/reseller'
        self.headers = {
            'Content-Type': 'application/json',
            'X-API-Key': api_key
        }

    def get_products(self, **filters):
        return requests.get(f'{self.base_url}/products', params=filters, headers=self.headers).json()

    def create_order(self, data):
        return requests.post(f'{self.base_url}/orders', json=data, headers=self.headers).json()

    def cancel_order(self, order_id):
        return requests.put(f'{self.base_url}/orders/{order_id}', json={'action': 'cancel'}, headers=self.headers).json()

    def get_invoices(self, status=''):
        params = {'status': status} if status else {}
        return requests.get(f'{self.base_url}/invoices', params=params, headers=self.headers).json()

    def pay_with_credit(self, order_id):
        return requests.post(f'{self.base_url}/credits', json={'order_id': order_id}, headers=self.headers).json()

    def get_certificate(self, order_id):
        return requests.get(f'{self.base_url}/certificate/{order_id}', headers=self.headers).json()

    def download_certificate(self, order_id):
        return requests.get(f'{self.base_url}/certificate/{order_id}/download', headers=self.headers).json()

    def get_stats(self):
        return requests.get(f'{self.base_url}/stats', headers=self.headers).json()

    def get_balance(self):
        return requests.get(f'{self.base_url}/balance', headers=self.headers).json()

# ─── Kullanım ───
client = DataSSLClient('YOUR_API_KEY')

# Ürünleri listele
products = client.get_products(brand='Sectigo', type='ssl')
for p in products.get('products', []):
    print(f"{p['name']} - ${p['reseller_price']}")

# Sipariş oluştur + öde
order = client.create_order({
    'product_id': 1,
    'domain': 'example.com'
})

if order['success']:
    payment = client.pay_with_credit(order['order_id'])
    print(f"Ödendi: ${payment['amount_paid']} | Bakiye: ${payment['new_balance']}")

# İstatistikler
stats = client.get_stats()
print(f"Bu ay gelir: ${stats['stats']['monthly_revenue']}")
const axios = require('axios');

class DataSSLClient {
    constructor(apiKey) {
        this.client = axios.create({
            baseURL: 'https://www.datassl.com/api/reseller',
            headers: { 'Content-Type': 'application/json', 'X-API-Key': apiKey }
        });
    }

    async getProducts(filters = {}) {
        return (await this.client.get('/products', { params: filters })).data;
    }

    async createOrder(data) {
        return (await this.client.post('/orders', data)).data;
    }

    async cancelOrder(id) {
        return (await this.client.put(`/orders/${id}`, { action: 'cancel' })).data;
    }

    async getInvoices(status = '') {
        return (await this.client.get('/invoices', { params: { status } })).data;
    }

    async payWithCredit(orderId) {
        return (await this.client.post('/credits', { order_id: orderId })).data;
    }

    async getCertificate(orderId) {
        return (await this.client.get(`/certificate/${orderId}`)).data;
    }

    async downloadCertificate(orderId) {
        return (await this.client.get(`/certificate/${orderId}/download`)).data;
    }

    async getStats() { return (await this.client.get('/stats')).data; }
    async getBalance() { return (await this.client.get('/balance')).data; }
    async getAccount() { return (await this.client.get('/account')).data; }
}

// ─── Kullanım ───
(async () => {
    const client = new DataSSLClient('YOUR_API_KEY');

    // Ürünler
    const { products } = await client.getProducts({ brand: 'Sectigo' });
    products.forEach(p => console.log(`${p.name} - $${p.reseller_price}`));

    // Sipariş + Ödeme
    const order = await client.createOrder({
        product_id: 1, domain: 'example.com',
        san_count: 2
    });

    if (order.success) {
        const payment = await client.payWithCredit(order.order_id);
        console.log(`Ödendi: $${payment.amount_paid}`);
    }

    // İstatistik
    const stats = await client.getStats();
    console.log(`Toplam sipariş: ${stats.stats.total_orders}`);
})();
# ─── Ürünler ───
curl -X GET "https://www.datassl.com/api/reseller/products?brand=Sectigo&type=ssl" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── Sipariş Oluştur ───
curl -X POST "https://www.datassl.com/api/reseller/orders" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "product_id": 1,
    "domain": "example.com",
    "san_count": 2
  }'

# ─── Sipariş İptal ───
curl -X PUT "https://www.datassl.com/api/reseller/orders/12345" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{ "action": "cancel" }'

# ─── Faturalar ───
curl -X GET "https://www.datassl.com/api/reseller/invoices?status=unpaid" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── Kredi ile Öde ───
curl -X POST "https://www.datassl.com/api/reseller/credits" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{ "order_id": 12345 }'

# ─── Sertifika Durumu ───
curl -X GET "https://www.datassl.com/api/reseller/certificate/12345" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── Sertifika İndir ───
curl -X GET "https://www.datassl.com/api/reseller/certificate/12345/download" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── İstatistikler ───
curl -X GET "https://www.datassl.com/api/reseller/stats" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── Bakiye ───
curl -X GET "https://www.datassl.com/api/reseller/balance" \
  -H "X-API-Key: YOUR_API_KEY"

# ─── Hesap Bilgileri ───
curl -X GET "https://www.datassl.com/api/reseller/account" \
  -H "X-API-Key: YOUR_API_KEY"

وحدة WHMCS

يمكنك بيع منتجات DATASSL بسهولة عبر WHMCS. تكامل كامل ببنية وحدة Addon + Server.

WHMCS Addon + Server Module v5.9.0

لوحة إدارة كاملة ومنشئ منتجات ومزامنة الطلبات والتوفير التلقائي.

  • متوافق مع WHMCS 7.x / 8.x / 9.x
  • لوحة Addon: منشئ المنتجات وإدارة الطلبات والإحصائيات
  • إضافة المنتجات بالجملة والتسعير التلقائي
  • مزامنة الطلبات تلقائيًا عبر Cron
  • واجهة المسؤول والعميل
  • لا حاجة لإضافة خادم - واجهة API مدمجة

التثبيت

  1. نزّل ملف ZIP وافتحه
  2. انسخ المجلدين إلى دليل WHMCS الخاص بك:
    • modules/addons/datassl → Addon paneli
    • modules/servers/datassl → وحدة التوفير
  3. WHMCS Admin → Setup → Addon Modules → "DATASSL SSL Certificates" → Activate
  4. اختر أدوار المسؤول من Access Control
  5. أضف المنتجات عبر Addons → DATASSL → منشئ المنتجات
لا يلزم إضافة خادم أو إدخال مفتاح API. تأتي بيانات API مدمجة داخل الوحدة.