openapi: 3.0.1
info:
  title: FirstMile Label Server REST API
  version: '1.0'
  description: >
    The FirstMile Label Server REST API provides endpoints for label creation,
    rate shopping, meter management, and manifesting shipments. This API
    replaces the legacy SOAP interface. All endpoints, request/response models,
    and business logic are documented here, with migration notes for users
    transitioning from SOAP.


    ## Authentication

    The API uses OAuth 2.0 Bearer token authentication with policy-based
    authorization:

    - Label operations require 'fm.external.rest.labelserver.label' scope

    - Rate operations require 'fm.external.rest.labelserver.rate' scope

    - Meter operations require 'fm.external.rest.labelserver.meter' scope


    The API validates claims including 'fm.api.companyId' (IFS ID) and
    'fm.api.techPartnerId'.


    ## Migration Notes

    - All SOAP methods are now available as REST endpoints

    - Request and response models are mapped to OpenAPI schemas

    - See the migration guide for detailed mapping and examples
servers:
  - url: https://labelserver-test.firstmile.com
    description: Test server
  - url: https://labelserver.firstmile.com
    description: Production server
paths:
  /api/v1/label/{trackingNumber}/{techPartnerId}:
    delete:
      tags:
        - Label
      summary: Cancel a shipment by tracking number
      description: >
        Attempts to cancel the shipment with the supplied tracking number.


        **SOAP Equivalent:** CancelDomesticLabel / CancelInternationalLabel


        **Migration Note:** The trackingNumber and techPartnerId parameters
        replace the SOAP request object's fields.
      operationId: cancelLabelByTrackingNumber
      security:
        - OAuth2:
            - fm.external.rest.labelserver.label
      parameters:
        - name: trackingNumber
          in: path
          description: The tracking number of the label to be cancelled
          required: true
          schema:
            type: string
        - name: techPartnerId
          in: path
          description: Tech partner identifier
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Shipment cancelled successfully
        '401':
          description: Unauthorized - Invalid tech partner or deactivated account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
        '404':
          description: Not Found - Shipment not found or cancellation failed
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                type: string
  /api/v1/label:
    post:
      tags:
        - Label
      summary: Generate a label image for a shipment
      description: >
        Attempts to get a label image for a shipment.


        **SOAP Equivalent:** GetLabel (DhlLabelRequest), GetInternationalLabel
        (InternationalLabelRequest)


        **Migration Note:** The request body maps to FirstMileRequest, which
        combines fields from DhlLabelRequest and InternationalLabelRequest.
      operationId: generateLabel
      security:
        - OAuth2:
            - fm.external.rest.labelserver.label
      requestBody:
        description: Label creation request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirstMileRequest'
      responses:
        '200':
          description: OK - Label generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '400':
          description: Bad Request - Validation error or invalid shipping service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '401':
          description: Unauthorized - Invalid credentials or deactivated account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
  /api/v1/label/closeday:
    post:
      tags:
        - Label
      summary: Close shipping day (manifest)
      description: >
        Attempts to perform the close shipping day process for both domestic and
        international shipments.


        **SOAP Equivalent:** CloseDomesticShippingDay,
        CloseInternationalShippingDay


        **Migration Note:** The request body maps to CloseShippingDayRequest.
      operationId: closeShippingDay
      security:
        - OAuth2:
            - fm.external.rest.labelserver.label
      requestBody:
        description: Manifest close day request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseShippingDayRequest'
      responses:
        '200':
          description: OK - Day closed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloseShippingDayResponse'
        '400':
          description: Bad Request - Errors during close process
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloseShippingDayResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloseShippingDayResponse'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                type: string
  /api/v1/meter/{id}/{techPartnerId}:
    get:
      tags:
        - Meter
      summary: Get details of the meter with the specified id
      description: >
        Attempts to get details of the meter with the specified id.


        **SOAP Equivalent:** GetMeterBalance


        **Migration Note:** The id and techPartnerId parameters replace the SOAP
        request object's fields.
      operationId: getMeterById
      security:
        - OAuth2:
            - fm.external.rest.labelserver.meter
      parameters:
        - name: id
          in: path
          description: Meter ID
          required: true
          schema:
            type: string
        - name: techPartnerId
          in: path
          description: Tech partner identifier
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Meter balance retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
  /api/v1/meter/{techPartnerId}:
    get:
      tags:
        - Meter
      summary: Get all available meters
      description: |
        Gets all available meters for the authenticated account.

        **SOAP Equivalent:** GetMeters

        **Migration Note:** The techPartnerId parameter is required.
      operationId: getAllMeters
      security:
        - OAuth2:
            - fm.external.rest.labelserver.meter
      parameters:
        - name: techPartnerId
          in: path
          description: Tech partner identifier
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Meters retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetersResponse'
  /api/v1/meter/addfunds:
    post:
      tags:
        - Meter
      summary: Add funds to a meter
      description: |
        Attempts to add funds to a meter.

        **SOAP Equivalent:** AddFundsToMeter

        **Migration Note:** The request body maps to AddFundsRequest.
      operationId: addFundsToMeter
      security:
        - OAuth2:
            - fm.external.rest.labelserver.meter
      requestBody:
        description: Add funds request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddFundsRequest'
      responses:
        '200':
          description: OK - Funds added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFundsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFundsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFundsResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFundsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddFundsResponse'
  /api/v1/rate:
    post:
      tags:
        - Rate
      summary: Get a rate for a shipment
      description: >
        Attempts to get a rate for a specific shipping service.


        **SOAP Equivalent:** GetRate (DomesticRateRequest), GetInternationalRate
        (InternationalRateRequest)


        **Migration Note:** The request body maps to FirstMileRequest.
      operationId: getRate
      security:
        - OAuth2:
            - fm.external.rest.labelserver.rate
      requestBody:
        description: Rate request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirstMileRequest'
      responses:
        '200':
          description: OK - Rate calculated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateResponse'
        '400':
          description: Bad Request - Invalid shipping service or validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateResponse'
        '401':
          description: Unauthorized - Invalid credentials or tech partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateResponse'
  /api/v1/rate/shop:
    post:
      tags:
        - Rate
      summary: Rate shop available ship methods
      description: >
        Attempts to rate shop available ship methods across all carriers.


        **SOAP Equivalent:** GetRates (DomesticRatesRequest),
        GetInternationalRates (InternationalRatesRequest)


        **Migration Note:** The request body maps to FirstMileRequest.
      operationId: rateShop
      security:
        - OAuth2:
            - fm.external.rest.labelserver.rate
      requestBody:
        description: Rate shop request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirstMileRequest'
      responses:
        '200':
          description: OK - Rates retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesResponse'
        '401':
          description: Unauthorized - Deactivated account or invalid tech partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesResponse'
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://fm-identityserver-test.azurewebsites.net/connect/token
          scopes:
            fm.external.rest.labelserver.label: Access to label operations
            fm.external.rest.labelserver.rate: Access to rate operations
            fm.external.rest.labelserver.meter: Access to meter operations
            fm.external.rest.labelserver.track: Access to tracking operations
  schemas:
    BaseResponse:
      type: object
      description: Base response that all API responses inherit from
      properties:
        requestId:
          type: string
          description: The Id passed in the request, echoed back
          nullable: true
        errors:
          type: array
          items:
            type: string
          description: A list of errors, if any
          nullable: true
    FirstMileRequest:
      type: object
      description: |
        Unified request for label and rate operations.
        Combines fields from DhlLabelRequest and InternationalLabelRequest.
        See migration guide for field mapping.
      required:
        - techPartnerId
      properties:
        techPartnerId:
          type: string
          description: Tech partner identifier (required)
        fromAddress:
          $ref: '#/components/schemas/Address'
          description: 'The return address for the label. (SOAP: FromAddress)'
        toAddress:
          $ref: '#/components/schemas/Address'
          description: 'The address that the label will be shipped to. (SOAP: ShipToAddress)'
        shippingServiceEnum:
          $ref: '#/components/schemas/ShippingService'
          description: >-
            The type of label to request. See ShippingService enum. (SOAP:
            LabelType)
        shippingService:
          type: string
          description: 'Deprecated: Use shippingServiceEnum instead'
          nullable: true
        packages:
          type: array
          items:
            $ref: '#/components/schemas/Package'
          description: >-
            Package(s) information. Multi-package shipments are only supported
            for FedEx, UPS, and DHL Express shipments. (SOAP: PackageDetail)
        requestId:
          type: string
          description: >-
            Id for the request. This will be echoed in the response. (SOAP:
            RequestId)
          nullable: true
        customsData:
          $ref: '#/components/schemas/CustomsData'
          nullable: true
          description: 'Customs information for international shipments. (SOAP: CustomsData)'
        internationalDutyTermsEnum:
          $ref: '#/components/schemas/InternationalDutiesTerms'
          nullable: true
          description: >-
            Customs duties terms. Unknown, DDU for Deliver Duties Unpaid, and
            DDP for Deliver Duties Paid. (SOAP: Incoterms)
        internationalDutyTerms:
          type: string
          description: 'Deprecated: Use internationalDutyTermsEnum instead'
          nullable: true
        ancillaryEndorsementEnum:
          $ref: '#/components/schemas/Endorsement'
          nullable: true
          description: 'USPS Ancillary endorsement. (SOAP: AncillaryEndorsement)'
        ancillaryEndorsement:
          type: string
          description: 'Deprecated: Use ancillaryEndorsementEnum instead'
          nullable: true
        secondaryEndorsementEnum:
          $ref: '#/components/schemas/Endorsement'
          nullable: true
          description: 'Secondary USPS Ancillary endorsement. (SOAP: SecondaryEndorsement)'
        secondaryEndorsement:
          type: string
          description: 'Deprecated: Use secondaryEndorsementEnum instead'
          nullable: true
        docTabValues:
          type: array
          items:
            type: string
          description: >-
            These values are added to the label image when possible. (SOAP:
            DocTabValues)
          nullable: true
        futureShipmentDate:
          type: string
          format: date-time
          description: >-
            Scheduled shipment date (if not immediate). (SOAP:
            FutureShipmentDate)
          nullable: true
        labelImageFormatEnum:
          $ref: '#/components/schemas/ImageFormat'
          nullable: true
          description: >-
            The image format for the label. Defaults to Png. (SOAP:
            LabelImageFormat)
        labelImageFormat:
          type: string
          description: 'Deprecated: Use labelImageFormatEnum instead'
          nullable: true
        labelImageSizeEnum:
          $ref: '#/components/schemas/LabelStockSize'
          nullable: true
          description: 'The size of the label stock. (SOAP: LabelSize)'
        shipmentWeightOz:
          type: number
          format: decimal
          description: 'Total weight of the shipment in ounces. (SOAP: WeightOz)'
        reference1:
          type: string
          description: 'Optional billing reference 1. (SOAP: Reference1)'
          nullable: true
        reference2:
          type: string
          description: 'Optional billing reference 2. (SOAP: Reference2)'
          nullable: true
        orderNumber:
          type: string
          description: 'Optional user defined barcode on the label. (SOAP: OrderNumber)'
          nullable: true
      additionalProperties: false
    Address:
      type: object
      description: 'Address information for sender or recipient. (SOAP: Address)'
      properties:
        companyName:
          type: string
          description: Company Name, will print above Name on the label. Optional.
          nullable: true
        name:
          type: string
          description: Name field.
          nullable: true
        address1:
          type: string
          description: Street address 1.
          nullable: true
        address2:
          type: string
          description: Street address 2.
          nullable: true
        address3:
          type: string
          description: Street address 3.
          nullable: true
        city:
          type: string
          description: City
          nullable: true
        state:
          type: string
          description: State or province.
          nullable: true
        postalCode:
          type: string
          description: Postal code.
          nullable: true
        country:
          type: string
          description: Country. Use ISO 2 or ISO 3 character country codes.
          nullable: true
        email:
          type: string
          description: Email address.
          nullable: true
        phoneNumber:
          type: string
          description: Phone number.
          nullable: true
        residential:
          type: boolean
          description: Residential flag.
          default: false
      additionalProperties: false
    Package:
      type: object
      description: 'Package information for the shipment. (SOAP: PackageInfo)'
      properties:
        weight:
          $ref: '#/components/schemas/Weight'
        packageDimensions:
          $ref: '#/components/schemas/Dimensions'
          nullable: true
        specialServices:
          $ref: '#/components/schemas/SpecialServices'
          nullable: true
        packageDescription:
          type: string
          description: 'Description of package contents. Ex.: Merchandise'
          nullable: true
        packageValue:
          type: number
          format: decimal
          nullable: true
      additionalProperties: false
    Weight:
      type: object
      description: 'Weight information for a package. (SOAP: BilledWeight)'
      properties:
        weightOz:
          type: number
          format: decimal
          description: The weight in Ounces.
        weightType:
          $ref: '#/components/schemas/WeightType'
          description: See WeightType enum (Actual, Dimensional, Balloon, Cubic)
      additionalProperties: false
    Dimensions:
      type: object
      description: 'Dimensions of a package. (SOAP: PackageDimensions)'
      properties:
        lengthInch:
          type: number
          format: decimal
        widthInch:
          type: number
          format: decimal
        heightInch:
          type: number
          format: decimal
      additionalProperties: false
    SpecialServices:
      type: object
      description: 'Special services requested for a package. (SOAP: SpecialServicesData)'
      properties:
        dangerousGoodsOptions:
          $ref: '#/components/schemas/DangerousGoodsInfo'
          nullable: true
        signatureType:
          $ref: '#/components/schemas/SignatureType'
          nullable: true
      additionalProperties: false
    DangerousGoodsInfo:
      type: object
      description: 'Dangerous goods information for a package. (SOAP: DangerousGoodsInfo)'
      properties:
        dangerousGoodsType:
          $ref: '#/components/schemas/DangerousGoodsType'
          nullable: true
        emergencyContactNumber:
          type: string
          nullable: true
      additionalProperties: false
    CustomsData:
      type: object
      description: 'Customs information for international shipments. (SOAP: CustomsData)'
      properties:
        shipmentValue:
          type: number
          format: decimal
        shipmentDescription:
          type: string
          nullable: true
        customsItems:
          type: array
          items:
            $ref: '#/components/schemas/CustomsItem'
          nullable: true
      additionalProperties: false
    CustomsItem:
      type: object
      description: >-
        Customs item information for international shipments. (SOAP:
        CustomsItem)
      properties:
        countryOfOrigin:
          type: string
          description: >-
            The ISO 3166 alpha-2 country code for the origin country of the
            manufacturer of the product.
          nullable: true
        description:
          type: string
          description: >-
            General description of package contents. Ex. clothing, health
            supply, CDs, etc.
          nullable: true
        itemValue:
          type: number
          format: decimal
          description: The value of a single item in USD
        itemQuantity:
          type: integer
          format: int32
          description: The number of items of this type in the shipment.
        itemSKU:
          type: string
          nullable: true
        hsCode:
          type: string
          description: Harmonized System Code (HTS)
          nullable: true
        itemWeight:
          $ref: '#/components/schemas/Weight'
          nullable: true
        itemDescriptionInExportCountryLanguage:
          type: string
          description: >-
            The Item description in the export country language (ex simplified
            chinese characters for China)
          nullable: true
      additionalProperties: false
    LabelResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: >-
            Label creation response. (SOAP: DhlLabelResponse,
            InternationalLabelResponse)
          properties:
            warnings:
              type: array
              items:
                type: string
              description: >-
                Warning information. These are for information purposes only,
                they are not errors.
              nullable: true
            packages:
              type: array
              items:
                $ref: '#/components/schemas/PackageInfo'
              description: >-
                Package info including tracking numbers, label images, and
                package rates.
              nullable: true
            trackingNumber:
              type: string
              description: >-
                The shipment master tracking number. This will match the
                PackageInfo tracking number for single package shipments.
              nullable: true
            secondaryTrackingNumber:
              type: string
              description: Secondary tracking number. Not populated for all shipments.
              nullable: true
            shipmentRate:
              $ref: '#/components/schemas/PackageRate'
              nullable: true
            trackingUrl:
              type: string
              description: Carrier specific tracking URL.
              nullable: true
            includedReturnsLabelImage:
              $ref: '#/components/schemas/ImageData'
              nullable: true
            extraDocumentPDFs:
              type: array
              items:
                $ref: '#/components/schemas/ImageData'
              nullable: true
            shippingService:
              $ref: '#/components/schemas/ShippingService'
              nullable: true
              default: Unknown
          additionalProperties: false
    PackageInfo:
      type: object
      description: >-
        Package info including label image, rate, and tracking number. (SOAP:
        PackageResponseData)
      properties:
        imageData:
          $ref: '#/components/schemas/ImageData'
          nullable: true
        rate:
          $ref: '#/components/schemas/PackageRate'
          nullable: true
        trackingNumber:
          type: string
          nullable: true
      additionalProperties: false
    ImageData:
      type: object
      description: 'Label image and related data. (SOAP: DocImage)'
      properties:
        base64LabelImage:
          type: string
          description: >-
            The label images as Base64 strings. Format is specified by the
            ImageFormat property.
          nullable: true
        imageFormat:
          type: string
          description: The image format for Base64LabelImages property.
          nullable: true
        returnsImageURL:
          type: string
          description: >-
            A URL where the returns label image is available for download (if
            requested).
          nullable: true
      additionalProperties: false
    PackageRate:
      type: object
      description: 'Package rate information. (SOAP: PackageRate)'
      properties:
        cost:
          type: number
          format: decimal
          description: The full cost of the package.
        freightCost:
          type: number
          format: decimal
          description: The freight cost of the package.
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: List of fees, if any.
          nullable: true
        packageWeight:
          $ref: '#/components/schemas/Weight'
          nullable: true
        daysInTransit:
          type: integer
          description: The estimated days in transit
          nullable: true
        estimatedZone:
          type: string
          description: The estimated zone of the shipment
          nullable: true
      additionalProperties: false
    Fee:
      type: object
      description: 'Fee information for a package or transaction. (SOAP: Fee)'
      properties:
        feeName:
          type: string
          description: The name of the fee.
          nullable: true
        amount:
          type: number
          format: decimal
          description: The amount of the fee.
      additionalProperties: false
    CloseShippingDayRequest:
      type: object
      description: >-
        Manifest close day request. (SOAP: CloseDomesticShippingDayRequest,
        DhlCloseInternationalShippingDayRequest)
      required:
        - techPartnerId
      properties:
        techPartnerId:
          type: string
          description: Tech partner identifier (required)
        trackingNumbers:
          type: array
          items:
            type: string
          description: Tracking numbers to include in close
          nullable: true
        scanFormAddress:
          $ref: '#/components/schemas/Address'
          description: Address for SCAN form generation
          nullable: true
      additionalProperties: false
    CloseShippingDayResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: >-
            Manifest close day response. (SOAP:
            CloseDomesticShippingDayResponse,
            DhlCloseInternationalShippingDayResponse)
          properties:
            warnings:
              type: array
              items:
                type: string
              description: >-
                Warning information. These are for information purposes only,
                they are not errors.
              nullable: true
            successful:
              type: boolean
              description: Indicates if close was successful
            billOfLadingPdfs:
              type: array
              items:
                type: string
              description: Base64-encoded PDF documents
              default: []
          additionalProperties: false
    AddFundsRequest:
      type: object
      description: 'Add funds request for a meter. (SOAP: AddFundsRequest)'
      required:
        - techPartnerId
      properties:
        techPartnerId:
          type: string
          description: Tech partner identifier (required)
        meterId:
          type: string
          description: Target meter ID
          nullable: true
        amount:
          type: number
          format: double
          description: Amount to add
        transactionReference:
          type: string
          description: Transaction reference for tracking
          nullable: true
      additionalProperties: false
    AddFundsResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: 'Add funds response for a meter. (SOAP: AddFundsResponse)'
          properties:
            meter:
              $ref: '#/components/schemas/MeterInfo'
              nullable: true
            transactionId:
              type: string
              description: Transaction identifier
              nullable: true
            fees:
              type: array
              items:
                $ref: '#/components/schemas/Fee'
              nullable: true
            successful:
              type: boolean
              description: Indicates if funds were added successfully
          additionalProperties: false
    MeterInfo:
      type: object
      description: 'Meter information. (SOAP: MeterInfo)'
      properties:
        currentBalance:
          type: number
          format: decimal
        oldBalance:
          type: number
          format: decimal
          nullable: true
        pendingFunds:
          type: number
          format: decimal
        carrier:
          type: string
          nullable: true
        meterId:
          type: string
          nullable: true
      additionalProperties: false
    MetersResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: >-
            Meter(s) response. (SOAP: GetMetersResponse,
            GetMeterBalanceResponse)
          properties:
            warnings:
              type: array
              items:
                type: string
              description: >-
                Warning information. These are for information purposes only,
                they are not errors.
              nullable: true
            meters:
              type: array
              items:
                $ref: '#/components/schemas/MeterInfo'
              description: List of available meters
              default: []
          additionalProperties: false
    RateResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: >-
            Rate response for a shipment. (SOAP: DomesticRateResponse,
            InternationalRateResponse)
          properties:
            warnings:
              type: array
              items:
                type: string
              description: >-
                Warning information. These are for information purposes only,
                they are not errors.
              nullable: true
            estimatedZone:
              type: string
              description: The estimated zone of the shipment.
              nullable: true
            weight:
              $ref: '#/components/schemas/Weight'
              nullable: true
            packageRates:
              type: array
              items:
                $ref: '#/components/schemas/PackageRate'
              description: Package-specific rate information
              nullable: true
            shippingService:
              $ref: '#/components/schemas/ShippingService'
              nullable: true
              default: Unknown
            daysInTransit:
              type: integer
              description: Estimated days in transit
              nullable: true
          additionalProperties: false
    RatesResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          description: >-
            Rate shop response for a shipment. (SOAP: DomesticRatesResponse,
            InternationalRatesResponse)
          properties:
            warnings:
              type: array
              items:
                type: string
              description: >-
                Warning information. These are for information purposes only,
                they are not errors.
              nullable: true
            rates:
              type: array
              items:
                $ref: '#/components/schemas/RateResponse'
              description: Available shipping rates
              default: []
          additionalProperties: false
    ShippingService:
      type: string
      enum:
        - Unknown
        - AMZN_Ground_Parcel_Delivery
        - Asendia_International_Fully_Tracked
        - Asendia_International_Country_Tracked
        - Asendia_International_PMI
        - Asendia_International_PMEI
        - Asendia_International_EPAQ_Select
        - Asendia_International_EPAQ_Elite
        - Asendia_International_EPAQ_Standard
        - Asendia_International_EPAQ_Elite_DPD
        - Asendia_International_EPAQ_Plus_Epacket_Canada_DDP
        - Asendia_International_EPAQ_Select_Direct_Access_Canada_DDP
        - Asendia_International_EPAQ_Elite_Direct_Access_Canada_DDP
        - Asendia_International_EPAQ_Select_DDP
        - Asendia_International_EPAQ_Elite_DDP
        - DhlGM_International_Parcel_Priority
        - DhlGM_International_Packet_Plus
        - DhlGM_International_Parcel_Direct
        - DhlGM_International_Parcel_Direct_Express
        - DhlGM_International_Packet_Priority
        - DhlGM_International_Packet_IPA
        - DhlGM_International_Parcel_Direct_Inbound_Max
        - DhlGM_International_Parcel_Direct_Inbound_Priority
        - DhlGM_International_Parcel_Direct_Inbound_Priority_Formal
        - DhlGM_International_Parcel_Direct_Inbound_Standard
        - DhlGM_International_Parcel_Direct_Inbound_Standard_Formal
        - FirstMile_XParcel
        - DhlExpress_International_Worldwide
        - DhlExpress_International_Worldwide_Document
        - DhlExpress_International_Noon_Document
        - DhlExpress_International_Noon
        - USPS_International_First_Class_Package
        - USPS_International_Priority_Mail_Package
        - USPS_International_Priority_Mail_Flat_Rate_Envelope
        - USPS_International_Priority_Mail_Small_Flat_Rate_Box
        - USPS_International_Priority_Mail_Medium_Flat_Rate_Box
        - USPS_International_Priority_Mail_Large_Flat_Rate_Box
        - USPS_International_Priority_Mail_Express_Package
        - USPS_International_Priority_Mail_Express_Flat_Rate_Envelope
        - XParcel_Intl_Ecomony
        - XParcel_Intl_Standard
        - XParcel_Intl_Standard_Plus
        - XParcel_Intl_Premium
        - XParcel_Intl_Premium_Plus
        - XParcel_Intl_1
        - XParcel_Intl_2
        - PRLTR_International_Courier_Express
        - PRLTR_International_Courier_Ground
        - PRLTR_International_Parcel_PuroPost
        - PRLTR_International_Parcel_PuroPost_Plus
        - DhlSm_Bpm_Expedited
        - DhlSm_Media_Mail_Ground
        - DhlSm_Bpm_Ground
        - DhlSm_Parcels_Expedited
        - DhlSm_Parcels_Ground
        - FedEx_1R_2Day_Envelope
        - FedEx_1R_2Day_Pak
        - FedEx_1R_2Day_Small_Box
        - FedEx_1R_2Day_Medium_Box
        - FedEx_1R_2Day_Large_Box
        - FedEx_1R_2Day_Extra_Large_Box
        - FedEx_2_Day
        - FedEx_2_Day_Letter
        - FedEx_Express_Saver
        - FedEx_Express_Saver_Letter
        - FedEx_Priority_Overnight
        - FedEx_Priority_Overnight_Letter
        - FedEx_Standard_Overnight
        - FedEx_Standard_Overnight_Letter
        - FedEx_Ground
        - FedEx_Ground_Home_Delivery
        - FedEx_Parcel_Select
        - FedEx_International_2_Day
        - FedEx_International_2_Day_Letter
        - FedEx_International_Economy
        - FedEx_International_Economy_Letter
        - FedEx_International_First
        - FedEx_International_First_Letter
        - FedEx_International_Ground
        - FedEx_International_Priority
        - FedEx_International_Priority_Letter
        - FedEx_Smart_Post_Returns
        - XParcel_Ground
        - XParcel_Expedited
        - FirstMile_Same_Day
        - USPS_Priority_Mail_Package
        - USPS_Priority_Mail_Flat_Rate_Envelope
        - USPS_Priority_Mail_Legal_Flat_Rate_Envelope
        - USPS_Priority_Mail_Padded_Flat_Rate_Envelope
        - USPS_Priority_Mail_Small_Flat_Rate_Box
        - USPS_Priority_Mail_Medium_Flat_Rate_Box
        - USPS_Priority_Mail_Large_Flat_Rate_Box
        - USPS_Priority_Mail_APO_FPO_DPO_Large_Flat_Rate_Box
        - USPS_Priority_Mail_Cubic_Package
        - USPS_Priority_Mail_Express_Package
        - USPS_Priority_Mail_Express_Flat_Rate_Envelope
        - USPS_Priority_Mail_Express_Legal_Flat_Rate_Envelope
        - USPS_Priority_Mail_Express_Padded_Flat_Rate_Envelope
        - UPS_Next_Day_Air
        - UPS_2Day_Air
        - UPS_2Day_Air_AM
        - UPS_Ground
        - UPS_3Day_Select
        - UPS_Next_Day_Air_Saver
        - UPS_Next_Day_Air_Early_AM
        - UPS_International_Saver
        - UPS_International_Express
        - UPS_International_Expedited
        - UPS_International_Standard
        - UPS_International_Express_Plus
        - DhlSm_Expedited_Max
        - UPS_Surepost
        - FirstMile_Parcel_Select
        - XParcel_Returns
        - XParcel_Max
        - FirstMile_Ground
        - FirstMile_Expedited
        - FirstMile_Priority
        - FirstMile_NextDay
        - XParcel_Priority
        - XParcel_Expedited_Plus
        - PitneyBowes_BPM
        - PitneyBowes_Marketing_Mail_Flats
        - PitneyBowes_First_Class_Flats
        - OnTrac_Ground_Regional_Parcel_Delivery
        - LSO_Ground_Regional_Parcel_Delivery
        - LSO_ECommerce_Regional_Parcel_Delivery
        - LZR_Ground_Regional_Parcel_Delivery
        - UDS_ND_Regional_Parcel_Delivery
        - TFC_NextDay_Regional_Parcel_Delivery
        - ACI_Parcel_Select
        - USPS_Ground_Advantage
        - USPS_Ground_Advantage_Cubic
        - USPS_GA_Returns
        - FirstMile_Media_Mail
        - FirstMile_BPM
        - ACI_Direct_Regional_Parcel_Delivery
        - UNI_Ground_Regional_Parcel_Delivery
        - Veho_Value_Regional_Parcel_Delivery
        - Veho_PremEcon_Regional_Parcel_Delivery
        - XPO_Priority_Parcel_Delivery_Confirmation
        - XPO_IPA_Service
        - XPO_Courier_Service
        - XPO_Economy_Parcel
        - XPO_Priority_Parcel_Non_Delivery_Confirmation
        - XPO_Priority_Parcel_Courier
        - XPO_Priority_Mail_International
        - XPO_EPacket
        - XPO_Packet_Tracked
      description: Available shipping services
    WeightType:
      type: string
      enum:
        - Actual
        - Dimensional
        - Balloon
        - Cubic
      description: Type of weight measurement
    DangerousGoodsType:
      type: string
      enum:
        - None
        - Lithium_Metal_In_Equipment
        - Lithium_Metal_Packed_With_Equipment
        - Lithium_Metal_Stand_Alone
        - Lithium_Ion_In_Equipment
        - Lithium_Ion_Packed_With_Equipment
        - Lithium_Ion_Stand_Alone
        - Lithium_Ground_Only
        - ORMD
        - Small_Quantity_Provision
        - Hazardous_Materials
      description: Type of dangerous goods
    SignatureType:
      type: string
      enum:
        - None
        - Adult
        - Direct
        - Indirect
      description: Type of signature required for delivery
    Endorsement:
      type: string
      enum:
        - None
        - Address_Service_Requested
        - Change_Service_Requested
        - Forwarding_Service_Requested
        - Return_Service_Requested
      description: USPS ancillary service endorsement
    ImageFormat:
      type: string
      enum:
        - Unknown
        - Png
        - Jpeg
        - Gif
        - Pdf
        - ZPL
        - EPL
      description: Label image format
    LabelStockSize:
      type: string
      enum:
        - Label4X6
        - Label4X8
      description: Thermal label stock size
    InternationalDutiesTerms:
      type: string
      enum:
        - Unknown
        - DDU
        - DDP
      description: International customs duties terms
