{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "title": "DeliveryTracking API",
    "version": "1.0"
  },
  "basePath": "/v1/delivery_tracking",
  "paths": {
    "/generate_tracking_page_link": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "DeliveryTracking_GenerateTrackingPageLink",
        "parameters": [
          {
            "description": "NOTE: You must specify one of the 'tracking_number' or 'order_id'.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/GenerateTrackingPageLinkRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GenerateTrackingPageLinkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/order": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "DeliveryTracking_CreateTrackingOrder",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateTrackingOrderRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateTrackingOrderResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/orders": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "DeliveryTracking_GetTrackingOrders",
        "parameters": [
          {
            "type": "string",
            "name": "site_id",
            "in": "query"
          },
          {
            "type": "string",
            "name": "email",
            "in": "query"
          },
          {
            "type": "string",
            "name": "locale",
            "in": "query"
          },
          {
            "type": "string",
            "name": "external_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetTrackingOrdersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/parcel": {
      "post": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "DeliveryTracking_CreateParcel",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateParcelRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateParcelResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/parcels": {
      "get": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "operationId": "DeliveryTracking_GetTrackingParcels",
        "parameters": [
          {
            "type": "string",
            "description": "ID of the merchant site in the Ingrid system.",
            "name": "site_id",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Either tracking_number or external_id must be provided. If both are provided, an error will be returned.",
            "name": "external_id",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Either tracking_number or external_id must be provided. If both are provided, an error will be returned.",
            "name": "tracking_number",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Token is used to get tracking information for the order. If token is provided, external_id and tracking_number are ignored.",
            "name": "token",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetTrackingParcelsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Address": {
      "description": "Common address entity that used almost everywhere in Ingrid's API.",
      "type": "object",
      "properties": {
        "address_lines": {
          "type": "array",
          "title": "List of address lines part of address such as street and building number",
          "items": {
            "type": "string"
          }
        },
        "apartment_number": {
          "description": "Number of the apartment.",
          "type": "string"
        },
        "attn": {
          "type": "string",
          "title": "Attention field. Can be used to indicate an employee if the address is a\ncompany address [optional]"
        },
        "building_name": {
          "type": "string",
          "title": "in the UK some buildings do not have a number, only a name"
        },
        "care_of": {
          "type": "string",
          "title": "Care of part of address usually written as `c/o` [optional]"
        },
        "city": {
          "type": "string",
          "title": "Name of the city"
        },
        "coordinates": {
          "description": "Geolocation coordinates of the address. If reverse geolocation lookup of the\naddress was successful this property will be populated. If coordinates are\navailable they will be used to in service point search. In case of\n`search_address` coordinates can also be set by merchant if known.",
          "$ref": "#/definitions/Coordinates"
        },
        "country": {
          "description": "Country should be specified as two uppercase letters (ISO Alpha-2).\nExample `SE` for Sweden, `ES` for Spain.",
          "type": "string"
        },
        "door_code": {
          "type": "string",
          "title": "The door code to the main entrance of the building if applicable [optional]"
        },
        "floor_number": {
          "type": "string",
          "title": "Floor number [optional]"
        },
        "name": {
          "type": "string",
          "title": "Customer or company name"
        },
        "po_box_id": {
          "type": "string",
          "title": "ID of the PO Box [optional]"
        },
        "postal_code": {
          "type": "string",
          "title": "Postal code (or zipcode in US)"
        },
        "region": {
          "type": "string",
          "title": "Region can be a state or a province [optional]"
        },
        "street": {
          "description": "Name of the street.",
          "type": "string"
        },
        "street_number": {
          "description": "Number of the street.",
          "type": "string"
        },
        "subregion": {
          "type": "string",
          "title": "Further division of regions. Example countries are GB, IE, IT, LT, MX\nFor example for The Republic Of Ireland there are 4 provinces (regions),\ne.g. `Connacht` and 26 counties (subregions), e.g. `Galway`\nFormat is ISO 3166 where applicable, exceptions are e.g. Mexico [optional]"
        }
      }
    },
    "Alert": {
      "type": "object",
      "properties": {
        "awaiting_supplier": {
          "$ref": "#/definitions/AlertAwaitingSupplierPayload"
        },
        "created_at": {
          "type": "string",
          "title": "created_at - timestamp in RFC3339 format"
        },
        "delivery_attempt_failed": {
          "$ref": "#/definitions/AlertDeliveryAttemptFailedPayload"
        },
        "delivery_delayed": {
          "$ref": "#/definitions/AlertDeliveryDelayedPayload"
        },
        "delivery_delayed_from_carrier": {
          "$ref": "#/definitions/AlertDeliveryDelayedFromCarrierPayload"
        },
        "estimated_delivery_time_updated": {
          "$ref": "#/definitions/AlertEstimatedDeliveryTimeUpdatedPayload"
        },
        "linehaul": {
          "$ref": "#/definitions/AlertLinehaulPayload"
        },
        "out_for_delivery": {
          "$ref": "#/definitions/AlertOutForDeliveryPayload"
        },
        "submission_delayed": {
          "$ref": "#/definitions/AlertSubmissionDelayedPayload"
        },
        "type": {
          "$ref": "#/definitions/AlertType"
        }
      }
    },
    "AlertAwaitingSupplierPayload": {
      "type": "object",
      "properties": {
        "estimated_time": {
          "$ref": "#/definitions/EstimatedTime"
        },
        "estimated_time_range": {
          "$ref": "#/definitions/DateTimeRange"
        }
      }
    },
    "AlertDeliveryAttemptFailedPayload": {
      "type": "object"
    },
    "AlertDeliveryDelayedFromCarrierPayload": {
      "type": "object"
    },
    "AlertDeliveryDelayedPayload": {
      "type": "object"
    },
    "AlertEstimatedDeliveryTimeUpdatedPayload": {
      "type": "object"
    },
    "AlertLinehaulPayload": {
      "type": "object",
      "properties": {
        "estimated_time": {
          "$ref": "#/definitions/EstimatedTime"
        },
        "estimated_time_range": {
          "$ref": "#/definitions/DateTimeRange"
        }
      }
    },
    "AlertOutForDeliveryPayload": {
      "type": "object"
    },
    "AlertSubmissionDelayedPayload": {
      "type": "object"
    },
    "AlertType": {
      "type": "string",
      "default": "ALERT_UNDEFINED",
      "enum": [
        "ALERT_UNDEFINED",
        "ALERT_DELIVERY_DELAYED",
        "ALERT_ESTIMATED_DELIVERY_TIME_UPDATED",
        "ALERT_DELIVERY_ATTEMPT_FAILED",
        "ALERT_OUT_FOR_DELIVERY",
        "ALERT_SUBMISSION_DELAYED",
        "ALERT_DELIVERY_DELAYED_FROM_CARRIER",
        "ALERT_AWAITING_SUPPLIER",
        "ALERT_LINEHAUL_TO_CARRIER"
      ]
    },
    "Any": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "Coordinates": {
      "type": "object",
      "title": "Geolocation coordinates",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double",
          "title": "Latitude"
        },
        "lng": {
          "type": "number",
          "format": "double",
          "title": "Longitude"
        }
      }
    },
    "CreateParcelRequest": {
      "type": "object",
      "required": [
        "site_id",
        "tos_id",
        "tracking_number",
        "carrier_product_ref",
        "direction_type"
      ],
      "properties": {
        "attributes": {
          "type": "object"
        },
        "carrier_product_ref": {
          "type": "string"
        },
        "delivery_type": {
          "description": "DeliveryType is an intended delivery type for the parcel. If not provided will be taken from order.",
          "$ref": "#/definitions/DeliveryType"
        },
        "direction_type": {
          "description": "DirectionType is an intended direction for parcel. Useful when registering not only outbound packages.",
          "$ref": "#/definitions/DirectionType"
        },
        "line_items": {
          "description": "LineItems define line items on this parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CreateParcelRequestLineItem"
          }
        },
        "receiver": {
          "description": "Receiver defines who is the receiving the goods.",
          "$ref": "#/definitions/CreateParcelRequestReceiver"
        },
        "sender": {
          "description": "Sender defines the party who sends the goods.",
          "$ref": "#/definitions/CreateParcelRequestSender"
        },
        "site_id": {
          "description": "SiteID is the id of the site which published the event.",
          "type": "string"
        },
        "tos_id": {
          "description": "TosID is the TOS ID associated with the order.",
          "type": "string"
        },
        "tracking_number": {
          "description": "TrackingNumber is the tracking number of the logistic unit.",
          "type": "string"
        }
      }
    },
    "CreateParcelRequestDestination": {
      "description": "Destination is the address of a place that package is sent to. It can be either a home or company address or a pickup point.",
      "type": "object",
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "pickup": {
          "$ref": "#/definitions/CreateParcelRequestPickupPointDetails"
        }
      }
    },
    "CreateParcelRequestLineItem": {
      "description": "Defines line item on carrier Parcel.",
      "type": "object",
      "required": [
        "sku",
        "quantity",
        "price",
        "currency"
      ],
      "properties": {
        "discount": {
          "description": "Discount is the discount for a given item in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "image": {
          "description": "Image is the URL of the image of the given cart item.",
          "type": "string"
        },
        "name": {
          "description": "Name is the product name or title.",
          "type": "string"
        },
        "price": {
          "description": "Price is the price of a single item with applied discounts in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "properties": {
          "description": "Properties that define item variant.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "quantity": {
          "description": "Quantity is the total number of a given product item in the cart.",
          "type": "integer",
          "format": "int32"
        },
        "sku": {
          "description": "SKU is a unique product identifier.",
          "type": "string"
        },
        "total_price": {
          "type": "integer",
          "format": "int32",
          "title": "TotalPrice is the total price for all items of the same SKU in cents"
        }
      }
    },
    "CreateParcelRequestPickupPointDetails": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "id": {
          "description": "ID of the pickup point in carrier service.",
          "type": "string"
        },
        "location_type": {
          "$ref": "#/definitions/PickupLocationType"
        }
      }
    },
    "CreateParcelRequestReceiver": {
      "description": "Receiver defines who is receiving the goods.",
      "type": "object",
      "required": [
        "name",
        "destination"
      ],
      "properties": {
        "destination": {
          "$ref": "#/definitions/CreateParcelRequestDestination"
        },
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        }
      }
    },
    "CreateParcelRequestSender": {
      "description": "Sender defines the party who sends the goods.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "CreateParcelResponse": {
      "type": "object"
    },
    "CreateTrackingOrderRequest": {
      "type": "object",
      "required": [
        "site_id",
        "external_id",
        "carrier_product_ref",
        "sender",
        "receiver",
        "destination",
        "delivery_type"
      ],
      "properties": {
        "carrier_product_ref": {
          "description": "CarrierProductRef is a carrier product reference from external system that is mapped in Ingrid.",
          "type": "string"
        },
        "cart": {
          "$ref": "#/definitions/CreateTrackingOrderRequestCart"
        },
        "delivery_type": {
          "description": "DeliveryType specifies the type of delivery for this order.",
          "$ref": "#/definitions/CreateTrackingOrderRequestDeliveryType"
        },
        "destination": {
          "description": "Destination is the address of the location that the order is supposed to be delivered to (i.e. home address or pickup point).",
          "$ref": "#/definitions/CreateTrackingOrderRequestDestination"
        },
        "external_id": {
          "description": "ExternalID is an identifier for the order in merchants system.",
          "type": "string"
        },
        "promises": {
          "description": "Promises is used to indicate the estimated times for various milestones of the delivery.",
          "$ref": "#/definitions/CreateTrackingOrderRequestPromises"
        },
        "receiver": {
          "$ref": "#/definitions/CreateTrackingOrderRequestReceiver"
        },
        "sender": {
          "$ref": "#/definitions/CreateTrackingOrderRequestSender"
        },
        "site_id": {
          "description": "SiteID is the identifier of the site in Ingrid system.",
          "type": "string"
        }
      }
    },
    "CreateTrackingOrderRequestCart": {
      "type": "object",
      "required": [
        "items",
        "total",
        "discount"
      ],
      "properties": {
        "currency": {
          "description": "Currency represented as a symbol (ISO-4217 - 3 letters string). Examples: USD, PLN, SEK.",
          "type": "string"
        },
        "discount": {
          "description": "Discount is a total discount amount for the cart in cents. Example `2000` is `20.00`.",
          "type": "integer",
          "format": "int32"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CreateTrackingOrderRequestCartItem"
          }
        },
        "shipping_price": {
          "description": "ShippingPrice is a price for the shipping in cents. Example `2000` is `20.00`.",
          "type": "integer",
          "format": "int32"
        },
        "tax": {
          "description": "Tax is a total tax amount for the cart in cents. Example `2000` is `20.00`.",
          "type": "integer",
          "format": "int32"
        },
        "total": {
          "description": "Total cart value (without shipping) in cents after applying discounts. Example `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CreateTrackingOrderRequestCartItem": {
      "type": "object",
      "required": [
        "sku",
        "name",
        "quantity",
        "price",
        "discount"
      ],
      "properties": {
        "discount": {
          "description": "Discount for a given item in cents. Example `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "image": {
          "description": "Image is an URL of the image of the given cart item.",
          "type": "string"
        },
        "name": {
          "description": "Name is a product name or title.",
          "type": "string"
        },
        "price": {
          "description": "Price of the single item with applied discounts in cents. Example `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "quantity": {
          "description": "Quantity is a total number of a given product item in the cart.",
          "type": "integer",
          "format": "int32"
        },
        "sku": {
          "description": "SKU is a unique product identifier.",
          "type": "string"
        }
      }
    },
    "CreateTrackingOrderRequestDeliveryType": {
      "description": "Delivery type describes in what way the goods will be delivered.\n\n - UNKNOWN: Delivery type is not known.\n - DELIVERY: Home delivery.\n - PICKUP: Delivery to a service point or a locker.\n - INSTORE: Delivery to one of the merchants stores.",
      "type": "string",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "DELIVERY",
        "PICKUP",
        "INSTORE"
      ]
    },
    "CreateTrackingOrderRequestDestination": {
      "type": "object",
      "required": [
        "address"
      ],
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "location_external_id": {
          "description": "LocationExternalID Id of the location used to identify it in the external system.",
          "type": "string"
        },
        "location_type": {
          "description": "LocationType specifies the type of pickup location.",
          "$ref": "#/definitions/CreateTrackingOrderRequestDestinationPickupLocationType"
        },
        "operational_hours": {
          "$ref": "#/definitions/CreateTrackingOrderRequestDestinationOperationalHours"
        }
      }
    },
    "CreateTrackingOrderRequestDestinationOperationalHours": {
      "description": "Operational Hours of the pickup location defined per day. Each day can have multiple time ranges defined\nfor example to indicate a break in operational hours. If no time range is defined for a given day it is\nwill be treated as that the location is closed during that day.",
      "type": "object",
      "properties": {
        "fri": {
          "description": "Fri represents operational hours defined for Friday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "mon": {
          "description": "Mon represents operational hours defined for Monday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "sat": {
          "description": "Sat represents operational hours defined for Saturday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "sun": {
          "description": "Sun represents operational hours defined for Sunday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "thu": {
          "description": "Thu represents operational hours defined for Thursday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "tue": {
          "description": "Tue represents operational hours defined for Tuesday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        },
        "wed": {
          "description": "Wed represents operational hours defined for Wedensday.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TimeRange"
          }
        }
      }
    },
    "CreateTrackingOrderRequestDestinationPickupLocationType": {
      "description": "Delivery type describes in what way the goods will be delivered.\n\n - UNKNOWN_PICKUP_LOCATION_TYPE: Location type is not known for some reason\n - LOCKER: Locker location type. Example Instabox or a DHL locker.\n - STORE: Can be a merchant's store or any other store that handles logistics.\n - MANNED: A manned service point.",
      "type": "string",
      "default": "UNKNOWN_PICKUP_LOCATION_TYPE",
      "enum": [
        "UNKNOWN_PICKUP_LOCATION_TYPE",
        "LOCKER",
        "STORE",
        "MANNED"
      ]
    },
    "CreateTrackingOrderRequestPromises": {
      "type": "object",
      "properties": {
        "estimated_delivery_time": {
          "description": "EstimatedDeliveryTime is the estimated time when the order will be delivered to the customer.",
          "$ref": "#/definitions/DateTimeRangeStrict"
        },
        "estimated_preparation_time": {
          "description": "EstimatedPreparationTime is the estimated time when the order will be prepared for shipping.",
          "$ref": "#/definitions/DateTimeRangeStrict"
        },
        "estimated_submission_time": {
          "description": "EstimatedSubmissionTime is the estimated time when the order will be submitted to the carrier.",
          "$ref": "#/definitions/DateTimeRangeStrict"
        }
      }
    },
    "CreateTrackingOrderRequestReceiver": {
      "description": "Receiver defines who is receiving the goods.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "address": {
          "description": "Address defines home address of the receiver.",
          "$ref": "#/definitions/Address"
        },
        "billing_address": {
          "description": "Billing address defines billing address of the receiver.",
          "$ref": "#/definitions/Address"
        },
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        }
      }
    },
    "CreateTrackingOrderRequestSender": {
      "description": "Sender defines the party who sends the goods.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "CreateTrackingOrderResponse": {
      "type": "object",
      "properties": {
        "id": {
          "description": "Id of the tracking order.",
          "type": "string"
        }
      }
    },
    "DateTimeRange": {
      "description": "Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.",
      "type": "object",
      "properties": {
        "end": {
          "description": "End of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`.",
          "type": "string"
        },
        "start": {
          "type": "string",
          "title": "Start of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`"
        }
      }
    },
    "DateTimeRangeStrict": {
      "description": "Provides a strict date interval. Both `start` and `end` parts need to be present.",
      "type": "object",
      "properties": {
        "end": {
          "description": "End of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`.",
          "type": "string"
        },
        "start": {
          "type": "string",
          "title": "Start of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`"
        }
      }
    },
    "DeliveryType": {
      "description": "- UNKNOWN: Delivery type is not known for some reason\n - DELIVERY: Home delivery\n - PICKUP: Delivery to a service point or a locker\n - MAILBOX: Delivery to customer's mailbox\n - INSTORE: Delivery to one of the merchants stores\n - INWAREHOUSE: Delivery to the warehouse. This type is used with chain delivery in warehouse-warehouse-delivery/pickup.",
      "type": "string",
      "title": "Indicates the type of the delivery",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "DELIVERY",
        "PICKUP",
        "MAILBOX",
        "INSTORE",
        "INWAREHOUSE"
      ]
    },
    "DirectionType": {
      "description": "Indicates intended direction of parcel, shipment etc.\n\n - OUTBOUND: From merchant to customer.\n - RETURN: Return from customer to merchant.\n - UNSPECIFIED: Unspecified means we do not know the direction. It is the default state when we do not know any better.",
      "type": "string",
      "default": "UNKNOWN_DIRECTION_TYPE",
      "enum": [
        "UNKNOWN_DIRECTION_TYPE",
        "OUTBOUND",
        "RETURN",
        "UNSPECIFIED"
      ]
    },
    "DisplayItem": {
      "type": "object",
      "properties": {
        "discount": {
          "type": "integer",
          "format": "int32"
        },
        "image": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "price": {
          "type": "integer",
          "format": "int32"
        },
        "quantity": {
          "description": "quantity - current quantity of items.",
          "type": "integer",
          "format": "int32"
        },
        "sku": {
          "type": "string"
        },
        "total_price": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "EstimatedTime": {
      "type": "object",
      "properties": {
        "earliest": {
          "description": "Earliest date in RFC3339 format.",
          "type": "string"
        },
        "latest": {
          "description": "Latest date in RFC3339 format.",
          "type": "string"
        }
      }
    },
    "ExceptionStatus": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "string",
          "title": "created_at - timestamp in RFC3339 format"
        },
        "status": {
          "description": "status of the exception currently conforms to the `tracking.Status`.",
          "type": "string"
        }
      }
    },
    "GenerateTrackingPageLinkRequest": {
      "description": "NOTE: You must specify one of the 'tracking_number' or 'order_id'.",
      "type": "object",
      "required": [
        "site_id",
        "locale"
      ],
      "properties": {
        "locale": {
          "description": "Tracking page link localization.",
          "type": "string"
        },
        "order_id": {
          "description": "Identifier of the order to which the parcels belongs. This is either 'tos_id' or 'external_id'.",
          "type": "string"
        },
        "site_id": {
          "description": "Identifier of the site to which the tracking resource belongs.",
          "type": "string"
        },
        "tracking_number": {
          "description": "Tracking number of the parcel.",
          "type": "string"
        }
      }
    },
    "GenerateTrackingPageLinkResponse": {
      "type": "object",
      "properties": {
        "tracking_link": {
          "type": "string"
        },
        "tracking_links": {
          "$ref": "#/definitions/TrackingLinks"
        }
      }
    },
    "GetTrackingOrdersResponse": {
      "type": "object",
      "properties": {
        "orders": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PrivateOrder"
          }
        }
      }
    },
    "GetTrackingParcelsResponse": {
      "type": "object",
      "properties": {
        "external_id": {
          "description": "ID in the merchant system of the order containing tracking parcels.",
          "type": "string"
        },
        "parcels": {
          "description": "Parcels connected with the provided tracking ID.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TrackingParcel"
          }
        },
        "tos_id": {
          "description": "ID in the Ingrid system of the order containing tracking parcels.",
          "type": "string"
        },
        "tracking_link": {
          "description": "Link to the Ingrid tracking portal.",
          "type": "string"
        },
        "tracking_links": {
          "description": "Tracking links for the order.",
          "$ref": "#/definitions/TrackingLinks"
        }
      }
    },
    "Item": {
      "type": "object",
      "properties": {
        "attributes": {
          "description": "Attributes represents a collection of key-value pairs containing additional item properties.\nBoth keys and values are strings. Examples: {\"brand\": \"Nike\", \"material\": \"cotton\"}.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "cancelled_quantity": {
          "description": "CancelledQuantity is the number of items that have been cancelled.",
          "type": "integer",
          "format": "int32"
        },
        "cancelled_total_price": {
          "description": "CancelledTotalPrice is the total price for all cancelled items of the same SKU in cents.",
          "type": "integer",
          "format": "int32"
        },
        "discount": {
          "description": "Discount is the discount for a given item in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "image": {
          "description": "Image is the URL of the image of the given cart item.",
          "type": "string"
        },
        "name": {
          "description": "Name is the product name or title.",
          "type": "string"
        },
        "price": {
          "description": "Price is the price of a single item with applied discounts in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "quantity": {
          "description": "Quantity is the total number of a given non-cancelled product item in the cart.",
          "type": "integer",
          "format": "int32"
        },
        "sku": {
          "description": "SKU is a unique product identifier.",
          "type": "string"
        },
        "total_price": {
          "type": "integer",
          "format": "int32",
          "title": "TotalPrice is the total price for all non-cancelled items of the same SKU in cents"
        },
        "variant": {
          "$ref": "#/definitions/ItemVariant"
        }
      }
    },
    "ItemVariant": {
      "description": "Properties that define item variant.",
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "size": {
          "type": "string"
        }
      }
    },
    "LineItem": {
      "type": "object",
      "required": [
        "sku",
        "quantity",
        "price",
        "currency"
      ],
      "properties": {
        "currency": {
          "description": "Currency represented as a symbol (ISO-4217 - 3 letters string). Examples: USD, PLN, SEK.",
          "type": "string"
        },
        "discount": {
          "description": "Discount is the discount for a given item in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "image": {
          "description": "Image is the URL of the image of the given cart item.",
          "type": "string"
        },
        "name": {
          "description": "Name is the product name or title.",
          "type": "string"
        },
        "price": {
          "description": "Price is the price of a single item with applied discounts in cents. Example: `20000` represents `200.00`.",
          "type": "integer",
          "format": "int32"
        },
        "properties": {
          "description": "Properties that define item variant.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "quantity": {
          "description": "Quantity is the total number of a given product item in the cart.",
          "type": "integer",
          "format": "int32"
        },
        "sku": {
          "description": "SKU is a unique product identifier.",
          "type": "string"
        },
        "total_price": {
          "type": "integer",
          "format": "int32",
          "title": "TotalPrice is the total price for all items of the same SKU in cents"
        }
      }
    },
    "Location": {
      "type": "object",
      "required": [
        "address"
      ],
      "properties": {
        "address": {
          "$ref": "#/definitions/Address"
        },
        "location_external_id": {
          "description": "location_external_id - external identifier for the location.",
          "type": "string"
        },
        "location_type": {
          "$ref": "#/definitions/PickupLocationType"
        },
        "operational_hours": {
          "$ref": "#/definitions/OperationalHours"
        },
        "pickup_instructions": {
          "description": "pickup_instructions - instructions for the customer to pick up the parcel.",
          "type": "string"
        }
      }
    },
    "OperationalHours": {
      "type": "object",
      "properties": {
        "free_text": {
          "type": "array",
          "title": "Free text operational hours. Used as a fallback when the\noperational hours cannot be parsed correctly",
          "items": {
            "type": "string"
          }
        },
        "fri": {
          "type": "string",
          "title": "Friday"
        },
        "mon": {
          "type": "string",
          "title": "Monday"
        },
        "sat": {
          "type": "string",
          "title": "Saturday"
        },
        "sun": {
          "type": "string",
          "title": "Sunday"
        },
        "thu": {
          "type": "string",
          "title": "Thursday"
        },
        "tue": {
          "type": "string",
          "title": "Tuesday"
        },
        "wed": {
          "type": "string",
          "title": "Wednesday"
        }
      }
    },
    "PickupLocationType": {
      "description": "- UNKNOWN_PICKUP_LOCATION_TYPE: Location type is not known for some reason\n - LOCKER: Locker location type. Example Instabox or a DHL locker\n - STORE: Can be a merchant's store or any other store that handles logistics\n - POSTOFFICE: Postal office\n - MANNED: A manned service point\n - AGE_VERIFICATION: Location that supports age verification (age check)",
      "type": "string",
      "title": "Indicates the kind of pickup location",
      "default": "UNKNOWN_PICKUP_LOCATION_TYPE",
      "enum": [
        "UNKNOWN_PICKUP_LOCATION_TYPE",
        "LOCKER",
        "STORE",
        "POSTOFFICE",
        "MANNED",
        "AGE_VERIFICATION"
      ]
    },
    "PrivateOrder": {
      "type": "object",
      "required": [
        "analytics_id"
      ],
      "properties": {
        "analytics_id": {
          "type": "string"
        },
        "cart": {
          "$ref": "#/definitions/PrivateOrderCart"
        },
        "external_id": {
          "type": "string"
        },
        "items": {
          "description": "Deprecated: use Cart instead.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/DisplayItem"
          }
        },
        "parcels": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PrivateParcel"
          }
        },
        "preselected_parcel_index": {
          "type": "string",
          "format": "int64"
        },
        "sender_name": {
          "description": "sender_name is the name of the sender of the order. This maybe a site name or a merchant name.",
          "type": "string"
        },
        "site_name": {
          "type": "string"
        },
        "tos_id": {
          "type": "string"
        },
        "tracking_links": {
          "description": "TrackingLinks contains links related to tracking for this order.",
          "$ref": "#/definitions/TrackingLinks"
        }
      }
    },
    "PrivateOrderCart": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Item"
          }
        },
        "prices": {
          "$ref": "#/definitions/PrivateOrderCartPrices"
        }
      }
    },
    "PrivateOrderCartPrices": {
      "type": "object",
      "properties": {
        "shipping_components": {
          "description": "ShippingComponents represents the shipping components of the cart.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PrivateOrderCartPricesShippingComponent"
          }
        },
        "total": {
          "description": "Totals represents the totals of the cart.",
          "$ref": "#/definitions/PrivateOrderCartPricesTotals"
        }
      }
    },
    "PrivateOrderCartPricesShippingComponent": {
      "type": "object",
      "properties": {
        "discount": {
          "description": "Discount represents the discount of the shipping component in cents.",
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "description": "Name represents the name of the shipping component. Translated to the given locale.",
          "type": "string"
        },
        "price": {
          "description": "Price represents the price of the shipping component in cents.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "PrivateOrderCartPricesTotals": {
      "type": "object",
      "properties": {
        "discount": {
          "description": "Discount represents the total discount of the cart with a shipping discount included.",
          "type": "integer",
          "format": "int32"
        },
        "items_discount": {
          "description": "ItemsDiscount represents the total discount of the cart items in cents.",
          "type": "integer",
          "format": "int32"
        },
        "items_price": {
          "description": "ItemsPrice represents the total price of the cart items in cents with items discount applied.",
          "type": "integer",
          "format": "int32"
        },
        "price": {
          "description": "Price represents the total price of the cart in cents with discount and shipping price applied.",
          "type": "integer",
          "format": "int32"
        },
        "shipping_discount": {
          "description": "ShippingDiscount represents the total shipping discount of the cart in cents.",
          "type": "integer",
          "format": "int32"
        },
        "shipping_price": {
          "description": "ShippingPrice represents the total shipping price of the cart in cents with shipping discount applied.",
          "type": "integer",
          "format": "int32"
        },
        "tax": {
          "description": "Tax represents the total tax of the cart in cents.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "PrivateParcel": {
      "type": "object",
      "required": [
        "tracking_number"
      ],
      "properties": {
        "alerts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Alert"
          }
        },
        "carrier": {
          "type": "string",
          "title": "carrier will be provided in carrier-product format (\"carrier-NAME\")"
        },
        "carrier_fallback_enabled": {
          "description": "Enabled when we're not receiving tracking updates.\nLike when the always_show_tracking_links flag is enabled on the carrier product.",
          "type": "boolean"
        },
        "carrier_link": {
          "type": "string",
          "title": "carrier_link is the link to the carrier's tracking"
        },
        "carrier_logo_pattern": {
          "type": "string"
        },
        "carrier_product_id": {
          "type": "string"
        },
        "carrier_product_ref": {
          "type": "string"
        },
        "delivery_type": {
          "$ref": "#/definitions/DeliveryType"
        },
        "direction_type": {
          "$ref": "#/definitions/DirectionType"
        },
        "display_carrier_name": {
          "type": "string"
        },
        "estimated_delivery_time": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "exceptions": {
          "description": "Exceptions contains list af all exceptions that happened for a given parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ExceptionStatus"
          }
        },
        "index": {
          "type": "integer",
          "format": "int32"
        },
        "line_items": {
          "description": "Defines line items on the parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/LineItem"
          }
        },
        "location": {
          "$ref": "#/definitions/Location"
        },
        "progress": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ProgressItem"
          }
        },
        "requested_shipping_method": {
          "type": "string"
        },
        "sender_name": {
          "description": "sender_name is the name of the sender for this parcel.",
          "type": "string"
        },
        "tracking_link": {
          "description": "Deprecated: use carrier_link instead.\nThe logic behind this value changes and the new field will guarantee the graceful switchover.",
          "type": "string"
        },
        "tracking_number": {
          "type": "string"
        }
      }
    },
    "ProgressItem": {
      "type": "object",
      "required": [
        "step",
        "time"
      ],
      "properties": {
        "estimated_time": {
          "$ref": "#/definitions/DateTimeRange"
        },
        "step": {
          "$ref": "#/definitions/Step"
        },
        "time": {
          "type": "string",
          "title": "RFC3339 event timestamp"
        }
      }
    },
    "Step": {
      "type": "string",
      "default": "STEP_UNKNOWN",
      "enum": [
        "STEP_UNKNOWN",
        "STEP_CONFIRMED_BY_MERCHANT",
        "STEP_PREPARED_BY_MERCHANT",
        "STEP_SUBMITTED_TO_CARRIER",
        "STEP_ON_ROUTE",
        "STEP_DELIVERED_TO_PICKUP_POINT",
        "STEP_DELIVERED_TO_CONSUMER",
        "STEP_TERMINATED",
        "STEP_SENT_BACK",
        "STEP_RETURN_REQUESTED",
        "STEP_DELIVERED_TO_MERCHANT",
        "STEP_AWAITING_SUPPLIER",
        "STEP_LINEHAUL_TO_CARRIER",
        "STEP_RETURN_APPROVED",
        "STEP_RETURN_DECLINED",
        "STEP_RETURN_COMPLETED",
        "STEP_REPLACEMENT_SENT",
        "STEP_RETURN_CANCELLED"
      ]
    },
    "TimeRange": {
      "description": "Provides a time interval. Both start and end of the range need to be provided.",
      "type": "object",
      "properties": {
        "end": {
          "type": "string",
          "title": "End of the interval. Time should be provided in \"HH:MM:SS\" format. Example `15:04:05`"
        },
        "start": {
          "type": "string",
          "title": "Start of the interval. Time should be provided in \"HH:MM:SS\" format. Example `15:04:05`"
        }
      }
    },
    "TrackingLinks": {
      "type": "object",
      "properties": {
        "links": {
          "description": "Links to the tracking page. It contains at least one link.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TrackingLinksLink"
          }
        }
      }
    },
    "TrackingLinksLink": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/TrackingLinksType"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "TrackingLinksType": {
      "description": " - INGRID_PORTAL_LINK: Link to the Ingrid tracking portal. It's always available.\n - MERCHANT_PROVIDED_LINK: Link provided by the merchant. It's available only if the merchant provided it.",
      "type": "string",
      "default": "UNKNOWN_LINK_TYPE",
      "enum": [
        "UNKNOWN_LINK_TYPE",
        "INGRID_PORTAL_LINK",
        "MERCHANT_PROVIDED_LINK"
      ]
    },
    "TrackingParcel": {
      "type": "object",
      "properties": {
        "carrier_name": {
          "description": "Name of the carrier responsible for the parcel.",
          "type": "string"
        },
        "current_progress": {
          "description": "Current tracking step that the parcel is in.",
          "$ref": "#/definitions/ProgressItem"
        },
        "destination": {
          "description": "Destination address of the parcel.",
          "$ref": "#/definitions/Location"
        },
        "progress_history": {
          "description": "History of the tracking steps for this parcel.",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ProgressItem"
          }
        },
        "receiver": {
          "description": "Receiver of the parcel.",
          "$ref": "#/definitions/TrackingParcelReceiver"
        },
        "sender": {
          "description": "Sender of the parcel.",
          "$ref": "#/definitions/TrackingParcelSender"
        },
        "shipping_method": {
          "description": "Name of the shipping method requested for the parcel booking.\nThis field is deprecated and will be removed in the future. Use 'shipping_methods' instead.",
          "type": "string"
        },
        "shipping_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TrackingParcelShippingMethod"
          }
        },
        "tracking_links": {
          "description": "Tracking links for the parcel.",
          "$ref": "#/definitions/TrackingLinks"
        },
        "tracking_number": {
          "description": "Tracking number of the parcel.",
          "type": "string"
        }
      }
    },
    "TrackingParcelReceiver": {
      "description": "Information about the receiver of the parcel.",
      "type": "object",
      "properties": {
        "address": {
          "description": "Address of the parce receiver.",
          "$ref": "#/definitions/Address"
        },
        "email": {
          "description": "Customer email used for notifications.",
          "type": "string"
        },
        "name": {
          "description": "Name of the parcel receiver.",
          "type": "string"
        },
        "phone_number": {
          "description": "Customer phone number used for notifications.",
          "type": "string"
        }
      }
    },
    "TrackingParcelSender": {
      "description": "Information about the sender of the parcel.",
      "type": "object",
      "properties": {
        "address": {
          "description": "Address of the parce sender.",
          "$ref": "#/definitions/Address"
        },
        "name": {
          "description": "Name of the parcel sender.",
          "type": "string"
        }
      }
    },
    "TrackingParcelShippingMethod": {
      "type": "object",
      "properties": {
        "origin": {
          "$ref": "#/definitions/TrackingParcelShippingMethodOrigin"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "TrackingParcelShippingMethodOrigin": {
      "description": " - ORDER: Shipping method used in TOS order.\n - BOOKING_REQUEST: Shipping method requested for the parcel booking.\nOnly available if this method is different than booked one.\n - BOOKING: Shipping method booked for the parcel.\nAvailable only if parcels was booked in Ingrid.",
      "type": "string",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "ORDER",
        "BOOKING_REQUEST",
        "BOOKING"
      ]
    },
    "Error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Any"
          }
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}