---
swagger: "2.0"
info:
  description: Shipwire's Carrier API
  version: "3.0"
  title: Shipwire Carrier API
host: api.shipwire.com
basePath: /
schemes:
- https
consumes:
- application/json
produces:
- application/json
security:
- basicAuth: []
paths:
  /api/v3.1/carriers:
    get:
      tags:
      - Carrier
      summary: Get carriers availability
      description: Get carriers information
      operationId: ApiV31CarriersGet
      produces:
      - application/json
      parameters:
      - name: name
        in: query
        description: Add description
        required: false
        type: string
      - name: carrierCode
        in: query
        description: Add description
        required: false
        type: string
      - name: serviceLevelCode
        in: query
        description: Add description
        required: false
        type: string
      - name: isPoBoxSupported
        in: query
        description: Add description
        required: false
        type: string
      responses:
        200:
          description: ""
          schema:
            $ref: '#/definitions/GetCarriersResponse'
  /api/v3.1/carriers/{id}:
    get:
      tags:
      - Carrier
      summary: Get carrier availability
      description: Get carrier information
      operationId: ApiV31CarrierGet
      produces:
      - application/json
      parameters:
      - name: id
        in: path
        description: The prefix concatenated with '-' and service level code of the carrier.
        required: true
        type: string
      responses:
        200:
          description: ""
          schema:
            $ref: '#/definitions/GetCarrierResponse'
securityDefinitions:
  basicAuth:
    type: basic
definitions:
  CarrierServerResponse:
    type: object
    properties:
      status:
        type: integer
        example: 200
        description: This is the HTTP status code.
      message:
        type: string
        example: Successful
        description: This is the HTTP status message.
      resourceLocation:
        type: string
        example: https://api.shipwire.com/api/v3.1/carriers?offset=0&limit=20&expand=all
        description: A URL that gives more information about the linked resource. A 'null' value would mean that no further information is available for that resource. Use this resource to get detailed information about the carrier.
    title: Receiving Server Response
    description: Receiving Server Response
  GetCarriersResponse:
    allOf:
    - $ref: '#/definitions/CarrierServerResponse'
    - title: Get Carriers Response
    - description: Get Carriers Response
    - type: object
  GetCarrierResponse:
    allOf:
    - $ref: '#/definitions/CarrierServerResponse'
    - title: Get Carriers Response
    - description: Get Carriers Response
    - type: object
  CarriersPaginationModel:
    type: object
    properties:
      offset:
        type: integer
        example: 0
        description: This is an integer that matches the offset given in the request and dictates the number of items to skip while fetching results. For example, there is a preset limit of 20 results per page. If there are 30 total results and offset is set to 20, then the response will show the second "page" of results, with items 21 to 30.
      total:
        type: integer
        example: 164
        description: Total number of available items in the API response.
      previous:
        type: string
        example: null
        description: A link used to fetch the previous set or page of items in the API response.
      next:
        type: string
        example: https://api.shipwire.com/api/v3.1/carriers?offset=20&limit=20
        description: A link used to fetch the next set or page of items in the API response.
      items:
        type: array
        items:
          $ref: '#/definitions/CarrierResourceModel'
    title: CarriersPaginationModel
  CarrierResourceModel:
    type: object
    properties:
      resourceLocation:
        type: string
        example: https://api.shipwire.com/api/v3.1/carriers/ASND-EPSZ
        description: A URL that gives more information about the linked resource. A null value would mean that no further information is available for that resource. Use this resource to get detailed information about the carrier.
      resource:
        $ref: '#/definitions/CarrierModel'
    title: CarrierResourceModel
  CarrierModel:
    type: object
    properties:
      code:
        type: string
        example: FDX GD
        description: A string consisting of carrier code and service level.
      serviceLevelCode:
        type: string
        example: EPSZ
        description: This is the service level code associated with the carrier. There are multiple levels for one type of service. Each level has a specific code. (e.g. For FDX the codes are 1D, 2D, GD, etc.)
      name:
        type: string
        example: Asendia ePacket Tracked
        description: This is the name of the associated carrier.
      isFreightCarrier:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier is a freight carrier. The value 1 (True) means this carrier supports heavy weight orders or large items.
      isRestrictedCarrier:
        type: integer
        format: enum
        example: 0
        description: A boolean that indicates whether or not the carrier is restricted. The value 1 (True) means this carrier is not available for general use. If required, contact customer care for possible enablement.
      isPostalCarrier:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier uses a national government postal service, either for aggregated or for last mile delivery.
      isTerritorySupported:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates if the carrier supports US territories. (e.g. Puerto Rico, Guam, etc.)
      isPoBoxSupported:
        type: integer
        format: enum
        example: 0
        description: A boolean that indicates if the carrier supports PO box delivery.
      isApoFpoSupported:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier supports delivery to military addresses (APO, FPO).
      isPickupRequired:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier requires pickup. A 0 (False) value would mean that the carrier supports delivery to doorstep. This feature is related to third party carriers.
      isSignatureRequired:
        type: integer
        format: enum
        example: 0
        description: A boolean that indicates the carrier requires a signature upon delivery of the order.
      isSelfInsured:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier is self-insured for damages that occur to an order while in transit.
      isDangerousGoodsSupported:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier can transport orders that include dangerous goods. (e.g. chemicals, etc.)
      isTrackable:
        type: integer
        format: enum
        example: 0
        description: A boolean that indicates orders transported by the carrier will recieive a tracking ID so that it can be tracked after leaving the warehouse through to delivery.
      isMediaSupported:
        type: integer
        format: enum
        example: 1
        description: A boolean that indicates the carrier provides special services specific to the handling of media. (e.g. books, videotapes, DVDs, CDs, printed music and other sound recordings)
      minimumShippingDays:
        type: integer
        example: 7
        description: The minimum number of days the carrier takes for shipping the order.
      maximumShippingDays:
        type: integer
        example: 14
        description: The maximum number of days the carrier takes for shipping the order.
    title: CarrierModel
