{
    "openapi": "3.1.0",
    "info": {
        "title": "TrackShip Tracking API",
        "description": "The TrackShip Tracking API lets you create, retrieve, and delete shipment trackers and list supported shipping providers. All authenticated requests must send the `trackship-api-key` and `app-name` headers. See the human documentation at https://docs.trackship.com/docs/tracking-api/ .\n\n## Versioning & deprecation\n\nThis API is versioned in the URL path. The current and only version is `v1`, and it receives no breaking changes; if one is ever needed it will ship as a new version while v1 keeps working.\n\nEvery response carries a `Link` header with `rel=\"deprecation\"` pointing at the deprecation policy. Per RFC 9745 §3.1, a `rel=\"deprecation\"` link **without** a `Deprecation` field means \"not (yet) deprecated; this is where the policy lives\". If an API version or endpoint is ever deprecated, affected responses will additionally carry the `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) HTTP response headers, and the deprecation will be announced at least 6 months before removal. **No operation is deprecated today, and no `Deprecation` or `Sunset` header is currently sent.** Full policy: https://docs.trackship.com/docs/tracking-api/api-reference/versioning-deprecation-policy/\n\n## Error envelopes\n\nThis API returns two different error envelopes depending on where the error is raised:\n\n- **Endpoint errors** use `{\"status\": \"error\", ...}` with the detail in either `status_msg` or `message`, depending on the endpoint and the specific error.\n- **Platform errors** (for example an unknown route) use `{\"success\": false, \"data\": [], \"meta\": {\"code\": …, \"message\": …}}`.\n\nBoth shapes are documented per status code below using `oneOf`. Clients should branch on the HTTP status code first, then check whether the body carries `status` or `success`.\n\n## Authentication failures\n\nAuthentication failures are **not** uniformly `401`. The create endpoint returns `401`; the get, by-order-id and delete endpoints return `400` with the detail in `status_msg`. Each operation documents what it actually returns.",
        "version": "1.1.0",
        "contact": {
            "name": "TrackShip Support",
            "url": "https://docs.trackship.com/docs/tracking-api/"
        },
        "license": {
            "name": "Proprietary",
            "url": "https://trackship.com/terms-of-service/"
        },
        "x-deprecation-policy": {
            "versioning": "url-path",
            "currentVersion": "v1",
            "signals": [
                "Deprecation",
                "Sunset"
            ],
            "specifications": {
                "Deprecation": "RFC 9745",
                "Sunset": "RFC 8594"
            },
            "minimumNoticePeriod": "P6M",
            "documentation": "https://docs.trackship.com/docs/tracking-api/api-reference/versioning-deprecation-policy/"
        }
    },
    "servers": [
        {
            "url": "https://api.trackship.com/v1",
            "description": "TrackShip production API"
        }
    ],
    "externalDocs": {
        "description": "TrackShip Tracking API documentation",
        "url": "https://docs.trackship.com/docs/tracking-api/"
    },
    "tags": [
        {
            "name": "Shipments",
            "description": "Create, retrieve, and delete shipment trackers."
        },
        {
            "name": "Shipping providers",
            "description": "Reference data for supported carriers."
        },
        {
            "name": "Service description",
            "description": "Machine-readable description of this API."
        }
    ],
    "security": [
        {
            "TrackShipApiKey": [],
            "AppName": []
        }
    ],
    "paths": {
        "/shipment/create/": {
            "post": {
                "operationId": "createShipment",
                "summary": "Create a tracking",
                "description": "Create a shipment tracker. Returns the account's remaining tracker balance and plan.\n\nIf a tracker already exists for the same store, tracking number and order id, it is updated instead of duplicated.",
                "tags": [
                    "Shipments"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateShipmentRequest"
                            },
                            "example": {
                                "tracking_number": "1Z4937W56728755212",
                                "tracking_provider": "ups",
                                "order_id": "13",
                                "postal_code": "98012",
                                "destination_country": "US"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Tracker created or updated. A `200` is also returned when the tracker could not be queued for tracking, in which case `status_msg` explains why (for example `insufficient_balance` or `carrier_unsupported`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateShipmentResponse"
                                },
                                "examples": {
                                    "queued": {
                                        "summary": "Tracker accepted and queued",
                                        "value": {
                                            "status": "ok",
                                            "status_msg": "pending_trackship",
                                            "trackers_balance": "98",
                                            "user_plan": "Mini",
                                            "period": "month"
                                        }
                                    },
                                    "insufficientBalance": {
                                        "summary": "Account has no tracker balance left",
                                        "value": {
                                            "status": "ok",
                                            "status_msg": "insufficient_balance",
                                            "trackers_balance": 0,
                                            "user_plan": "Mini",
                                            "period": "month"
                                        }
                                    }
                                }
                            }
                        },
                        "headers": {
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequestStatusMsg"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    },
                    "429": {
                        "$ref": "#/components/responses/TrackingThrottled"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/shipment/get/": {
            "post": {
                "operationId": "getShipmentStatus",
                "summary": "Get a shipment status",
                "description": "Retrieve the current tracking status and event history of a shipment.",
                "tags": [
                    "Shipments"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetShipmentRequest"
                            },
                            "example": {
                                "tracking_number": "6860010537552",
                                "tracking_provider": "delhivery"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Shipment tracking data.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ShipmentStatusResponse"
                                }
                            }
                        },
                        "headers": {
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequestEndpoint"
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/shipment/by-order-id": {
            "post": {
                "operationId": "getShipmentsByOrderId",
                "summary": "Get shipments by order id",
                "description": "Retrieve the tracking status of all shipments associated with a specific order id.",
                "tags": [
                    "Shipments"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ByOrderIdRequest"
                            },
                            "example": {
                                "order_id": "141"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A list of shipments for the order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ByOrderIdResponse"
                                }
                            }
                        },
                        "headers": {
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequestEndpoint"
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/shipment/delete/": {
            "post": {
                "operationId": "deleteShipment",
                "summary": "Delete a shipment tracker",
                "description": "Delete a shipment tracker for the given tracking number, provider, and order id.",
                "tags": [
                    "Shipments"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DeleteShipmentRequest"
                            },
                            "example": {
                                "tracking_number": "1Z4937W56728755212",
                                "tracking_provider": "ups",
                                "order_id": "10"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The tracker was deleted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeleteShipmentResponse"
                                },
                                "example": {
                                    "status": "success",
                                    "message": "Shipment deleted successfully"
                                }
                            }
                        },
                        "headers": {
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequestDelete"
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/shipping_carriers/supported": {
            "get": {
                "operationId": "getSupportedShippingProviders",
                "summary": "Get all shipping providers",
                "description": "List all shipping providers (carriers) supported by TrackShip. This endpoint does not require authentication.",
                "tags": [
                    "Shipping providers"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "The full list of supported shipping providers.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ShippingProvidersResponse"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "label": "Australia Post",
                                            "slug": "australia-post"
                                        },
                                        {
                                            "label": "CouriersPlease",
                                            "slug": "couriersplease"
                                        }
                                    ],
                                    "meta": {
                                        "code": 2001,
                                        "message": "Carriers data get Successfully"
                                    }
                                }
                            }
                        },
                        "headers": {
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "operationId": "getOpenApiDocument",
                "summary": "Get this OpenAPI document",
                "description": "Returns this OpenAPI 3.1 document. Public: no API key required. Supports `GET`, `HEAD` and `OPTIONS`; `OPTIONS` returns `204` with `Access-Control-Allow-Methods: GET, HEAD, OPTIONS`.",
                "tags": [
                    "Service description"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "The OpenAPI document describing this API.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "description": "An OpenAPI 3.1 document."
                                }
                            }
                        },
                        "headers": {
                            "Cache-Control": {
                                "description": "Cache directive for this document.",
                                "required": false,
                                "schema": {
                                    "type": "string"
                                },
                                "example": "public, max-age=3600"
                            },
                            "Link": {
                                "$ref": "#/components/headers/Link"
                            },
                            "Deprecation": {
                                "$ref": "#/components/headers/Deprecation"
                            },
                            "Sunset": {
                                "$ref": "#/components/headers/Sunset"
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/InvalidRoute"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "TrackShipApiKey": {
                "type": "apiKey",
                "in": "header",
                "name": "trackship-api-key",
                "description": "Your TrackShip API key. Found under Account Setting > API Key."
            },
            "AppName": {
                "type": "apiKey",
                "in": "header",
                "name": "app-name",
                "description": "Your app name. Found under Stores > settings > Webhook."
            }
        },
        "responses": {
            "BadRequestStatusMsg": {
                "description": "A required parameter is missing or invalid. The detail is in `status_msg`.\n\nKnown values: `missing_order_id`, `missing_tracking`, `invalid_tracking`, `missing_carrier`, `missing_store`.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorStatusMsg"
                        },
                        "example": {
                            "status": "error",
                            "status_msg": "missing_order_id"
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "BadRequestEndpoint": {
                "description": "The request was rejected. **Note:** authentication failures are returned as `400`, not `401`, on this endpoint.\n\nTwo body shapes are possible:\n- Authentication and store errors put the detail in `status_msg` (for example `User key is wrong`, `app name not found`, `Invalid API key provided`, `Store identifier (app name) is missing`).\n- Validation and lookup errors put the detail in `message` (for example `Invalid app name in the request`, `tracking_number not found`, `tracking information is not exist`, `Order ID not found`, `No shipment data found`).",
                "content": {
                    "application/json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/ErrorStatusMsg"
                                },
                                {
                                    "$ref": "#/components/schemas/ErrorMessage"
                                }
                            ]
                        },
                        "examples": {
                            "invalidKey": {
                                "summary": "Missing or invalid API key",
                                "value": {
                                    "status": "error",
                                    "status_msg": "User key is wrong"
                                }
                            },
                            "notFound": {
                                "summary": "No tracking data for the request",
                                "value": {
                                    "status": "error",
                                    "message": "tracking information is not exist"
                                }
                            }
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "BadRequestDelete": {
                "description": "The request was rejected. **Note:** authentication failures are returned as `400`, not `401`, on this endpoint.\n\nThree body shapes are possible:\n- Authentication errors put the detail in `status_msg` (`User key is wrong`, `app name not found`).\n- Validation and lookup errors put the detail in `message` (`tracking_number not found`, `tracking_provider not found`, `order_id not found`, `Invalid tracker details`, `Failed to delete tracker`).\n- Deleting an already-deleted tracker returns `status: \"success\"` with an HTTP `400`.",
                "content": {
                    "application/json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/ErrorStatusMsg"
                                },
                                {
                                    "$ref": "#/components/schemas/ErrorMessage"
                                },
                                {
                                    "$ref": "#/components/schemas/SuccessMessage"
                                }
                            ]
                        },
                        "examples": {
                            "invalidKey": {
                                "summary": "Missing or invalid API key",
                                "value": {
                                    "status": "error",
                                    "status_msg": "User key is wrong"
                                }
                            },
                            "missingField": {
                                "summary": "Required field missing",
                                "value": {
                                    "status": "error",
                                    "message": "order_id not found"
                                }
                            },
                            "alreadyDeleted": {
                                "summary": "Tracker was already deleted (HTTP 400 with status success)",
                                "value": {
                                    "status": "success",
                                    "message": "Tracker already deleted"
                                }
                            }
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "Unauthorized": {
                "description": "Unauthorized API access. Returned by the create endpoint only. Causes: `ssl_error` (store URL is not HTTPS), `unauthorized_api_key` (invalid API key), `unauthorized_store` (the store does not exist), `unauthorized_store_api_key` (the API key does not own that store).\n\nThe other endpoints return `400` for authentication failures.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorStatusMsg"
                        },
                        "example": {
                            "status": "error",
                            "status_msg": "unauthorized_api_key"
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "InvalidRoute": {
                "description": "The API route does not exist, or the HTTP method is not allowed for it. Check the URL and try again. This is a platform-level error and uses the `success`/`data`/`meta` envelope.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/PlatformError"
                        },
                        "example": {
                            "success": false,
                            "data": [],
                            "meta": {
                                "code": 404,
                                "message": "Invalid route"
                            }
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "TrackingThrottled": {
                "description": "This specific tracking number is temporarily throttled by the create endpoint. This is a per-tracking-number guard, not a general request quota.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorStatusMsg"
                        },
                        "example": {
                            "status": "error",
                            "status_msg": "too_many_request"
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            },
            "ServerError": {
                "description": "The server encountered an unexpected condition that prevented it from fulfilling the request.\n\n**Note:** the platform does not currently guarantee a structured JSON body for unhandled server errors. Treat any `5xx` as retryable and do not depend on the body shape.",
                "content": {
                    "application/json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/PlatformError"
                                },
                                {
                                    "$ref": "#/components/schemas/ErrorMessage"
                                }
                            ]
                        }
                    }
                },
                "headers": {
                    "Link": {
                        "$ref": "#/components/headers/Link"
                    },
                    "Deprecation": {
                        "$ref": "#/components/headers/Deprecation"
                    },
                    "Sunset": {
                        "$ref": "#/components/headers/Sunset"
                    }
                }
            }
        },
        "schemas": {
            "CreateShipmentRequest": {
                "type": "object",
                "required": [
                    "tracking_number",
                    "tracking_provider",
                    "order_id"
                ],
                "properties": {
                    "tracking_number": {
                        "type": "string",
                        "description": "Tracking number for the package. Must be at least 6 characters."
                    },
                    "tracking_provider": {
                        "type": "string",
                        "description": "Unique code of the tracking provider. See the shipping provider reference."
                    },
                    "order_id": {
                        "type": "string",
                        "description": "Respective order id."
                    },
                    "custom_order_id": {
                        "type": "string",
                        "description": "Your own display order number, stored alongside the tracker."
                    },
                    "postal_code": {
                        "type": "string",
                        "description": "Postal code of the receiver's address. Required for some couriers, such as postnl-3s."
                    },
                    "destination_country": {
                        "type": "string",
                        "description": "Destination country of the receiver's address (e.g. NL). Required for some couriers, such as postnl-3s."
                    },
                    "customer_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Recipient name, used for notifications."
                    },
                    "customer_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Recipient email, used for notifications."
                    },
                    "customer_phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Recipient phone number, used for SMS notifications."
                    },
                    "shipping_address_1": {
                        "type": "string"
                    },
                    "shipping_address_2": {
                        "type": "string"
                    },
                    "shipping_city": {
                        "type": "string"
                    },
                    "shipping_state": {
                        "type": "string"
                    },
                    "shipment_items": {
                        "type": "array",
                        "description": "Line items included in this shipment.",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "CreateShipmentResponse": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "Always `ok` for a 200 response.",
                        "examples": [
                            "ok"
                        ]
                    },
                    "status_msg": {
                        "type": "string",
                        "description": "State of the shipment. Known values: `pending_trackship` (accepted and queued), `insufficient_balance` (no tracker balance left), `carrier_unsupported` (carrier is not tracked by TrackShip)."
                    },
                    "trackers_balance": {
                        "type": [
                            "string",
                            "integer"
                        ],
                        "description": "Available tracker balance of the TrackShip account after this call."
                    },
                    "user_plan": {
                        "type": "string",
                        "description": "Active subscription plan of the TrackShip account (e.g. Free 20, Mini, Small)."
                    },
                    "period": {
                        "type": "string",
                        "description": "Billing period of the active plan (e.g. month, year). Empty when there is no active plan."
                    }
                }
            },
            "GetShipmentRequest": {
                "type": "object",
                "required": [
                    "tracking_number"
                ],
                "properties": {
                    "tracking_number": {
                        "type": "string",
                        "description": "Tracking number for the package."
                    },
                    "tracking_provider": {
                        "type": "string",
                        "description": "Unique code of the tracking provider for that tracking."
                    }
                }
            },
            "ByOrderIdRequest": {
                "type": "object",
                "required": [
                    "order_id"
                ],
                "properties": {
                    "order_id": {
                        "type": "string",
                        "description": "The unique id of the order."
                    }
                }
            },
            "DeleteShipmentRequest": {
                "type": "object",
                "required": [
                    "tracking_number",
                    "tracking_provider",
                    "order_id"
                ],
                "properties": {
                    "tracking_number": {
                        "type": "string",
                        "description": "Tracking number for the package."
                    },
                    "tracking_provider": {
                        "type": "string",
                        "description": "Unique code of the tracking provider for that tracking."
                    },
                    "order_id": {
                        "type": "string",
                        "description": "Respective order id."
                    }
                }
            },
            "ShipmentStatusResponse": {
                "type": "object",
                "required": [
                    "status",
                    "data"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "Always `success` for a 200 response.",
                        "examples": [
                            "success"
                        ]
                    },
                    "data": {
                        "$ref": "#/components/schemas/ShipmentData"
                    }
                }
            },
            "ByOrderIdResponse": {
                "type": "object",
                "required": [
                    "status",
                    "data"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "Always `success` for a 200 response.",
                        "examples": [
                            "success"
                        ]
                    },
                    "data": {
                        "type": "array",
                        "description": "Shipment tracking data for every shipment on the order.",
                        "items": {
                            "$ref": "#/components/schemas/ShipmentData"
                        }
                    }
                }
            },
            "ShipmentData": {
                "type": "object",
                "properties": {
                    "user_key": {
                        "type": "string",
                        "description": "Returned by the single-shipment endpoint only. Not returned by the by-order-id endpoint."
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "tracking_number": {
                        "type": "string"
                    },
                    "tracking_provider": {
                        "type": "string"
                    },
                    "tracking_event_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Current tracking status (e.g. pre_transit, in_transit, delivered)."
                    },
                    "tracking_est_delivery_date": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "origin_country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination_country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "delivery_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "delivery_provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "shipping_service": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_event_time": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination_state": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination_city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TrackingEvent"
                        }
                    },
                    "destination_events": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TrackingEvent"
                        }
                    }
                }
            },
            "TrackingEvent": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "description": "Object type, e.g. TrackingDetail."
                    },
                    "message": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "status_detail": {
                        "type": "string"
                    },
                    "datetime": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": "string"
                    },
                    "tracking_location": {
                        "$ref": "#/components/schemas/TrackingLocation"
                    }
                }
            },
            "TrackingLocation": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "description": "Object type, e.g. TrackingLocation."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "state": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "zip": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "DeleteShipmentResponse": {
                "type": "object",
                "required": [
                    "status",
                    "message"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "Always `success` for a 200 response.",
                        "examples": [
                            "success"
                        ]
                    },
                    "message": {
                        "type": "string",
                        "description": "Response message.",
                        "examples": [
                            "Shipment deleted successfully"
                        ]
                    }
                }
            },
            "ShippingProvidersResponse": {
                "type": "object",
                "required": [
                    "success",
                    "data"
                ],
                "properties": {
                    "success": {
                        "type": "boolean",
                        "description": "Whether the API response succeeded."
                    },
                    "data": {
                        "type": "array",
                        "description": "Supported shipping providers.",
                        "items": {
                            "$ref": "#/components/schemas/ShippingProvider"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    }
                }
            },
            "ShippingProvider": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": "string",
                        "description": "Human-readable carrier name (e.g. Australia Post)."
                    },
                    "slug": {
                        "type": "string",
                        "description": "Unique provider code used as tracking_provider (e.g. australia-post)."
                    }
                }
            },
            "Meta": {
                "type": "object",
                "description": "Platform response metadata.",
                "properties": {
                    "code": {
                        "type": "integer",
                        "description": "Application-level status code. Not always the same as the HTTP status code."
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable message."
                    }
                }
            },
            "ErrorStatusMsg": {
                "type": "object",
                "description": "Endpoint error envelope that carries the detail in `status_msg`.",
                "required": [
                    "status",
                    "status_msg"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "const": "error",
                        "description": "Always `error` for this envelope."
                    },
                    "status_msg": {
                        "type": "string",
                        "description": "Machine- or human-readable error detail, depending on the endpoint."
                    },
                    "status_code": {
                        "type": [
                            "string",
                            "integer"
                        ],
                        "description": "Legacy field returned by a small number of endpoints. Do not depend on it."
                    }
                }
            },
            "ErrorMessage": {
                "type": "object",
                "description": "Endpoint error envelope that carries the detail in `message`.",
                "required": [
                    "status",
                    "message"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "const": "error",
                        "description": "Always `error` for this envelope."
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable error message."
                    }
                }
            },
            "SuccessMessage": {
                "type": "object",
                "description": "Envelope used when the outcome is reported as a success even though the HTTP status is not 2xx (currently only `Tracker already deleted`).",
                "required": [
                    "status",
                    "message"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "const": "success"
                    },
                    "message": {
                        "type": "string"
                    }
                }
            },
            "PlatformError": {
                "type": "object",
                "description": "Platform-level error envelope, used for unknown routes.",
                "required": [
                    "success",
                    "data",
                    "meta"
                ],
                "properties": {
                    "success": {
                        "type": "boolean",
                        "const": false,
                        "description": "Always `false` for this envelope."
                    },
                    "data": {
                        "type": "array",
                        "description": "Always an empty array for this envelope.",
                        "items": {}
                    },
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    }
                }
            }
        },
        "headers": {
            "Link": {
                "description": "Always sent. Carries a `rel=\"deprecation\"` link to the API's deprecation policy. Per RFC 9745 §3.1, a `rel=\"deprecation\"` link without an accompanying `Deprecation` field means the resource is **not** deprecated and this is simply where the policy is published.",
                "required": true,
                "schema": {
                    "type": "string"
                },
                "example": "<https://docs.trackship.com/docs/tracking-api/api-reference/versioning-deprecation-policy/>; rel=\"deprecation\"; type=\"text/html\""
            },
            "Deprecation": {
                "description": "Sent only when the operation is deprecated (RFC 9745). An RFC 9651 Date: \"@\" followed by the Unix time, in seconds, at which the operation was or will be deprecated. **No operation is deprecated today and this header is never sent.** See https://docs.trackship.com/docs/tracking-api/api-reference/versioning-deprecation-policy/",
                "required": false,
                "schema": {
                    "type": "string",
                    "pattern": "^@-?[0-9]{1,15}$"
                },
                "example": "@1688169599"
            },
            "Sunset": {
                "description": "Sent only when a deprecated operation has a planned removal date (RFC 8594). An HTTP-date after which the operation may stop responding; never earlier than the Deprecation date. **No operation is deprecated today and this header is never sent.** See https://docs.trackship.com/docs/tracking-api/api-reference/versioning-deprecation-policy/",
                "required": false,
                "schema": {
                    "type": "string"
                },
                "example": "Sun, 30 Jun 2024 23:59:59 GMT"
            }
        }
    }
}
