نُصدِر حزم SDK رسمية للغات الشائعة تتولى عنك توقيع HMAC ومنطق إعادة المحاولة وإدارة Idempotency-Key. عقد الواجهة (OpenAPI 3.1) مستقل عن اللغة: يمكنك كذلك كتابة عميلك الخاص بسهولة.

PHP

// composer require kernelhost/reseller-api-php   (in development)
use KernelHost\ResellerApi\Client;

$kh = new Client(getenv('KH_KEY'), getenv('KH_SECRET'));
$products = $kh->get('/products');
$order    = $kh->post('/orders', ['product_id' => 42, 'billing_cycle' => 'monthly']);

Node.js

// npm install @kernelhost/reseller-api   (in development)
import { Client } from '@kernelhost/reseller-api';

const kh = new Client({ key: process.env.KH_KEY, secret: process.env.KH_SECRET });
const products = await kh.get('/products');
const order    = await kh.post('/orders', { product_id: 42, billing_cycle: 'monthly' });

Python

# pip install kernelhost-reseller-api   (in development)
from kernelhost_reseller_api import Client

kh = Client(key=os.environ['KH_KEY'], secret=os.environ['KH_SECRET'])
products = kh.get('/products')
order    = kh.post('/orders', product_id=42, billing_cycle='monthly')

Go

// go get github.com/kernelhost/reseller-api-go   (in development)
import "github.com/kernelhost/reseller-api-go"

kh := resellerapi.New(os.Getenv("KH_KEY"), os.Getenv("KH_SECRET"))
products, _ := kh.Get("/products")
order, _    := kh.Post("/orders", map[string]any{"product_id": 42, "billing_cycle": "monthly"})

لغة بيئتك ليست في القائمة؟ تتبع الواجهة OpenAPI 3.1 المفتوح، ومثال cURL في نحو 20 سطراً من الصدفة يكفي لكل نقطة نهاية. راجع صفحة المصادقة لمنطق التوقيع.