सदस्यता प्लान सहेजें
सदस्यता प्लान रिकॉर्ड बनाता या अपडेट करता है। API, membership_plan_id के आधार पर तय करता है कि रिकॉर्ड बनाना है या अपडेट करना है।
पैरामीटर
-
membership_plans
arrayआवश्यकसहेजे जाने वाले सदस्यता प्लान ऑब्जेक्ट का ऐरे। अनुशंसित अधिकतम: बेहतर प्रदर्शन के लिए प्रति अनुरोध 1000 आइटम। API प्रोसेसिंग के लिए आइटम को अपने आप बैच करता है। हर आइटम में या तो
facility_id(यदिlinking_identifierका उपयोग नहीं कर रहे हैं तो आवश्यक) याlinking_identifier(यदिfacility_idका उपयोग नहीं कर रहे हैं तो आवश्यक) शामिल होना चाहिए।
रिटर्न
सिंक ऑपरेशन की पुष्टि करने वाला एक सरल संदेश लौटाता है।
अनुरोध
यह उदाहरण facility_id का उपयोग करता है। लिंकिंग-आइडेंटिफ़ायर इंटीग्रेशन के लिए, इसके बजाय "linking_identifier": "branch_downtown" भेजें।
curl -X POST https://partner-api.performancehub.co/partner/v1/membership-plans \
-u sk_live_YOUR_PARTNER_SECRET_KEY: \
-H "Content-Type: application/json" \
-d '{
"membership_plans": [
{
"membership_plan_id": "plan_99999",
"facility_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Student – term access",
"description": "Library and student hub access for one teaching term",
"billing_cycle": "one_time",
"price": 4500,
"currency": "AUD",
"duration_days": 84,
"is_recurring": false,
"is_trial": false,
"visible_to_public": true,
"active_members": 245,
"access_zones": [
{
"name": "Library",
"description": "Reading rooms, study spaces and bookable rooms",
"access_hours": {
"mon": [["08:00", "21:00"]],
"tue": [["08:00", "21:00"]],
"wed": [["08:00", "21:00"]],
"thu": [["08:00", "21:00"]],
"fri": [["08:00", "17:00"]],
"sat": [["09:00", "13:00"]]
}
},
{
"name": "Student Hub",
"description": "Common room, kitchen and lockers",
"access_hours": {
"mon": [["07:00", "22:00"]],
"tue": [["07:00", "22:00"]],
"wed": [["07:00", "22:00"]],
"thu": [["07:00", "22:00"]],
"fri": [["07:00", "22:00"]]
}
}
],
"class_limit": null
}
]
}'
रिस्पॉन्स
सिंक ऑपरेशन के मेटाडेटा के साथ एक सफलता संदेश लौटाता है।
{
"message": "Membership plan sync successful.",
"metadata": {
"success": 98,
"skipped": 2,
"skipped_items": [
{
"membership_plan_id": "plan_456",
"facility_id": null,
"reason": "Missing facility_id"
}
]
}
}
मेटाडेटा फ़ील्ड:
- success - सफलतापूर्वक प्रोसेस किए गए सदस्यता प्लान की संख्या
- skipped - छोड़े गए प्लान की संख्या (यदि कोई हो)
- skipped_items - कारणों सहित छोड़े गए प्लान का ऐरे (यदि कोई हो)
- dry-run - dryrun कुंजी प्रकार का उपयोग करने पर बूलियन फ़्लैग (यदि लागू हो)