멤버십 플랜 저장
멤버십 플랜 레코드를 생성하거나 업데이트합니다. 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 키 유형을 사용하는 경우의 부울 플래그(해당하는 경우)