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

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

# createNewCustomer

`POST` `/api/v1/customers`

Operation ID: `createNewCustomer`

Register as new customer

## Request body

Content types: `application/json`

## Responses

- `201` - Customer Created
- `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/customers:
    post:
      description: Register as new customer
      operationId: createNewCustomer
      tags:
        - Order Service
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Customer"
      responses:
        "201":
          description: Customer Created
          headers:
            Location:
              description: Reference to created customer
              schema:
                type: string
                format: uri
        "400":
          description: Bad Reqeust
        "404":
          description: Not Found
        "409":
          description: Conflict
components:
  schemas:
    Customer:
      type: object
      required:
        - name
      allOf:
        - $ref: "#/components/schemas/BaseItem"
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
    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
```
