dambel

دمبل

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

API Docs / gyms / buffet-items / update



PUT /api/v1/gyms/{gym-id}/buffet-items/{buffet-item-id}

Updates a buffet item for a gym. All parameters are optional; only provided fields will be updated. You can set fields to null to clear them.


Permissions

PermissionDescription
gym_buffet_items.updateUpdate buffet items for your own gym
gym_buffet_items.update_anyUpdate buffet items for any gym (admin only)

Path Parameters

NameTypeRequiredDescriptionExample
gym-idintYesID of the gym123
buffet-item-idintYesID of the buffet item5

Request Body Parameters

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

Request Example

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

Response

200 OK

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