swagger: '2.0'
info:
  version: '2.0'
  title: store-locations
consumes:
  - application/json
produces:
  - application/json
paths:
  /store-locations:
    get:
      tags:
        - store-locations
      description: Get a collection of store locations.
      operationId: getStoreLocations
      parameters:
        - name: id
          in: query
          description: The store location ID.
          required: false
          type: integer
          format: int32
        - name: identifier
          in: query
          description: The external identifier of this store location.
          required: false
          type: string
        - name: phone
          in: query
          description: The store location phone number.
          required: false
          type: string
        - name: fax
          in: query
          description: The store location fax number.
          required: false
          type: string
        - name: address1
          in: query
          description: The store location address line 1.
          required: false
          type: string
        - name: address2
          in: query
          description: The store location address line 2.
          required: false
          type: string
        - name: address3
          in: query
          description: The store location address line 3.
          required: false
          type: string
        - name: city
          in: query
          description: The city that the store locates.
          required: false
          type: string
        - name: state
          in: query
          description: The state or province of the store location.
          required: false
          type: string
        - name: country
          in: query
          description: The country or region of the store location.
          required: false
          type: string
        - name: zipCode
          in: query
          description: The zip or postal code of the store location.
          required: false
          type: string
        - name: active
          in: query
          description: '1 if the store is active. Otherwise, 0.'
          required: false
          type: integer
          format: int32
        - name: latitude
          in: query
          description: The latitude of the store in degrees north or south of the equator.
          required: false
          type: number
          format: double
        - name: longitude
          in: query
          description: The longitude of the store in degrees east or west of the Greenwich meridian.
          required: false
          type: number
          format: double
        - name: geoNodeId
          in: query
          description: The ID of the geo node that the store locates.
          required: false
          type: integer
          format: int32
        - name: storeId
          in: query
          description: The reference number of the store.
          required: false
          type: integer
          format: int32
        - name: offset
          in: query
          description: The index of the first item to be returned.
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of items to be returned.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: The fields to be returned.
          required: false
          type: string
        - name: expand
          in: query
          description: The related resources to be embedded.
          required: false
          type: string
      responses:
        '200':
          description: A collection of store locations.
          schema:
            $ref: '#/definitions/StoreLocationCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - store-locations
      description: Create a store location.
      operationId: createStoreLocation
      parameters:
        - in: body
          name: StoreLocation
          description: Store locations.
          required: true
          schema:
            $ref: '#/definitions/StoreLocation'
      responses:
        '201':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
  '/store-locations/{id}':
    get:
      tags:
        - store-locations
      description: Get a store location.
      operationId: getStoreLocationById
      parameters:
        - name: fields
          in: query
          description: The fields to be returned.
          required: false
          type: string
        - name: expand
          in: query
          description: The related resources to be embedded.
          required: false
          type: string
      responses:
        '200':
          description: Store locations.
          schema:
            $ref: '#/definitions/StoreLocation'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    delete:
      tags:
        - store-locations
      description: Delete a store location.
      operationId: deleteStoreLocationById
      parameters: []
      responses:
        '204':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    patch:
      tags:
        - store-locations
      description: Update a store location.
      operationId: updateStoreLocationById
      parameters:
        - in: body
          name: StoreLocation
          description: Store locations.
          required: true
          schema:
            $ref: '#/definitions/StoreLocation'
      responses:
        '200':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The store location ID.
        required: true
        type: integer
        format: int32
definitions:
  Link:
    type: object
    properties:
      href:
        type: string
        format: uri
  Error:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
      messageKey:
        type: string
      messageArguments:
        type: array
        items:
          type: object
      correlationId:
        type: string
      locale:
        type: string
  ErrorResponseContainer:
    type: object
    properties:
      requestId:
        type: string
      errors:
        type: array
        items:
          $ref: '#/definitions/Error'
  StoreLocation:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The store location ID.
      identifier:
        type: string
        description: The external identifier of this store location.
      phone:
        type: string
        description: The store location phone number.
      fax:
        type: string
        description: The store location fax number.
      address1:
        type: string
        description: The store location address line 1.
      address2:
        type: string
        description: The store location address line 2.
      address3:
        type: string
        description: The store location address line 3.
      city:
        type: string
        description: The city that the store locates.
      state:
        type: string
        description: The state or province of the store location.
      country:
        type: string
        description: The country or region of the store location.
      zipCode:
        type: string
        description: The zip or postal code of the store location.
      active:
        type: integer
        format: int32
        description: '1 if the store is active. Otherwise, 0.'
      latitude:
        type: number
        format: double
        description: The latitude of the store in degrees north or south of the equator.
      longitude:
        type: number
        format: double
        description: The longitude of the store in degrees east or west of the Greenwich meridian.
      geoNodeId:
        type: integer
        format: int32
        description: The ID of the geo node that the store locates.
      storeId:
        type: integer
        format: int32
        description: The reference number of the store.
    description: Store locations.
  StoreLocationCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/StoreLocation'
    description: A collection of store locations.
