Save a membership plan
Creates or updates membership plan records. The API determines whether to create or update based on the membership_plan_id.
Parameters
-
membership_plans
arrayrequiredArray of Membership Plan objects to save. Recommended maximum: 1000 items per request for optimal performance. The API automatically batches items for processing. Each item must include either
facility_id(required if not usinglinking_identifier) orlinking_identifier(required if not usingfacility_id).
Returns
Returns a simple message confirming the sync operation.
Request
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",
// "linking_identifier": "branch_downtown", // If using linking identifier
"name": "Unlimited Monthly",
"description": "Unlimited access to all gym facilities and group classes",
"billing_cycle": "monthly",
"price": 8900,
"currency": "AUD",
"duration_days": 30,
"is_recurring": true,
"is_trial": false,
"visible_to_public": true,
"active_members": 245,
"access_zones": [
{
"name": "Main Gym Floor",
"description": "Full access to cardio and weight training equipment",
"access_hours": {
"mon": [["05:00", "22:00"]],
"tue": [["05:00", "22:00"]],
"wed": [["05:00", "22:00"]],
"thu": [["05:00", "22:00"]],
"fri": [["05:00", "22:00"]],
"sat": [["06:00", "20:00"]],
"sun": [["07:00", "18:00"]]
}
},
{
"name": "Group Fitness Studio",
"description": "Access to group fitness classes",
"access_hours": {
"sat": [["06:00", "20:00"]],
"sun": [["07:00", "18:00"]]
}
}
],
"class_limit": null
}
]
}'
Response
Returns a success message with metadata about the sync operation.
{
"message": "Membership plan sync successful.",
"metadata": {
"success": 98,
"skipped": 2,
"skipped_items": [
{
"membership_plan_id": "plan_456",
"facility_id": null,
"reason": "Missing facility_id"
}
]
}
}
Metadata fields:
- success - Number of membership plans successfully processed
- skipped - Number of plans skipped (if any)
- skipped_items - Array of skipped plans with reasons (if any)
- dry-run - Boolean flag if using dryrun key type (if applicable)