dambel

دمبل

shevron
ورود | ثبت نام

API Docs / gyms / plans / update



PUT /api/v1/gyms/{gym-id}/plans/{plan-id}

Updates a specific subscription plan for a gym.


Permissions

PermissionDescription
gym_plans.updateUpdate plans for your own gyms
gym_plans.update_anyUpdate plans for any gym

URL Parameters

NameTypeRequiredDescriptionExample
gym-idintYesID of the gym123
plan-idintYesID of the plan55

Request Body Parameters

NameTypeRequiredDescriptionExample
titlestringNoTitle of the plan (max 255 chars)"Basic"
descriptionstringNoDescription (max 2000 chars, optional)"Some desc"
priceintNoPrice of the plan150000
discountfloatNoDiscount percentage (optional, default 0)10.0
duration_daysintNoNumber of days until expiration (optional)30
sessions_countintNoNumber of sessions in the plan (optional)20
is_activeboolNoWhether the plan is activetrue

Note: Either duration_days or sessions_count can be null. All parameters are optional; only include fields you wish to update. You can set them to null to clear their value.


Request Example

{
  "title": "Basic",
  "description": "Some desc",
  "price": 150000,
  "discount": 10.0,
  "duration_days": 30,
  "sessions_count": 20,
  "is_active": true
}

Response

200 OK

Returns the updated gym plan resource.

Example

{ /* gym plan resource */ }

For a full schema, see Gym Plan Resource.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube