---
title: "Update Beer by Id"
url: "https://dev-portal.dehaven.org/apis/beer-api-v1/versions/a462a401-23c6-469f-86bf-c6017a4a1733/operations/updateBeerByIdV1"
---

> Full API specification: https://dev-portal.dehaven.org/apis/beer-api-v1/versions/a462a401-23c6-469f-86bf-c6017a4a1733.md

# Update Beer by Id

`PUT` `/api/v1/beer/{beerId}`

Operation ID: `updateBeerByIdV1`

Update Beer by Id

## Path parameters

- `beerId` (string, uuid, required) - Beer Id

## Request body (required)

Content types: `application/json`

## Responses

- `204` - Beer Updated
- `400` - Bad Reqeust
- `404` - Not Found
- `409` - Conflict

## OpenAPI definition

```yaml
openapi: 3.0.2
info:
  title: SFG Brewery API
  version: "1.3"
servers:
  - url: http://localhost:8080
    description: Local Host
  - url: http://api.springframework.guru
    description: Demo API
paths:
  /api/v1/beer/{beerId}:
    put:
      description: Update Beer by Id
      summary: Update Beer by Id
      operationId: updateBeerByIdV1
      tags:
        - Beer Service
      parameters:
        - $ref: "#/components/parameters/BeerId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Beer"
      responses:
        "204":
          description: Beer Updated
        "400":
          description: Bad Reqeust
        "404":
          description: Not Found
        "409":
          description: Conflict
components:
  parameters:
    BeerId:
      name: beerId
      in: path
      description: Beer Id
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Beer:
      type: object
      allOf:
        - $ref: "#/components/schemas/BaseItem"
      required:
        - beerName
        - beerStyle
        - price
        - upc
      properties:
        beerName:
          type: string
        beerStyle:
          $ref: "#/components/schemas/BeerStyleEnum"
        upc:
          type: string
        quantityOnHand:
          type: integer
        price:
          type: string
          format: decimal
    BaseItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        version:
          type: integer
          readOnly: true
          nullable: true
        createdDate:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        lastModifiedDate:
          type: string
          format: date-time
          readOnly: true
          nullable: true
    BeerStyleEnum:
      type: string
      enum:
        - LAGER
        - PILSNER
        - STOUT
        - GOSE
        - PORTER
        - ALE
        - WHEAT
        - IPA
        - PALE_ALE
        - SAISON
```
