openapi: '3.0.2'
info:
  title: Hero API
  version: '1.0'
  description: API specification is subject to change.
servers:
  - url: https://api.haulerhero.com
components:
  schemas:
    AddressView:
      type: object
      properties:
        addressId:
          description: Unique identifier for the address. Ignored when creating a new address.
          type: string
        street:
          type: string
        unit:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
        zip:
          type: string
    ContactView:
      type: object
      properties:
        contactId:
          description: Unique identifier for the contact. Ignored when creating a new contact.
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        phone:
          type: string
    AccountView:
      type: object
      properties:
        accountId:
          description: Unique identifier for the account. Ignored when creating a new account.
          type: string
        accountNumber:
          description: Unique account number. Ignored when creating a new account.
          type: string
        accountName:
          type: string
        billingAddress:
          $ref: '#/components/schemas/AddressView'
        primaryContact:
          $ref: '#/components/schemas/ContactView'
paths:
  /hero-api/v1/accounts:
    post:
      tags:
        - Accounts API
      summary: Creates a new account
      description: Creates a new account with location and contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountView'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountView'