openapi: 3.1.0
info:
  title: Estimate
  version: 0.1.0
servers:
  - url: https://api.goshippo.com
paths:
  /v2/estimates:
    post:
      tags:
      - Estimates
      summary: Create Estimates
      operationId: create_estimates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimatesV2Request'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimatesV2Response'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
security:
  - Shippo_Token: []
components:
  schemas:
    ConfidenceLevel:
      type: string
      enum:
      - TYPICAL
      - DEFAULT
      - HIGH
      title: ConfidenceLevel
    Destination:
      properties:
        zip:
          type: string
          title: Zip
      type: object
      required:
      - zip
      title: Destination
    DistanceUnit:
      type: string
      enum:
      - mm
      - cm
      - m
      - in
      - ft
      - yd
      title: DistanceUnit
      description: Enumeration for distance units used in parcel details.
    EstimatesV2Request:
      properties:
        origin:
          $ref: '#/components/schemas/Origin'
        destination:
          $ref: '#/components/schemas/Destination'
        parcel:
          $ref: '#/components/schemas/Parcel'
        planned_ship_date:
          type: string
          format: date-time
          title: Planned Ship Date
        latest_delivery_date:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Latest Delivery Date
        servicelevel_tokens:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Servicelevel Tokens
          default: []
        confidence_level:
          $ref: '#/components/schemas/ConfidenceLevel'
          default: DEFAULT
      type: object
      required:
      - origin
      - destination
      - parcel
      - planned_ship_date
      title: EstimatesV2Request
    EstimatesV2Response:
      properties:
        object_id:
          type: string
          format: uuid
          title: Object Id
        created_at:
          type: string
          format: date-time
          title: Created At
        origin:
          $ref: '#/components/schemas/Origin'
        destination:
          $ref: '#/components/schemas/Destination'
        parcel:
          $ref: '#/components/schemas/Parcel'
        planned_ship_date:
          type: string
          format: date-time
          title: Planned Ship Date
        latest_delivery_date:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Latest Delivery Date
        servicelevel_tokens:
          items:
            type: string
          type: array
          title: Servicelevel Tokens
        messages:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Messages
        test:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Test
        confidence_level:
          $ref: '#/components/schemas/ConfidenceLevel'
        predictions:
          items:
            $ref: '#/components/schemas/Prediction'
          type: array
          title: Predictions
      type: object
      required:
      - object_id
      - created_at
      - origin
      - destination
      - parcel
      - planned_ship_date
      - servicelevel_tokens
      - messages
      - confidence_level
      - predictions
      title: EstimatesV2Response
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MassUnit:
      type: string
      enum:
      - g
      - kg
      - lb
      - oz
      title: MassUnit
      description: Enumeration for mass units used in package weight specifications.
    Message:
      properties:
        servicelevel_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Servicelevel Token
        code:
          $ref: '#/components/schemas/MessageCode'
        text:
          type: string
          title: Text
          default: ''
      type: object
      required:
      - code
      title: Message
      description: A structured message entry, either for an individual service level
        or for the request as a whole.
    MessageCode:
      type: string
      enum:
      - prediction_unavailable
      - servicelevel_unsupported
      title: MessageCode
      description: Closed enum of machine-readable codes for response messages.
    Origin:
      properties:
        zip:
          type: string
          title: Zip
      type: object
      required:
      - zip
      title: Origin
    Parcel:
      properties:
        length:
          type: number
          exclusiveMinimum: 0.0
          title: Length
          description: Positive number. Up to 6 digits before and 4 digits after the
            decimal point.
        width:
          type: number
          exclusiveMinimum: 0.0
          title: Width
          description: Positive number. Up to 6 digits before and 4 digits after the
            decimal point.
        height:
          type: number
          exclusiveMinimum: 0.0
          title: Height
          description: Positive number. Up to 6 digits before and 4 digits after the
            decimal point.
        distance_unit:
          $ref: '#/components/schemas/DistanceUnit'
        weight:
          type: number
          exclusiveMinimum: 0.0
          title: Weight
          description: Positive number. Up to 6 digits before and 4 digits after the
            decimal point.
        mass_unit:
          $ref: '#/components/schemas/MassUnit'
      type: object
      required:
      - length
      - width
      - height
      - distance_unit
      - weight
      - mass_unit
      title: Parcel
    Prediction:
      properties:
        provider:
          type: string
          title: Provider
        servicelevel:
          $ref: '#/components/schemas/ServiceLevel'
        estimated_delivery_date_utc:
          type: string
          format: date-time
          title: Estimated Delivery Date Utc
        estimated_transit_days:
          type: number
          title: Estimated Transit Days
      type: object
      required:
      - provider
      - servicelevel
      - estimated_delivery_date_utc
      - estimated_transit_days
      title: Prediction
    ServiceLevel:
      properties:
        name:
          type: string
          title: Name
        token:
          type: string
          title: Token
      type: object
      required:
      - name
      - token
      title: ServiceLevel
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
  securitySchemes:
    Shippo_Token:
      description: |
        Enter your shippo token with the ShippoToken prefix.

        Example: `ShippoToken shippo_live_xxxx`
      in: header
      name: Authorization
      type: apiKey
      x-default: "ShippoToken shippo_test_d41a6f04796998570c521a50828eae8e3cccf0eb"
