dambel

دمبل

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

API Docs / gyms / plans / create



POST /api/v1/gyms/{gym-id}/plans

Creates a new subscription plan for a gym.


Permissions

PermissionDescription
gym_plans.createCreate plans for your own gyms
gym_plans.create_anyCreate plans for any gym

URL Parameters

NameTypeRequiredDescriptionExample
gym-idintYesID of the gym123

Request Body Parameters

NameTypeRequiredDescriptionExample
titlestringYesTitle of the plan (max 255 chars)"Basic"
descriptionstringNoDescription (max 2000 chars, optional)"Some desc"
priceintYesPrice 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.


Request Example

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

Response

201 Created

Returns the created 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