---
openapi: 3.0.0
info:
  title: MyCarrier Rating API Preprod
  description: 'This is a MyCarrier Rating API specification. (preprod) '
  termsOfService: http://swagger.io/terms/
  contact:
    email: charaann@longhaulintegration.com
  version: 1.0.0
servers:
- url: https://app-integration-preprod-api.azurewebsites.net/feature
paths:
  /rating:
    post:
      tags:
      - request quote from MyCarrier api
      summary: request quote from MyCarrier for various carriers
      description: request quote from MyCarrier for various carriers
      operationId: requestquote
      requestBody:
        description: request quote from MyCarrier for required multiple carriers
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RateQuoteRequest'
        required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateQuoteResponse'
        "400":
          description: Invalid request
        "404":
          description: Request was not found
        "405":
          description: Validation exception
components:
  schemas:
    dimensions:
      type: object
      properties:
        height:
          type: integer
          format: int32
          example: 41
        heightUOM:
          type: string
          example: INCHES
        length:
          type: integer
          format: int32
          example: 48
        lengthUOM:
          type: string
          example: INCHES
        width:
          type: integer
          format: int32
          example: 48
        widthUOM:
          type: string
          example: INCHES
        weight:
          type: integer
          format: int32
          example: 200
        weightUOM:
          type: string
          example: LB
        stackable:
          type: boolean
        quantity:
          type: integer
          format: int32
          example: 1
        packageType:
          type: string
          example: BAG
    multipleItem:
      type: object
      properties:
        lineItemId:
          type: string
          example: "5"
        commodityName:
          type: string
          example: Test name
        class:
          type: string
          example: "60"
        commodityDescription:
          type: string
          example: test description
        countryOfManufacture:
          type: string
          example: United States
        nmfcItemCode:
          type: string
          example: "123"
        nmfcSubCode:
          type: string
          example: "12345"
        commodityType:
          type: string
          example: string
        isHazmat:
          type: boolean
        hazmat:
          $ref: '#/components/schemas/hazmat'
        unitValue:
          type: integer
          format: int32
          example: 0
        unitValueCurrency:
          type: string
          example: USD
        weight:
          type: integer
          format: int32
          example: 200
        quantity:
          type: integer
          format: int32
          example: 1
    contact:
      type: object
      properties:
        contactName:
          type: string
          example: personsname
        phone:
          type: string
          example: (999) 999-9999
        email:
          type: string
          example: testemail@test.com
    hazmat:
      type: object
      properties:
        identification_number:
          type: string
          example: UN1000
        packingGroupId:
          type: string
          example: High
        classId:
          type: string
          example: ExtremelyInsensitiveExplosives
        emergencyContact:
          $ref: '#/components/schemas/contact'
    pickschedule:
      type: object
      properties:
        date:
          type: string
          format: date
        start_time:
          type: string
          example: 14:00:00
        end_time:
          type: string
          example: 20:00:00
    country:
      type: object
      properties:
        alpha2Code:
          type: string
          example: US
        name:
          type: string
          example: United States
    shipmentitems:
      type: object
      properties:
        lineItemId:
          type: string
          example: "5"
        commodityName:
          type: string
          example: Test name
        class:
          type: string
          example: "60"
        commodityDescription:
          type: string
          example: test description
        countryOfManufacture:
          type: string
          example: United States
        associatedPickupStopNumber:
          type: integer
          format: int32
          example: 1
        associatedDropStopNumber:
          type: integer
          format: int32
          example: 2
        nmfcItemCode:
          type: string
          example: "123"
        nmfcSubCode:
          type: string
          example: "12345"
        commodityType:
          type: string
          example: string
        harmonizedCode:
          type: string
          example: string
        isHazmat:
          type: boolean
        hazmat:
          $ref: '#/components/schemas/hazmat'
        unitValue:
          type: integer
          format: int32
          example: 0
        unitValueCurrency:
          type: string
          example: USD
        dimensions:
          $ref: '#/components/schemas/dimensions'
        multipleItems:
          $ref: '#/components/schemas/multipleItem'
    pickup:
      type: object
      properties:
        stopNumber:
          type: integer
          format: int32
          example: 1
        stopType:
          type: string
          example: PICKUP
        name:
          type: string
          example: Compco
        addressLine1:
          type: string
          example: 59 Bedford St
        addressLine2:
          type: string
        city:
          type: string
          example: Stamford
        stateProvince:
          type: string
          example: CT
        postalCode:
          type: string
          example: "06901"
        country:
          $ref: '#/components/schemas/country'
        latitude:
          type: number
          example: 32.7325
        longitude:
          type: number
          example: -117.2011
        contactEmail:
          type: string
          example: test@email.com
        contactName:
          type: string
          example: Person Name
        contactPhone:
          type: string
          example: (999) 999-9999
        schedule:
          $ref: '#/components/schemas/pickschedule'
        isScheduleRequired:
          type: boolean
        note:
          type: string
          example: Check in with security prior to loading or unloading.
    shipment_booking_request:
      type: object
      properties:
        shipmentId:
          type: string
          example: shipment Id
        shipmentType:
          type: string
          example: LTL
        schedulePickupStartDate:
          type: string
          example: 2022-12-01T20:00:00.000Z
        schedulePickupEndDate:
          type: string
          example: 2022-12-05T23:00:00.000Z
        scheduleDeliveryStartDate:
          type: string
          example: 2022-09-02T20:00:00.000Z
        scheduleDeliveryEndDate:
          type: string
          example: 2022-09-02T23:00:00.000Z
        currencyType:
          type: string
          example: USD
        shipmentValue:
          type: integer
          format: int32
          example: 10000
        shipmentMode:
          type: string
          example: Dry Van
        perishableItem:
          type: boolean
        perishableTempMin:
          type: integer
          format: int32
          example: 0
        perishableTempMax:
          type: integer
          format: int32
          example: 0
        perishableTempUOM:
          type: string
          example: F
        paymentType:
          type: string
          example: Outbound Prepaid
        totalWeight:
          type: integer
          format: int32
          example: 20000
        totalWeightUOM:
          type: string
          example: LB
        totalPieces:
          type: integer
          format: int32
          example: 20
        totalPiecesUOM:
          type: string
          example: PCS/PLTS/BOXES/CARTONS
        totalVolume:
          type: integer
          format: int32
          example: 30000
        totalVolumeUOM:
          type: string
          example: CFT/CMTR
        totalLinearFeet:
          type: integer
          format: int32
          example: 10
        preferredSystemOfMeasurement:
          type: string
          example: METRIC
        stops:
          type: array
          items:
            $ref: '#/components/schemas/pickup'
        multipleItemsPerHandlingUnit:
          type: boolean
          example: false
        shipmentLineItems:
          type: array
          items:
            $ref: '#/components/schemas/shipmentitems'
    carrier:
      type: object
      properties:
        name:
          type: string
          example: SAIA
        uuid:
          type: string
        scac:
          type: string
          example: SAIA
    serviceLevel:
      type: object
      properties:
        code:
          type: string
          example: STD
        description:
          type: string
          example: Standard Rate
        guaranteed:
          type: string
        serviceDays:
          type: string
        serviceType:
          type: string
    priceBreakUp:
      type: object
      properties:
        type:
          type: string
          example: FSC
        code:
          type: string
          example: FSC
        description:
          type: string
          example: Fuel Surcharge
        price:
          type: string
          example: "43.06"
    price:
      type: object
      properties:
        serviceLevel:
          $ref: '#/components/schemas/serviceLevel'
        grossPrice:
          type: string
          example: "154.56"
        netPrice:
          type: string
          example: "154.56"
        priceBreakUp:
          type: array
          items:
            $ref: '#/components/schemas/priceBreakUp'
    rates:
      type: object
      properties:
        quoteStatus:
          type: string
          example: available
        rejectReason:
          type: string
          format: nullable
        quoteId:
          type: string
          example: "139805226"
        carrierQuoteId:
          type: string
        shipmentMode:
          type: string
        equipmentType:
          type: string
        quoteExpiryDate:
          type: string
        currencyCode:
          type: string
          example: USD
        carrier:
          $ref: '#/components/schemas/carrier'
        price:
          type: array
          items:
            $ref: '#/components/schemas/price'
    data_quote_request:
      type: object
      properties:
        preferredCarriers:
          type: string
          example: SAIA
        accessorialServices:
          type: string
          example: "INDEL,LGDEL,RESDEL"
        shipment:
          $ref: '#/components/schemas/shipment_booking_request'
    data_quote_response:
      type: object
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/rates'
    RateQuoteRequest:
      required:
      - customerEmail
      - locationId
      type: object
      properties:
        specVersion:
          type: string
          example: "1"
        type:
          type: string
          example: com.mycarrier.carrier.integrations
        source:
          type: string
          example: https://mycarrier.uat.com
        id:
          type: string
          example: bcef4153-0e25-4435-9f76-93a91f675d31
        time:
          type: string
          example: 2022-10-03T15:03:05.450Z
        direction:
          type: string
          example: outbound
        customerName:
          type: string
          example: Amazon
        customerEmail:
          type: string
          example: MyCarrieradminEmail@domain.com
        locationId:
          type: string
          example: "682656"
        data:
          $ref: '#/components/schemas/data_quote_request'
    RateQuoteResponse:
      type: object
      properties:
        specVersion:
          type: string
          example: "1"
        type:
          type: string
          example: com.mycarrier.carrier.integrations
        source:
          type: string
          example: https://mycarrier.uat.com
        id:
          type: string
          example: bcef4153-0e25-4435-9f76-93a91f675d31
        time:
          type: string
          example: 2023-01-24T10:18:11.000Z
        dataContentType:
          type: string
          example: application/json
        erpType:
          type: string
          format: nullable
        direction:
          type: string
          example: inbound
        subject:
          type: string
        erpRecordType:
          type: string
          format: nullable
        carrierScacCode:
          type: string
        data:
          $ref: '#/components/schemas/data_quote_response'
