REST API রেফারেন্স
বেস কনফিগারেশন
বেস URL: {site_url}/wp-json/wu/v2/
প্রমাণীকরণ: API Key ও Secret (HTTP Basic Auth বা URL প্যারামিটার)
প্রমাণীকরণ
API সক্রিয় করুন
// Enable API in Ultimate Multisite settings or programmatically
wu_save_setting('enable_api', true);
API ক্রেডেনশিয়াল নিন
$api_key = wu_get_setting('api_key');
$api_secret = wu_get_setting('api_secret');
প্রমাণীকরণ পদ্ধতি
HTTP Basic Auth (প্রস্তাবিত):
curl -u "api_key:api_secret" https://yoursite.com/wp-json/wu/v2/customers
URL প্যারামিটার:
curl "https://yoursite.com/wp-json/wu/v2/customers?api_key=your_key&api_secret=your_secret"
মূল এন্ডপয়েন্ট
1. গ্রাহক API
বেস রুট: /customers
সব গ্রাহক নিন
GET /wu/v2/customers
একজন গ্রাহক নিন
GET /wu/v2/customers/{id}
গ্রাহক তৈরি করুন
POST /wu/v2/customers
Content-Type: application/json
{
"user_id": 123,
"email_verification": "verified",
"type": "customer",
"has_trialed": false,
"vip": false
}
গ্রাহক আপডেট করুন
PUT /wu/v2/customers/{id}
Content-Type: application/json
{
"vip": true,
"extra_information": "VIP customer notes"
}
গ্রাহক মুছুন
DELETE /wu/v2/customers/{id}
2. সাইট API
বেস রুট: /sites
সাইট তৈরি করুন
POST /wu/v2/sites
Content-Type: application/json
{
"customer_id": 5,
"membership_id": 10,
"domain": "example.com",
"path": "/",
"title": "My New Site",
"template_id": 1,
"type": "customer_owned"
}
3. সদস্যতা API
বেস রুট: /memberships
সদস্যতা তৈরি করুন
POST /wu/v2/memberships
Content-Type: application/json
{
"customer_id": 5,
"plan_id": 3,
"status": "active",
"gateway": "stripe",
"gateway_subscription_id": "sub_1234567890",
"auto_renew": true
}
4. পণ্য API
বেস রুট: /products
সব পণ্য নিন
GET /wu/v2/products
5. পেমেন্ট API
বেস রুট: /payments
পেমেন্ট তৈরি করুন
POST /wu/v2/payments
Content-Type: application/json
{
"customer_id": 5,
"membership_id": 10,
"status": "completed",
"gateway": "stripe",
"gateway_payment_id": "pi_1234567890",
"total": 29.99,
"currency": "USD"
}