dambel

دمبل

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

API Docs / gyms / buffet-items / create



POST /api/v1/gyms/{gym-id}/buffet-items

Creates a new buffet item for a gym.


Permissions

PermissionDescription
buffet_items.createCreate buffet items for your own gym
buffet_items.create_anyCreate buffet items for any gym (admin only)

Path Parameters

NameTypeRequiredDescriptionExample
gym-idintYesID of the gym123

Request Body Parameters

NameTypeRequiredDescriptionExample
titlestringYesTitle of the item (max 255 characters)"Protein Bar"
descriptionstringNoDescription for the item (max 2000 chars)"Tasty bar"
priceintYesPrice of the item100
discountfloatNoDiscount percentage (default 0)10.5

Request Example

{
  "title": "Protein Bar",
  "description": "Tasty bar",
  "price": 100,
  "discount": 10.5
}

Response

201 Created

Returns the created gym buffet item resource.

Example

{
  "id": 1,
  "gym_id": 123,
  "title": "Protein Bar",
  "description": "Tasty bar",
  "price": 100,
  "discount": 10.5,
  "discounted_price": 89.5,
  "media": []
}

For a full schema, see Gym Buffet Item Resource.


Error Responses

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

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

LinkedinInstagramXYoutube