openapi: 3.0.0
info:
  version: BM
  title: 
  description: Business Metrics
servers:
  - url: http://localhost:8094/
paths:
  /SalesMetrics:
    get:
      description: ''
      operationId: 'getSalesMetrics'
      parameters:
        - in: query
          name: createdon
          description: The date the item was created
          required: false
          schema:
            type: string
            format: date
        - in: query
          name: updatedon
          description: The date the item was last updated
          required: false
          schema:
            type: string
            format: date
      responses:
        200:
          description: A paged collection of items including a total count of matches
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/SalesMetricsCollection'
        403:
          description: A security issue occured, an incorrect API key is the most likely cause
        400:
          description: An incorrect query parameter or condition
  /SalesMetrics/{id}:
    get:
      description: ''
      operationId: 'getSalesMetricsById'
      parameters:
        - in: path
          name: id
          description: 'The ID of the item'
          required: true
          schema:
            type: integer
      responses:
        200:
          description: A single 
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/SalesMetrics'
        403:
          description: A security issue occured, an incorrect API key is the most likely cause
        400:
          description: An incorrect query parameter or condition
  /SalesMetricMeasures:
    get:
      description: ''
      operationId: 'getSalesMetricMeasures'
      parameters:
        - in: query
          name: createdon
          description: The date the item was created
          required: false
          schema:
            type: string
            format: date
        - in: query
          name: updatedon
          description: The date the item was last updated
          required: false
          schema:
            type: string
            format: date
      responses:
        200:
          description: A paged collection of items including a total count of matches
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/SalesMetricMeasuresCollection'
        403:
          description: A security issue occured, an incorrect API key is the most likely cause
        400:
          description: An incorrect query parameter or condition
  /SalesMetricMeasures/{id}:
    get:
      description: ''
      operationId: 'getSalesMetricMeasuresById'
      parameters:
        - in: path
          name: id
          description: 'The ID of the item'
          required: true
          schema:
            type: integer
      responses:
        200:
          description: A single 
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/SalesMetricMeasures'
        403:
          description: A security issue occured, an incorrect API key is the most likely cause
        400:
          description: An incorrect query parameter or condition
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
  schemas:
    PostResponse:
      type: object
      properties:
        Status:
          type: string
        Message:
          type: string
        QueueEntryId:
          type: integer
        Data:
          type: array
          items:
            type: object
            properties:
              Id:
                type: integer
              TypeName:
                type: string
              Info:
                type: string
    PutResponse:
      type: object
      properties:
        Status:
          type: string
        Message:
          type: string
        QueueEntryId:
          type: integer
        Data:
          type: array
          items:
            type: object
            properties:
              Id:
                type: integer
              TypeName:
                type: string
              Info:
                type: string
    SalesMetrics:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        UpdatedOn:
          type: string
          format: date
        CreatedOn:
          type: string
          format: date
        LinkedToCode:
          type: string
        LinkedToDescription:
          type: string
        MonthToDate:
          type: object
          properties:
            ID:
              type: integer
              format: int64
            UpdatedOn:
              type: string
              format: date
            CreatedOn:
              type: string
              format: date
            Description:
              type: string
            SalesRank:
              type: number
            Sales:
              type: number
            Margin:
              type: number
            MarginAmount:
              type: number
        MonthToDateSalesVariancePercent:
          type: number
        YearToDate:
          type: object
          properties:
            ID:
              type: integer
              format: int64
            UpdatedOn:
              type: string
              format: date
            CreatedOn:
              type: string
              format: date
            Description:
              type: string
            SalesRank:
              type: number
            Sales:
              type: number
            Margin:
              type: number
            MarginAmount:
              type: number
        YearToDateSalesVariancePercent:
          type: number
    SalesMetrics_Write:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        UpdatedOn:
          type: string
          format: date
        CreatedOn:
          type: string
          format: date
        LinkedToCode:
          type: string
        LinkedToDescription:
          type: string
        MonthToDate:
          type: number
        MonthToDateSalesVariancePercent:
          type: number
        YearToDate:
          type: number
        YearToDateSalesVariancePercent:
          type: number
    SalesMetricsCollection:
      type: object
      properties:
        TotalCount:
          type: integer
        Data:
          type: array
          items:
            $ref: '#/components/schemas/SalesMetrics'
    SalesMetricMeasures:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        UpdatedOn:
          type: string
          format: date
        CreatedOn:
          type: string
          format: date
        Description:
          type: string
        RangeDescription:
          type: string
        LastUpdatedDescription:
          type: string
        TradingDaysToDate:
          type: number
        PercentageThroughTradingDays:
          type: number
        Sales:
          type: number
        Cost:
          type: number
        SellingCost:
          type: number
        SalesRank:
          type: number
        Margin:
          type: number
        MarginAmount:
          type: number
        SellingMargin:
          type: number
        SellingMarginAmount:
          type: number
        MarginAmountRank:
          type: number
        SellingMarginAmountRank:
          type: number
        QuantityInStockingUnits:
          type: number
        Volume:
          type: number
        Weight:
          type: number
        ManuallyPricedLinesRatio:
          type: number
        NumberOfManuallyPricedLines:
          type: number
        ManualDiscountAmount:
          type: number
        ManualDiscountAmountRank:
          type: number
        CreditNoteToInvoiceRatio:
          type: number
        NumberOfCreditNoteLines:
          type: number
        CreditNoteAmount:
          type: number
        NumberOfInvoiceLines:
          type: number
        InvoiceAmount:
          type: number
        CashSalePercentageOfSales:
          type: number
        CollectedPercentageOfSales:
          type: number
        DeliveredPercentageOfSales:
          type: number
        ExStockPercentageOfSales:
          type: number
        DirectPercentageOfSales:
          type: number
        SpecialLinesRatio:
          type: number
        NumberOfSpecialLines:
          type: number
        NumberOfSpecialLinesRank:
          type: number
    SalesMetricMeasures_Write:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        UpdatedOn:
          type: string
          format: date
        CreatedOn:
          type: string
          format: date
        Description:
          type: string
        RangeDescription:
          type: string
        LastUpdatedDescription:
          type: string
        TradingDaysToDate:
          type: number
        PercentageThroughTradingDays:
          type: number
        Sales:
          type: number
        Cost:
          type: number
        SellingCost:
          type: number
        SalesRank:
          type: number
        Margin:
          type: number
        MarginAmount:
          type: number
        SellingMargin:
          type: number
        SellingMarginAmount:
          type: number
        MarginAmountRank:
          type: number
        SellingMarginAmountRank:
          type: number
        QuantityInStockingUnits:
          type: number
        Volume:
          type: number
        Weight:
          type: number
        ManuallyPricedLinesRatio:
          type: number
        NumberOfManuallyPricedLines:
          type: number
        ManualDiscountAmount:
          type: number
        ManualDiscountAmountRank:
          type: number
        CreditNoteToInvoiceRatio:
          type: number
        NumberOfCreditNoteLines:
          type: number
        CreditNoteAmount:
          type: number
        NumberOfInvoiceLines:
          type: number
        InvoiceAmount:
          type: number
        CashSalePercentageOfSales:
          type: number
        CollectedPercentageOfSales:
          type: number
        DeliveredPercentageOfSales:
          type: number
        ExStockPercentageOfSales:
          type: number
        DirectPercentageOfSales:
          type: number
        SpecialLinesRatio:
          type: number
        NumberOfSpecialLines:
          type: number
        NumberOfSpecialLinesRank:
          type: number
    SalesMetricMeasuresCollection:
      type: object
      properties:
        TotalCount:
          type: integer
        Data:
          type: array
          items:
            $ref: '#/components/schemas/SalesMetricMeasures'
security:
  - apiKey: []
