{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cybership/json-schema/cybership-apipublic-expanded-package-schema.json",
  "title": "APIPublicExpandedPackage",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cybership-openapi.json#/components/schemas/APIPublicExpandedPackage",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier"
    },
    "idempotency_key": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stable package identity used to reconcile unsaved packing state"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the package was created"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the package was last updated"
    },
    "name": {
      "type": "string",
      "description": "Package name"
    },
    "manifested_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the package was manifested"
    },
    "shipped_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the package was shipped"
    },
    "status": {
      "$ref": "#/$defs/APIPackageStatus",
      "description": "Package status"
    },
    "packing_slip_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Packing slip URL"
    },
    "measurement_unit": {
      "$ref": "#/$defs/APIMeasurementUnit",
      "description": "Measurement unit"
    },
    "type": {
      "$ref": "#/$defs/APIPackageType",
      "description": "Type"
    },
    "length": {
      "type": "number",
      "format": "double",
      "description": "Length"
    },
    "width": {
      "type": "number",
      "format": "double",
      "description": "Width"
    },
    "height": {
      "type": "number",
      "format": "double",
      "description": "Height"
    },
    "weight_unit": {
      "$ref": "#/$defs/APIWeightUnit",
      "description": "Weight unit"
    },
    "weight": {
      "type": "number",
      "format": "double",
      "description": "Weight"
    },
    "requires_dry_ice": {
      "type": "boolean",
      "description": "Whether this package requires or contains dry ice that must be declared to the carrier"
    },
    "dry_ice_weight": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "Actual amount of dry ice added, in the same unit as `weight`"
    },
    "total_customs_value": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "Total customs value"
    },
    "config": {
      "description": "Package-level shipping config overrides using PackageConfigSchema",
      "oneOf": [
        {
          "$ref": "#/$defs/APIPackageConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "rate_error_data": {
      "description": "Structured rate error data",
      "oneOf": [
        {
          "$ref": "#/$defs/APILabelPurchaseError"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Error message"
    },
    "carrier_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Carrier ID"
    },
    "service_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Service ID"
    },
    "provider_rate_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Exact selected provider rate, when available."
    },
    "picking_session_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Picking session ID"
    },
    "fulfillment_order_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Fulfillment order ID - when present, creates `FULFILLMENT_ORDER` package with automatic address fallbacks"
    },
    "work_order_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Work order ID - when present (without fulfillment_order_id), creates `WORK_ORDER` package"
    },
    "return_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Return ID - when present, creates `RETURN` package"
    },
    "carton_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Carton ID"
    },
    "shipping_label_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Shipping label ID"
    },
    "scan_form_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Scan form ID"
    },
    "carrier_integration_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Carrier integration ID"
    },
    "carrier_integration_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Carrier integration name"
    },
    "carrier_integration_type": {
      "description": "Carrier integration type",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "GENERIC",
        "EASYPOST",
        "USPS",
        "UPS",
        "BUKUSHIP",
        "TIKTOK_SHIPPING",
        "SHIPTRAC"
      ]
    },
    "carton_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Carton name"
    },
    "fulfiller_team_id": {
      "type": "string",
      "description": "Fulfiller team ID"
    },
    "fulfiller_team_name": {
      "type": "string",
      "description": "Fulfiller team name"
    },
    "bulk_ship_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bulk ship ID"
    },
    "bulk_ship_template_package_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bulk ship template package ID"
    },
    "warehouse_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Warehouse ID"
    },
    "warehouse_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Warehouse name"
    },
    "merchant_team_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Merchant team ID"
    },
    "merchant_team_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Merchant team name"
    },
    "from_address_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address name"
    },
    "from_address_company": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address company"
    },
    "from_address_address1": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address street 1"
    },
    "from_address_address2": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address street 2"
    },
    "from_address_city": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address city"
    },
    "from_address_state": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address state (e.g., \"CA\" for California)"
    },
    "from_address_country": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address country (ISO 3166-1 alpha-2 code)"
    },
    "from_address_zip": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address ZIP"
    },
    "from_address_phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address phone"
    },
    "from_address_email": {
      "type": [
        "string",
        "null"
      ],
      "description": "From address email"
    },
    "to_address_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address name"
    },
    "to_address_company": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address company"
    },
    "to_address_address1": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address street 1"
    },
    "to_address_address2": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address street 2"
    },
    "to_address_city": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address city"
    },
    "to_address_state": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address state (e.g., \"CA\" for California)"
    },
    "to_address_country": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address country (ISO 3166-1 alpha-2 code)"
    },
    "to_address_zip": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address ZIP"
    },
    "to_address_phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address phone"
    },
    "to_address_email": {
      "type": [
        "string",
        "null"
      ],
      "description": "To address email"
    },
    "rate_shop_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rate shop ID for dynamic rate selection"
    },
    "rate_shop_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Denormalized rate shop name for display"
    },
    "deliver_by": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Target date by which the shipment should be delivered (denormalized from FulfillmentOrder)"
    },
    "line_item_hash": {
      "type": "string",
      "description": "Hash of line items for deduplication/matching"
    },
    "total_item_quantity": {
      "type": "number",
      "format": "double",
      "description": "Total quantity of all line items"
    },
    "unique_line_item_count": {
      "type": "number",
      "format": "double",
      "description": "Number of unique line items"
    },
    "formatted_service": {
      "type": [
        "string",
        "null"
      ],
      "description": "Formatted service display string for the requested carrier/service (e.g., \"USPS / Priority Mail\"), or null if no service is set"
    },
    "shipping_label_tracking_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tracking code from shipping label"
    },
    "shipping_label_tracking_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tracking URL from shipping label"
    },
    "shipping_label_formatted_service": {
      "type": [
        "string",
        "null"
      ],
      "description": "Formatted service display string from shipping label (what was actually bought)"
    },
    "shipping_label_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Label URL from shipping label"
    },
    "shipment_status": {
      "description": "Shipment status from shipping label",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LABEL_PRINTED",
        "LABEL_PURCHASED",
        "ATTEMPTED_DELIVERY",
        "PRE_TRANSIT",
        "IN_TRANSIT",
        "OUT_FOR_DELIVERY",
        "DELIVERED",
        "AVAILABLE_FOR_PICKUP",
        "RETURN_TO_SENDER",
        "FAILURE",
        "CANCELLED",
        "ERROR",
        "UNKNOWN",
        "DELAYED"
      ]
    },
    "package_line_items": {
      "items": {
        "$ref": "#/$defs/APIBasePackageLineItem"
      },
      "type": "array",
      "description": "Package line items with product information"
    },
    "fulfillment": {
      "description": "Fulfillment",
      "oneOf": [
        {
          "$ref": "#/$defs/APIBaseFulfillment"
        },
        {
          "type": "null"
        }
      ]
    },
    "shipping_label": {
      "description": "Shipping label",
      "oneOf": [
        {
          "$ref": "#/$defs/APIBaseShippingLabel"
        },
        {
          "type": "null"
        }
      ]
    },
    "package_preset_id": {
      "type": [
        "string",
        "null"
      ],
      "deprecated": true
    },
    "package_preset_name": {
      "type": [
        "string",
        "null"
      ],
      "deprecated": true
    }
  },
  "required": [
    "id",
    "idempotency_key",
    "created_at",
    "updated_at",
    "name",
    "manifested_at",
    "shipped_at",
    "status",
    "packing_slip_url",
    "measurement_unit",
    "type",
    "length",
    "width",
    "height",
    "weight_unit",
    "weight",
    "requires_dry_ice",
    "dry_ice_weight",
    "total_customs_value",
    "config",
    "rate_error_data",
    "error_message",
    "carrier_id",
    "service_id",
    "picking_session_id",
    "fulfillment_order_id",
    "work_order_id",
    "return_id",
    "carton_id",
    "shipping_label_id",
    "scan_form_id",
    "carrier_integration_id",
    "carrier_integration_name",
    "carrier_integration_type",
    "carton_name",
    "fulfiller_team_id",
    "fulfiller_team_name",
    "bulk_ship_id",
    "bulk_ship_template_package_id",
    "warehouse_id",
    "warehouse_name",
    "merchant_team_id",
    "merchant_team_name",
    "from_address_name",
    "from_address_company",
    "from_address_address1",
    "from_address_address2",
    "from_address_city",
    "from_address_state",
    "from_address_country",
    "from_address_zip",
    "from_address_phone",
    "from_address_email",
    "to_address_name",
    "to_address_company",
    "to_address_address1",
    "to_address_address2",
    "to_address_city",
    "to_address_state",
    "to_address_country",
    "to_address_zip",
    "to_address_phone",
    "to_address_email",
    "rate_shop_id",
    "rate_shop_name",
    "deliver_by",
    "line_item_hash",
    "total_item_quantity",
    "unique_line_item_count",
    "formatted_service",
    "shipping_label_tracking_code",
    "shipping_label_tracking_url",
    "shipping_label_formatted_service",
    "shipping_label_url",
    "shipment_status",
    "package_line_items",
    "fulfillment",
    "shipping_label",
    "package_preset_id",
    "package_preset_name"
  ],
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "APIAvailableLabelRate": {
      "properties": {
        "currency": {
          "type": "string",
          "description": "Currency code for the quoted amount"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "description": "Quoted amount for the rate"
        },
        "service_name": {
          "type": "string",
          "description": "Service display name"
        },
        "carrier_name": {
          "type": "string",
          "description": "Carrier display name"
        },
        "service_id": {
          "type": "string",
          "description": "Normalized service identifier"
        },
        "carrier_id": {
          "type": "string",
          "description": "Normalized carrier identifier"
        },
        "carrier_integration_type": {
          "$ref": "#/$defs/APICarrierType",
          "description": "Carrier integration type"
        },
        "carrier_integration_id": {
          "type": "string",
          "description": "Carrier integration identifier"
        },
        "estimated_days": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "delivery_date_guaranteed": {
          "type": "boolean"
        },
        "delivery_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "carrier_account_label": {
          "type": "string"
        },
        "provider_carrier_account_id": {
          "type": "string"
        },
        "carrier_account_id": {
          "type": "string"
        },
        "provider_rate_id": {
          "type": "string"
        }
      },
      "required": [
        "currency",
        "amount",
        "service_name",
        "carrier_name",
        "service_id",
        "carrier_id",
        "carrier_integration_type",
        "carrier_integration_id"
      ],
      "type": "object"
    },
    "APIBaseFulfillment": {
      "properties": {
        "packed_by_user_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denormalized: Name of the user who packed the order (null for non-pick-and-pack)"
        },
        "packed_by_user_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denormalized: ID of the user who packed the order (null for non-pick-and-pack)"
        },
        "picked_by_user_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denormalized: Name of the user who picked the order (null for non-pick-and-pack)"
        },
        "picked_by_user_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denormalized: ID of the user who picked the order (null for non-pick-and-pack)"
        },
        "has_packshots": {
          "type": "boolean",
          "description": "Whether the fulfillment's package has packshot photos"
        },
        "line_item_image_urls": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Array of up to 3 line item image URLs for thumbnail preview (denormalized for performance)"
        },
        "unique_core_item_count": {
          "type": "number",
          "format": "double",
          "description": "Unique count of core line items by product/sku/name (denormalized for list performance)"
        },
        "total_core_item_quantity": {
          "type": "number",
          "format": "double",
          "description": "Total quantity of core line items (denormalized for list performance)"
        },
        "carton_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carton name (denormalized)"
        },
        "carton_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carton ID (denormalized)"
        },
        "bulk_ship_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bulk ship ID (denormalized)"
        },
        "picking_session_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Picking session ID (denormalized)"
        },
        "package_type": {
          "description": "Package type (denormalized)",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "FULFILLMENT_ORDER",
            "WORK_ORDER",
            "STANDALONE",
            "RETURN"
          ]
        },
        "shipping_label_label_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Shipping label label URL (denormalized)"
        },
        "shipping_label_tracking_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Shipping label tracking URL (denormalized)"
        },
        "fulfiller_team_name": {
          "type": "string",
          "description": "Fulfiller team name"
        },
        "fulfiller_team_id": {
          "type": "string",
          "description": "Fulfiller team ID"
        },
        "merchant_team_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Merchant team name"
        },
        "merchant_team_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Merchant team ID"
        },
        "package_id": {
          "type": "string",
          "description": "Package ID"
        },
        "fulfillment_order_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Fulfillment order ID"
        },
        "warehouse_name": {
          "type": "string",
          "description": "Warehouse name"
        },
        "warehouse_id": {
          "type": "string",
          "description": "Warehouse ID"
        },
        "order_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Order ID this fulfillment belongs to"
        },
        "shop_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Shop name"
        },
        "shop_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Shop ID"
        },
        "shipping_label_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Shipping label ID for the fulfillment"
        },
        "formatted_service": {
          "type": [
            "string",
            "null"
          ],
          "description": "Formatted service display string (e.g., \"USPS / Priority Mail\")"
        },
        "tracking_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Tracking code for the fulfillment"
        },
        "type": {
          "$ref": "#/$defs/APIFulfillmentType",
          "description": "Fulfillment type"
        },
        "shipment_status": {
          "$ref": "#/$defs/APIFulfillmentShipmentStatus",
          "description": "Shipment status"
        },
        "status": {
          "$ref": "#/$defs/APIFulfillmentStatus",
          "description": "Fulfillment status"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Formatted name"
        },
        "remote_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Remote ID from external system"
        },
        "synced_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When it was synced"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the fulfillment was last updated"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the fulfillment was created"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier"
        }
      },
      "required": [
        "packed_by_user_name",
        "packed_by_user_id",
        "picked_by_user_name",
        "picked_by_user_id",
        "has_packshots",
        "line_item_image_urls",
        "unique_core_item_count",
        "total_core_item_quantity",
        "carton_name",
        "carton_id",
        "bulk_ship_id",
        "picking_session_id",
        "package_type",
        "shipping_label_label_url",
        "shipping_label_tracking_url",
        "fulfiller_team_name",
        "fulfiller_team_id",
        "merchant_team_name",
        "merchant_team_id",
        "package_id",
        "fulfillment_order_id",
        "warehouse_name",
        "warehouse_id",
        "order_id",
        "shop_name",
        "shop_id",
        "shipping_label_id",
        "formatted_service",
        "tracking_code",
        "type",
        "shipment_status",
        "status",
        "name",
        "remote_id",
        "synced_at",
        "updated_at",
        "created_at",
        "id"
      ],
      "type": "object"
    },
    "APIBasePackageLineItem": {
      "properties": {
        "uom_label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denormalized from UoM profile — human-readable label (e.g. Case, Pack)"
        },
        "uom_multiplier_to_eaches": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Denormalized from UoM profile — how many eaches per UoM unit"
        },
        "uom_profile_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "UoM packaging level that was packed (null = eaches / legacy)"
        },
        "work_order_line_item_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Work order line item ID (for work-order packages)"
        },
        "core_fulfillment_order_line_item_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Core fulfillment order line item ID (for fulfillment order packages)"
        },
        "printed_commodity_identifier": {
          "type": [
            "string",
            "null"
          ],
          "description": "International commodity code (fallback to product if null)"
        },
        "eccn": {
          "type": [
            "string",
            "null"
          ],
          "description": "Export Control Classification Number (fallback to product if null)"
        },
        "manufacturer": {
          "type": [
            "string",
            "null"
          ],
          "description": "Item manufacturer (fallback to product if null)"
        },
        "hs_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Harmonized Tariff Schedule code (fallback to product if null)"
        },
        "country_of_origin": {
          "type": [
            "string",
            "null"
          ],
          "description": "Country of origin for customs (fallback to product if null)"
        },
        "customs_value_currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "Customs value currency (defaults to USD)"
        },
        "customs_value": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Customs value for international shipments (fallback to product if null)"
        },
        "customs_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Customs description for international shipments (fallback to product if null)"
        },
        "weight_unit": {
          "description": "Weight unit for standalone packages (fallback to product weight unit if null)",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "G",
            "KG",
            "OZ",
            "LB"
          ]
        },
        "weight": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Weight for standalone packages (fallback to product weight if null)"
        },
        "expiration_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Expiration date for the product"
        },
        "lot_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Lot code for the product"
        },
        "package_id": {
          "type": "string",
          "description": "Package ID"
        },
        "product_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Product ID"
        },
        "quantity": {
          "type": "number",
          "format": "double",
          "description": "Quantity in the package"
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Product image URL"
        },
        "sku": {
          "type": [
            "string",
            "null"
          ],
          "description": "Product SKU"
        },
        "name": {
          "type": "string",
          "description": "Product name"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the line item was last updated"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the line item was created"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier"
        }
      },
      "required": [
        "uom_label",
        "uom_multiplier_to_eaches",
        "uom_profile_id",
        "work_order_line_item_id",
        "core_fulfillment_order_line_item_id",
        "printed_commodity_identifier",
        "eccn",
        "manufacturer",
        "hs_code",
        "country_of_origin",
        "customs_value_currency",
        "customs_value",
        "customs_description",
        "weight_unit",
        "weight",
        "expiration_date",
        "lot_code",
        "package_id",
        "product_id",
        "quantity",
        "image_url",
        "sku",
        "name",
        "updated_at",
        "created_at",
        "id"
      ],
      "type": "object"
    },
    "APIBaseShippingLabel": {
      "properties": {
        "formatted_service": {
          "type": [
            "string",
            "null"
          ],
          "description": "Formatted service display string"
        },
        "tracking_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Tracking URL"
        },
        "carrier_correction": {
          "description": "Latest confirmed carrier correction snapshot, when the label has been corrected",
          "oneOf": [
            {
              "$ref": "#/$defs/APIShippingLabelCarrierCorrection"
            },
            {
              "type": "null"
            }
          ]
        },
        "gaylord_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Gaylord ID"
        },
        "carrier_account_label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Safe account name recorded at purchase; null when not recorded"
        },
        "carrier_account_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carrier account ID"
        },
        "merchant_team_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Merchant team name"
        },
        "merchant_team_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Merchant team ID"
        },
        "fulfiller_team_name": {
          "type": "string",
          "description": "Fulfiller team name"
        },
        "fulfiller_team_id": {
          "type": "string",
          "description": "Fulfiller team ID"
        },
        "carrier_integration_type": {
          "description": "Carrier integration type",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "GENERIC",
            "EASYPOST",
            "USPS",
            "UPS",
            "BUKUSHIP",
            "TIKTOK_SHIPPING",
            "SHIPTRAC"
          ]
        },
        "carrier_integration_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carrier integration name"
        },
        "carrier_integration_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carrier integration ID"
        },
        "shipment_status": {
          "$ref": "#/$defs/APIShippingLabelShipmentStatus",
          "description": "Shipment status"
        },
        "refund_status": {
          "description": "Refund status",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "SUBMITTED",
            "REJECTED",
            "REFUNDED"
          ]
        },
        "scan_status": {
          "$ref": "#/$defs/APIShippingLabelScanStatus",
          "description": "Scan status"
        },
        "label_with_packing_slip_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Label with packing slip URL"
        },
        "original_label_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Original label URL"
        },
        "label_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Label URL"
        },
        "tracking_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Tracking code"
        },
        "zone": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Carrier zone"
        },
        "delivery_date_guaranteed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Delivery date guaranteed"
        },
        "delivery_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Delivery date"
        },
        "delivery_days": {
          "type": [
            "string",
            "null"
          ],
          "description": "Delivery days"
        },
        "to_address_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address name"
        },
        "to_address_company": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address company"
        },
        "to_address_phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address phone"
        },
        "to_address_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address country (ISO 3166-1 alpha-2 code)"
        },
        "to_address_zip": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address zip"
        },
        "to_address_state": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address state (e.g., \"CA\" for California)"
        },
        "to_address_city": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address city"
        },
        "to_address_street2": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address street 2"
        },
        "to_address_street1": {
          "type": [
            "string",
            "null"
          ],
          "description": "To address street 1"
        },
        "from_address_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address name"
        },
        "from_address_company": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address company"
        },
        "from_address_phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address phone"
        },
        "from_address_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address country (ISO 3166-1 alpha-2 code)"
        },
        "from_address_zip": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address zip"
        },
        "from_address_state": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address state (e.g., \"CA\" for California)"
        },
        "from_address_city": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address city"
        },
        "from_address_street2": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address street 2"
        },
        "from_address_street1": {
          "type": [
            "string",
            "null"
          ],
          "description": "From address street 1"
        },
        "list_currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "List currency"
        },
        "list_rate": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "List rate"
        },
        "retail_currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "Retail currency"
        },
        "retail_price": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "description": "Retail price"
        },
        "currency": {
          "type": "string",
          "description": "Currency"
        },
        "price": {
          "type": "number",
          "format": "double",
          "description": "Price"
        },
        "carrier_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Carrier ID"
        },
        "service_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Service ID"
        },
        "remote_bukuship_shipment_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Remote Bukuship shipment ID"
        },
        "remote_easypost_tracker_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Remote EasyPost tracker ID"
        },
        "remote_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Remote ID"
        },
        "voided_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the label was voided"
        },
        "shipping_label_number": {
          "type": "string",
          "description": "Human-readable shipping label number"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the label was last updated"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the label was created"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier"
        },
        "rate_selection_details": {
          "description": "Recorded rate evaluation and selection details",
          "oneOf": [
            {
              "$ref": "#/$defs/APIShippingLabelRateSelectionDetails"
            },
            {
              "type": "null"
            }
          ]
        },
        "tracking_events": {
          "items": {
            "$ref": "#/$defs/APIBaseTrackingEvent"
          },
          "type": "array",
          "description": "Tracking events for this shipment"
        }
      },
      "required": [
        "formatted_service",
        "tracking_url",
        "carrier_correction",
        "gaylord_id",
        "carrier_account_label",
        "carrier_account_id",
        "merchant_team_name",
        "merchant_team_id",
        "fulfiller_team_name",
        "fulfiller_team_id",
        "carrier_integration_type",
        "carrier_integration_name",
        "carrier_integration_id",
        "shipment_status",
        "refund_status",
        "scan_status",
        "label_with_packing_slip_url",
        "original_label_url",
        "label_url",
        "tracking_code",
        "zone",
        "delivery_date_guaranteed",
        "delivery_date",
        "delivery_days",
        "to_address_name",
        "to_address_company",
        "to_address_phone",
        "to_address_country",
        "to_address_zip",
        "to_address_state",
        "to_address_city",
        "to_address_street2",
        "to_address_street1",
        "from_address_name",
        "from_address_company",
        "from_address_phone",
        "from_address_country",
        "from_address_zip",
        "from_address_state",
        "from_address_city",
        "from_address_street2",
        "from_address_street1",
        "list_currency",
        "list_rate",
        "retail_currency",
        "retail_price",
        "currency",
        "price",
        "carrier_id",
        "service_id",
        "remote_bukuship_shipment_id",
        "remote_easypost_tracker_id",
        "remote_id",
        "voided_at",
        "shipping_label_number",
        "updated_at",
        "created_at",
        "id",
        "rate_selection_details",
        "tracking_events"
      ],
      "type": "object"
    },
    "APIBaseTrackingEvent": {
      "properties": {
        "raw_data": {
          "description": "Raw data as JSON"
        },
        "location_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Location country"
        },
        "location_zip": {
          "type": [
            "string",
            "null"
          ],
          "description": "Location zip"
        },
        "location_state": {
          "type": [
            "string",
            "null"
          ],
          "description": "Location state"
        },
        "location_city": {
          "type": [
            "string",
            "null"
          ],
          "description": "Location city"
        },
        "event_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Event code"
        },
        "event_time": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Event time"
        },
        "status_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Event status description"
        },
        "status_category": {
          "type": [
            "string",
            "null"
          ],
          "description": "Event status category"
        },
        "status": {
          "description": "Event status",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "UNKNOWN",
            "PRE_TRANSIT",
            "IN_TRANSIT",
            "OUT_FOR_DELIVERY",
            "DELIVERED",
            "AVAILABLE_FOR_PICKUP",
            "RETURN_TO_SENDER",
            "FAILURE",
            "CANCELLED",
            "ERROR",
            "DELIVERY_EXCEPTION",
            "ATTEMPTED_DELIVERY"
          ]
        }
      },
      "required": [
        "raw_data",
        "location_country",
        "location_zip",
        "location_state",
        "location_city",
        "event_code",
        "event_time",
        "status_description",
        "status_category",
        "status"
      ],
      "type": "object"
    },
    "APICarrierCorrectionFormat": {
      "type": "string",
      "enum": [
        "UPS_INVOICE_SUMMARY_V1",
        "EASYPOST_ADJUSTMENTS_V1"
      ]
    },
    "APICarrierCorrectionProvider": {
      "type": "string",
      "enum": [
        "UPS",
        "EASYPOST"
      ]
    },
    "APICarrierType": {
      "type": "string",
      "enum": [
        "GENERIC",
        "EASYPOST",
        "USPS",
        "UPS",
        "BUKUSHIP",
        "TIKTOK_SHIPPING",
        "SHIPTRAC"
      ]
    },
    "APICurrency": {
      "type": "string",
      "enum": [
        "AED",
        "AFN",
        "ALL",
        "AMD",
        "ANG",
        "AOA",
        "ARS",
        "AUD",
        "AWG",
        "AZN",
        "BAM",
        "BBD",
        "BDT",
        "BGN",
        "BHD",
        "BIF",
        "BMD",
        "BND",
        "BOB",
        "BRL",
        "BSD",
        "BTN",
        "BWP",
        "BYN",
        "BZD",
        "CAD",
        "CDF",
        "CHF",
        "CLP",
        "CNY",
        "COP",
        "CRC",
        "CUP",
        "CVE",
        "CZK",
        "DJF",
        "DKK",
        "DOP",
        "DZD",
        "EGP",
        "ERN",
        "ETB",
        "EUR",
        "FJD",
        "FKP",
        "GBP",
        "GEL",
        "GHS",
        "GIP",
        "GMD",
        "GNF",
        "GTQ",
        "GYD",
        "HKD",
        "HNL",
        "HRK",
        "HTG",
        "HUF",
        "IDR",
        "ILS",
        "INR",
        "IQD",
        "IRR",
        "ISK",
        "JMD",
        "JOD",
        "JPY",
        "KES",
        "KGS",
        "KHR",
        "KMF",
        "KRW",
        "KWD",
        "KYD",
        "KZT",
        "LAK",
        "LBP",
        "LKR",
        "LRD",
        "LSL",
        "LYD",
        "MAD",
        "MDL",
        "MGA",
        "MKD",
        "MMK",
        "MNT",
        "MOP",
        "MRU",
        "MUR",
        "MVR",
        "MWK",
        "MXN",
        "MYR",
        "MZN",
        "NAD",
        "NGN",
        "NIO",
        "NOK",
        "NPR",
        "NZD",
        "OMR",
        "PAB",
        "PEN",
        "PGK",
        "PHP",
        "PKR",
        "PLN",
        "PYG",
        "QAR",
        "RON",
        "RSD",
        "RUB",
        "RWF",
        "SAR",
        "SBD",
        "SCR",
        "SDG",
        "SEK",
        "SGD",
        "SHP",
        "SLL",
        "SOS",
        "SRD",
        "SSP",
        "STN",
        "SVC",
        "SYP",
        "SZL",
        "THB",
        "TJS",
        "TMT",
        "TND",
        "TOP",
        "TRY",
        "TTD",
        "TWD",
        "TZS",
        "UAH",
        "UGX",
        "USD",
        "UYU",
        "UZS",
        "VES",
        "VND",
        "VUV",
        "WST",
        "XAF",
        "XCD",
        "XOF",
        "XPF",
        "YER",
        "ZAR",
        "ZMW",
        "ZWL"
      ]
    },
    "APIFixedAmountInsurancePolicy": {
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "fixed_amount"
          ],
          "nullable": false
        },
        "fixed_amount": {
          "type": "number",
          "format": "double"
        }
      },
      "required": [
        "mode",
        "fixed_amount"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIFixedServiceSelection": {
      "enum": [
        "EXACT_RATE",
        "CHEAPEST_MATCHING_SERVICE",
        "SERVICE"
      ],
      "type": "string"
    },
    "APIFulfillmentShipmentStatus": {
      "type": "string",
      "enum": [
        "LABEL_PRINTED",
        "LABEL_PURCHASED",
        "ATTEMPTED_DELIVERY",
        "PRE_TRANSIT",
        "IN_TRANSIT",
        "OUT_FOR_DELIVERY",
        "DELIVERED",
        "AVAILABLE_FOR_PICKUP",
        "RETURN_TO_SENDER",
        "FAILURE",
        "CANCELLED",
        "ERROR",
        "UNKNOWN",
        "DELAYED"
      ]
    },
    "APIFulfillmentStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "OPEN",
        "SUCCESS",
        "CANCELLED",
        "ERROR",
        "FAILURE"
      ]
    },
    "APIFulfillmentType": {
      "type": "string",
      "enum": [
        "PICK_PACK",
        "BULK_SHIP",
        "MANUAL",
        "API"
      ]
    },
    "APIInsurancePolicy": {
      "anyOf": [
        {
          "$ref": "#/$defs/APINoInsurancePolicy"
        },
        {
          "$ref": "#/$defs/APIFixedAmountInsurancePolicy"
        }
      ]
    },
    "APILabelPurchaseDetail": {
      "properties": {
        "carrier_type": {
          "$ref": "#/$defs/APICarrierType",
          "description": "Carrier integration type associated with the failure"
        },
        "message": {
          "type": "string",
          "description": "Carrier-specific failure message"
        }
      },
      "required": [
        "carrier_type",
        "message"
      ],
      "type": "object"
    },
    "APILabelPurchaseError": {
      "properties": {
        "detailed_errors": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/APILabelPurchaseDetail"
          },
          "description": "Carrier-specific failures collected while fetching or buying rates"
        },
        "available_rates": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/APIAvailableLabelRate"
          },
          "description": "Alternative rates that may still be available for purchase"
        },
        "message": {
          "type": "string",
          "description": "Human-readable label purchase failure message"
        }
      },
      "required": [
        "detailed_errors",
        "available_rates",
        "message"
      ],
      "type": "object"
    },
    "APIMeasurementUnit": {
      "type": "string",
      "enum": [
        "MM",
        "CM",
        "M",
        "IN",
        "FT"
      ]
    },
    "APINoInsurancePolicy": {
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "none"
          ],
          "nullable": false
        }
      },
      "required": [
        "mode"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIPackageConfig": {
      "description": "Public API package-level config response fields.",
      "properties": {
        "require_pack_shot": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "show_unfulfilled_items_on_packing_list": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "show_prices_on_packing_slip": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "incoterm": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "FAS",
            "FOB",
            "CFR",
            "CIF",
            "EXW",
            "FCA",
            "CPT",
            "CIP",
            "DAT",
            "DAP",
            "DDP"
          ]
        },
        "incoterm_location": {
          "type": [
            "string",
            "null"
          ]
        },
        "eel_pfc": {
          "type": [
            "string",
            "null"
          ]
        },
        "delivery_confirmation": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "NO_SIGNATURE",
            "SIGNATURE",
            "ADULT_SIGNATURE",
            "INDIRECT_SIGNATURE"
          ]
        },
        "saturday_delivery": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Request eligible Saturday delivery options; null inherits."
        },
        "insurance_policy": {
          "oneOf": [
            {
              "$ref": "#/$defs/APIInsurancePolicy"
            },
            {
              "type": "null"
            }
          ]
        },
        "customs_signer": {
          "type": [
            "string",
            "null"
          ]
        },
        "customs_signer_title": {
          "type": [
            "string",
            "null"
          ]
        },
        "customs_certify": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "non_delivery_option": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "ABANDON",
            "RETURN"
          ]
        },
        "restriction_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "NONE",
            "OTHER",
            "QUARANTINE",
            "SANITARY_PHYTOSANITARY_INSPECTION"
          ]
        },
        "restriction_comments": {
          "type": [
            "string",
            "null"
          ]
        },
        "contents_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "OTHER",
            "MERCHANDISE",
            "GIFT",
            "DOCUMENTS",
            "SAMPLE",
            "RETURNED_GOODS",
            "DANGEROUS_GOODS",
            "HUMANITARIAN_DONATION"
          ]
        },
        "contents_explanation": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_transaction_reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "SALE",
            "NON_SALE_TRANSFER",
            "REPAIR",
            "WARRANTY_REPLACEMENT",
            "TEMPORARY_EXPORT",
            "OTHER"
          ]
        },
        "declaration": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_payment_terms": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_transport_mode": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_port_of_entry": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_country_of_transshipment": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_package_marks": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_freight_amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "commercial_invoice_discount_amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "commercial_invoice_other_charge_amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "commercial_invoice_other_charge_description": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_importer_tax_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_importer_vat": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_importer_eori": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_importer_ioss": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_vat_statement": {
          "type": [
            "string",
            "null"
          ]
        },
        "commercial_invoice_export_license_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "destination_control_statement_required": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "APIPackageStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "PICKED",
        "PACKED",
        "FULFILLED",
        "CANCELLED",
        "CLOSED"
      ]
    },
    "APIPackageType": {
      "type": "string",
      "enum": [
        "FULFILLMENT_ORDER",
        "WORK_ORDER",
        "STANDALONE",
        "RETURN"
      ]
    },
    "APIRateFetchDecision": {
      "enum": [
        "FETCHED",
        "SKIPPED"
      ],
      "type": "string"
    },
    "APIRateFetchDecisionReason": {
      "enum": [
        "ELIGIBLE_CONFIGURED_SERVICES",
        "UNRESTRICTED_FETCH",
        "SHIPMENT_TYPE_NOT_APPLICABLE",
        "PACKAGE_POLICY_EXCLUDED",
        "INTEGRATION_UNAVAILABLE",
        "INTEGRATION_DISABLED",
        "NO_ENABLED_CONFIGURED_SERVICES"
      ],
      "type": "string"
    },
    "APIRateFetchServiceLevelDecisionReason": {
      "enum": [
        "ELIGIBLE_CONFIGURED_SERVICE",
        "SHIPMENT_TYPE_NOT_APPLICABLE",
        "PACKAGE_POLICY_EXCLUDED",
        "INTEGRATION_UNAVAILABLE",
        "INTEGRATION_DISABLED",
        "CARRIER_DISABLED",
        "SERVICE_DISABLED"
      ],
      "type": "string"
    },
    "APIRateFetchShipmentType": {
      "enum": [
        "DOMESTIC",
        "INTERNATIONAL"
      ],
      "type": "string"
    },
    "APIRateSelectionMode": {
      "enum": [
        "RATE_SHOP",
        "CHEAPEST_FALLBACK",
        "FIXED_SERVICE"
      ],
      "type": "string"
    },
    "APIRateSelectionStepKey": {
      "enum": [
        "FETCHED_RATES",
        "FILTERED_TO_CONFIGURED_SERVICES",
        "FILTERED_TO_DELIVERY_REQUIREMENTS",
        "MATCHED_REQUESTED_FILTERS",
        "APPLIED_PREFERENCE_RULE",
        "USED_PRESELECTED_SERVICE",
        "SELECTED_RATE"
      ],
      "type": "string"
    },
    "APIShippingLabelCarrierCorrection": {
      "properties": {
        "version": {
          "type": "number",
          "enum": [
            1
          ],
          "nullable": false
        },
        "source_import": {
          "properties": {
            "filename": {
              "type": "string"
            },
            "import_id": {
              "type": "string"
            }
          },
          "required": [
            "filename",
            "import_id"
          ],
          "type": "object"
        },
        "provider": {
          "$ref": "#/$defs/APICarrierCorrectionProvider"
        },
        "format": {
          "$ref": "#/$defs/APICarrierCorrectionFormat"
        },
        "carrier_invoice_number": {
          "type": "string"
        },
        "carrier_invoice_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "transaction_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "confirmed_at": {
          "type": "string"
        },
        "tracking_number": {
          "type": "string"
        },
        "correction_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "correction_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "carrier_service_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "published_amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "incentive_amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "original_carrier_cost": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "carrier_adjustment_amount": {
          "type": "number",
          "format": "double"
        },
        "corrected_carrier_cost": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "currency": {
          "$ref": "#/$defs/APICurrency"
        }
      },
      "required": [
        "version",
        "source_import",
        "provider",
        "format",
        "carrier_invoice_number",
        "carrier_invoice_date",
        "transaction_date",
        "confirmed_at",
        "tracking_number",
        "correction_type",
        "correction_reason",
        "carrier_service_code",
        "published_amount",
        "incentive_amount",
        "original_carrier_cost",
        "carrier_adjustment_amount",
        "corrected_carrier_cost",
        "currency"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelConfiguredService": {
      "properties": {
        "carrier_integration_id": {
          "type": "string"
        },
        "carrier_integration_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "carrier_integration_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "GENERIC",
            "EASYPOST",
            "USPS",
            "UPS",
            "BUKUSHIP",
            "TIKTOK_SHIPPING",
            "SHIPTRAC"
          ]
        },
        "carrier_id": {
          "type": "string"
        },
        "service_id": {
          "type": "string"
        },
        "provider_rate_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "label": {
          "type": "string"
        }
      },
      "required": [
        "carrier_integration_id",
        "carrier_integration_name",
        "carrier_integration_type",
        "carrier_id",
        "service_id",
        "label"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelConfiguredServiceLevels": {
      "properties": {
        "domestic": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelConfiguredService"
          },
          "type": "array"
        },
        "international": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelConfiguredService"
          },
          "type": "array"
        }
      },
      "required": [
        "domestic",
        "international"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelEvaluatedRate": {
      "properties": {
        "provider_rate_id": {
          "type": "string"
        },
        "carrier_account_id": {
          "type": "string"
        },
        "carrier_account_label": {
          "type": "string"
        },
        "provider_carrier_account_id": {
          "type": "string"
        },
        "delivery_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "delivery_date_guaranteed": {
          "type": "boolean"
        },
        "currency": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "carrier_integration_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "carrier_integration_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "GENERIC",
            "EASYPOST",
            "USPS",
            "UPS",
            "BUKUSHIP",
            "TIKTOK_SHIPPING",
            "SHIPTRAC"
          ]
        },
        "carrier_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "service_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "zone": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "estimated_days": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "eligible": {
          "type": "boolean"
        },
        "selected": {
          "type": "boolean"
        },
        "reasons": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "label",
        "carrier_integration_id",
        "carrier_integration_type",
        "carrier_id",
        "service_id",
        "amount",
        "zone",
        "estimated_days",
        "eligible",
        "selected",
        "reasons"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelIntegrationRateSummary": {
      "properties": {
        "carrier_integration_id": {
          "type": "string"
        },
        "carrier_integration_name": {
          "type": "string"
        },
        "carrier_integration_type": {
          "$ref": "#/$defs/APICarrierType"
        },
        "available_rate_count": {
          "type": "number",
          "format": "double"
        }
      },
      "required": [
        "carrier_integration_id",
        "carrier_integration_name",
        "carrier_integration_type",
        "available_rate_count"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelRateFetchDecision": {
      "properties": {
        "carrier_integration_id": {
          "type": "string"
        },
        "carrier_integration_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "carrier_integration_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "GENERIC",
            "EASYPOST",
            "USPS",
            "UPS",
            "BUKUSHIP",
            "TIKTOK_SHIPPING",
            "SHIPTRAC"
          ]
        },
        "decision": {
          "$ref": "#/$defs/APIRateFetchDecision"
        },
        "reason": {
          "$ref": "#/$defs/APIRateFetchDecisionReason"
        },
        "provider_called": {
          "type": "boolean"
        },
        "returned_rate_count": {
          "type": "number",
          "format": "double"
        },
        "retained_rate_count": {
          "type": "number",
          "format": "double"
        },
        "service_levels": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelRateFetchServiceLevelDecision"
          },
          "type": "array"
        }
      },
      "required": [
        "carrier_integration_id",
        "carrier_integration_name",
        "carrier_integration_type",
        "decision",
        "reason",
        "provider_called",
        "returned_rate_count",
        "retained_rate_count",
        "service_levels"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelRateFetchIssue": {
      "properties": {
        "carrier_integration_id": {
          "type": "string"
        },
        "carrier_integration_name": {
          "type": "string"
        },
        "carrier_integration_type": {
          "$ref": "#/$defs/APICarrierType"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "carrier_integration_id",
        "carrier_integration_name",
        "carrier_integration_type",
        "message"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelRateFetchServiceLevelDecision": {
      "properties": {
        "carrier_id": {
          "type": "string"
        },
        "service_id": {
          "type": "string"
        },
        "shipment_type": {
          "$ref": "#/$defs/APIRateFetchShipmentType"
        },
        "decision": {
          "$ref": "#/$defs/APIRateFetchDecision"
        },
        "reason": {
          "$ref": "#/$defs/APIRateFetchServiceLevelDecisionReason"
        }
      },
      "required": [
        "carrier_id",
        "service_id",
        "shipment_type",
        "decision",
        "reason"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelRateSelectionDetails": {
      "properties": {
        "version": {
          "type": "number",
          "enum": [
            1
          ],
          "nullable": false
        },
        "mode": {
          "$ref": "#/$defs/APIRateSelectionMode"
        },
        "fixed_service_selection": {
          "$ref": "#/$defs/APIFixedServiceSelection"
        },
        "summary": {
          "type": "string"
        },
        "selection_timestamp": {
          "type": [
            "string",
            "null"
          ]
        },
        "selected_because": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "CHEAPEST_ELIGIBLE",
            "PREFERRED_WITHIN_THRESHOLD",
            "CHEAPEST_MATCHING_FILTERS",
            "CHEAPEST_AVAILABLE",
            "PRESELECTED_SERVICE"
          ]
        },
        "rate_shop_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "rate_shop_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "requested_rate_label": {
          "type": [
            "string",
            "null"
          ]
        },
        "deliver_by_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "deliver_by_business_days_used": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "transit_time_restriction": {
          "type": [
            "string",
            "null"
          ]
        },
        "fallback_transit_time": {
          "type": [
            "string",
            "null"
          ]
        },
        "service_preference_enabled": {
          "type": "boolean"
        },
        "preferred_service_label": {
          "type": [
            "string",
            "null"
          ]
        },
        "preference_threshold_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "CURRENCY",
            "PERCENTAGE"
          ]
        },
        "preference_threshold": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "zone": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "selected_rate": {
          "oneOf": [
            {
              "$ref": "#/$defs/APIShippingLabelEvaluatedRate"
            },
            {
              "type": "null"
            }
          ]
        },
        "cheapest_eligible_rate": {
          "oneOf": [
            {
              "$ref": "#/$defs/APIShippingLabelEvaluatedRate"
            },
            {
              "type": "null"
            }
          ]
        },
        "preference_delta": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "eligible_rate_count": {
          "type": "number",
          "format": "double"
        },
        "excluded_rate_count": {
          "type": "number",
          "format": "double"
        },
        "evaluated_rates": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelEvaluatedRate"
          },
          "type": "array"
        },
        "selection_steps": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelRateSelectionStep"
          },
          "type": "array"
        },
        "configured_service_levels": {
          "oneOf": [
            {
              "$ref": "#/$defs/APIShippingLabelConfiguredServiceLevels"
            },
            {
              "type": "null"
            }
          ]
        },
        "available_rate_count_by_integration": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelIntegrationRateSummary"
          },
          "type": "array"
        },
        "rate_fetch_errors": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelRateFetchIssue"
          },
          "type": "array"
        },
        "rate_fetch_decisions": {
          "items": {
            "$ref": "#/$defs/APIShippingLabelRateFetchDecision"
          },
          "type": "array"
        },
        "trace_ref": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "version",
        "mode",
        "summary",
        "selection_timestamp",
        "selected_because",
        "rate_shop_id",
        "rate_shop_name",
        "requested_rate_label",
        "deliver_by_date",
        "deliver_by_business_days_used",
        "transit_time_restriction",
        "fallback_transit_time",
        "service_preference_enabled",
        "preferred_service_label",
        "preference_threshold_type",
        "preference_threshold",
        "zone",
        "selected_rate",
        "cheapest_eligible_rate",
        "preference_delta",
        "evaluated_rates",
        "selection_steps",
        "configured_service_levels",
        "available_rate_count_by_integration",
        "rate_fetch_errors",
        "rate_fetch_decisions",
        "trace_ref"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelRateSelectionStep": {
      "properties": {
        "key": {
          "$ref": "#/$defs/APIRateSelectionStepKey"
        },
        "detail": {
          "type": "string"
        }
      },
      "required": [
        "key",
        "detail"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "APIShippingLabelScanStatus": {
      "type": "string",
      "enum": [
        "SCANNED",
        "PENDING"
      ]
    },
    "APIShippingLabelShipmentStatus": {
      "type": "string",
      "enum": [
        "LABEL_PRINTED",
        "LABEL_PURCHASED",
        "ATTEMPTED_DELIVERY",
        "PRE_TRANSIT",
        "IN_TRANSIT",
        "OUT_FOR_DELIVERY",
        "DELIVERED",
        "AVAILABLE_FOR_PICKUP",
        "RETURN_TO_SENDER",
        "FAILURE",
        "CANCELLED",
        "ERROR",
        "UNKNOWN",
        "DELAYED"
      ]
    },
    "APIWeightUnit": {
      "type": "string",
      "enum": [
        "G",
        "KG",
        "OZ",
        "LB"
      ]
    }
  }
}