/customer/{storeid}:
  get:
    tags:
    - customer
    description: Return all the customers belong to given store
    operationId: listCustomers
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: list of customer
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Customer'
  post:
    tags:
    - customer
    description: Update/Create customer
    operationId: saveCustomer
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    requestBody:
      required: true
      content:
        application/json: 
          schema: 
            $ref: '#/components/schemas/Customer'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#upsert: './responses/20x-upsert.yaml'

/customer/{storeid}/{id}:
  get:
    tags:
    - customer
    description: Return the customer with given id
    operationId: loadCustomer
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: customer detail
        content:
          application/json:
            schema:
              type: object
              properties: 
                value:
                  $ref: '#/components/schemas/Customer'
  delete:
    tags:
    - customer
    description: Delete a customer with given id
    operationId: deleteCustomer
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#204: './responses/204.yaml'

/customer/{storeid}/delete:
  post:
    tags:
    - customer
    description: Delete multiple customers
    operationId: deleteMultipleCustomers
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    requestBody:
      required: true
      content:
        application/json: 
          schema:
            type: object
            properties:
              ids:
                type: array
                items:
                  type: string
    responses:
      $ref#4xx: './responses/4xx.yaml'
      204:
        description: Customers are deleted

/customer/{storeid}/import:
  post:
    tags:
    - customer
    description: Import customers by csv file and return an id to track import process.
    operationId: importCustomer
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    requestBody:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              file:
                type: string
                format: binary
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: data import start
        content:
            application/json:
              schema:
                type: object
                properties:
                  importid:
                    description: import id to track import process
                    type: string