> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domsoftware.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Criar Depósito

> Cria um novo Centro de Distribuição/Armazém no Hub, permitindo particionar o estoque cross-docking físico do seu negócio.

### Body

<ParamField body="name" type="string" required>Nome ou apelido do Armazém.</ParamField>
<ParamField body="code" type="string" required>Código interno de rasteio (ex: `SP-01`). Retorna erro 409 se duplicar.</ParamField>
<ParamField body="zipCode" type="string">CEP local (opcional).</ParamField>
<ParamField body="address" type="string">Logradouro físico (opcional).</ParamField>
<ParamField body="active" type="boolean" default="true">Status operacional de esteira do armazém.</ParamField>
<ParamField body="isDefault" type="boolean" default="false">Se marcado como `true`, assume como matriz e retira o flag de "default" dos outros.</ParamField>

### Response

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
    "name": "Armazém Norte",
    "code": "N-02",
    "isDefault": false
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /warehouses
openapi: 3.0.0
info:
  title: Hub Marketplace API
  description: API for managing marketplace listings and keys
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: listings
    description: ''
paths:
  /warehouses:
    post:
      tags:
        - Warehouses
      summary: Criar novo depósito
      operationId: WarehousesController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWarehouseDto'
      responses:
        '201':
          description: Depósito criado com sucesso
        '409':
          description: Código de depósito duplicado
      security:
        - bearer: []
components:
  schemas:
    CreateWarehouseDto:
      type: object
      properties:
        name:
          type: string
          description: Nome do depósito
          example: Depósito Principal
        code:
          type: string
          description: Código único (auto-gerado se vazio)
          example: DEP-001
        type:
          type: string
          enum:
            - OWN
            - STORE
            - FULFILLMENT
            - THIRD_PARTY
          description: Tipo do depósito
          default: OWN
        companyId:
          type: string
          description: ID da empresa associada
        address:
          description: Endereço do depósito
          allOf:
            - $ref: '#/components/schemas/WarehouseAddressDto'
        notes:
          type: string
          description: Observações
      required:
        - name
    WarehouseAddressDto:
      type: object
      properties:
        street:
          type: string
        number:
          type: string
        complement:
          type: string
        neighborhood:
          type: string
        city:
          type: string
        state:
          type: string
        zipCode:
          type: string

````