دليل التكامل مع Prof Solution Sync
توفر هذه الإضافة مسارات API مخصصة وآمنة لربط نظام Prof Solution ERP بمتجر ووكومرس (WooCommerce) الخاص بك. تدعم الأداة المزامنة الذكية للمنتجات البسيطة والمتغيرة، معالجة الصور المتعددة دون تكرار، والتحويل التلقائي لأنواع المنتجات.
التركيب والإعدادات:
- قم بتنصيب الإضافة وتفعيلها في ووردبريس.
- اذهب إلى الإعدادات > Prof Solution Sync Settings في لوحة تحكم ووردبريس.
- قم بنسخ Secret API Key لاستخدامه في برنامجك.
- حدد نوع الخصائص المفضل لديك (محلية Local أم عامة Global).
- فعل "سجلات الأخطاء" (Logging) لتتبع عمليات المزامنة في حال حدوث مشاكل.
Integration Guide: Prof Solution Sync
This plugin provides custom and secure API endpoints to connect your Prof Solution ERP system with your WooCommerce store. It supports smart synchronization for simple and variable products, prevents media duplication, and handles automatic product type conversion.
Setup & Configuration:
- Install and activate the plugin in WordPress.
- Go to Settings > Prof Solution Sync Settings in your WP admin dashboard.
- Copy the Secret API Key to use in your ERP software.
- Select your preferred Attributes Type (Local or Global).
- Enable "Logging" to track sync operations and errors.
المصادقة (Authentication)
جميع مسارات الـ API محمية وتتطلب إرسال مفتاح سري في ترويسة الطلب (Headers).
يجب إرسال الـ Header التالي مع كل طلب:
Authentication
All API endpoints are protected and require a secret key to be sent in the request headers.
You must include the following Header with every request:
API-Key: YOUR_SECRET_API_KEY_HERE
GET جلب المنتجات Get Products
/wp-json/prof-sync/v1/products
يستخدم هذا المسار لسحب المنتجات الموجودة حالياً في المتجر. يدعم نظام التصفح (Pagination) لتخفيف الحمل على السيرفر.
المعاملات (Parameters):
limit: عدد المنتجات في الصفحة (الافتراضي 10).page: رقم الصفحة المراد جلبها (الافتراضي 1).
Used to fetch existing products from the store. Supports pagination to reduce server load.
Parameters:
limit: Number of products per page (Default is 10).page: The page number to retrieve (Default is 1).
{
"success": true,
"message": "products fetched successfully",
"total": 125,
"data": [
{
"id": 101,
"name": "Cotton T-Shirt",
"sku": "TS-001",
"price": "150",
"stock_quantity": 20
}
]
}
POST تحديث المنتجات Update Products
/wp-json/prof-sync/v1/products
هذا المسار مخصص لتحديث المنتجات الموجودة فقط
بناءً على الـ sku.
This endpoint is strictly for updating existing
products based on the sku.
{
"products": [
{
"sku": "TS-001-RED",
"regular_price": "160",
"stock_quantity": 5
}
]
}
POST إضافة منتجات (المزامنة الذكية) Add Products (Smart Sync)
/wp-json/prof-sync/v1/add-products
يُعد هذا المسار هو العقل المدبر، حيث يتعرف على البيانات ويقوم بالإنشاء أو التحديث أو التحويل تلقائياً.
This is the brain of the sync system. It automatically creates, updates, or converts products based on the payload.
{
"products": [
{
"name": "Pro Running Shoe",
"sku": "SHOE-PRO-42-BLK",
"regular_price": 350,
"attributes": { "Color": "Black", "Size": "42" },
"image": "https://example.com/shoe.jpg"
}
]
}
POST حذف المنتجات Delete Products
/wp-json/prof-sync/v1/delete-products
استخدم هذا المسار لنقل المنتجات إلى "سلة المهملات" (Trash).
Use this endpoint to move products to the "Trash".
{
"products": [
{ "sku": "OLD-ITEM-001" }
]
}
معالجة الصور المتقدمة
Advanced Image Handling
ندعم الرفع عبر الروابط المباشرة أو نصوص Base64. نظام البصمة يمنع التكرار.
Supports direct URLs or Base64 strings. Fingerprint system prevents duplication.
الخصائص (Attributes)
Attributes Handling
يمكنك الاختيار بين الخصائص المحلية (Local) أو العامة (Global) من الإعدادات.
Choose between Local or Global attributes via the plugin settings.