{
  "openapi": "3.1.0",
  "info": {
    "title": "Dimensional Weight DIM Shipping Calculator API",
    "description": "Computes dimensional (volumetric) and billable weight for a parcel using carrier-specific DIM rules. Pre-launch design; endpoints are not live yet.",
    "version": "0.1.0",
    "x-planned-pricing": {
      "model": "free tier for evaluation, paid tiers by volume",
      "status": "planned; nothing charged before launch"
    }
  },
  "servers": [
    {
      "url": "https://openapiregistry.com/api/v1/dimensional-weight-calc",
      "description": "Pre-launch: endpoints are not live yet and answer 503."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/calculate": {
      "post": {
        "summary": "Calculate dimensional weight",
        "description": "Returns dimensional and billable weight for a parcel under the selected carrier's DIM rules.",
        "tags": [
          "logistics"
        ],
        "operationId": "dimensional-weight-calc-calculate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "lengthCm",
                  "widthCm",
                  "heightCm",
                  "weightKg",
                  "carrier"
                ],
                "properties": {
                  "lengthCm": {
                    "type": "number",
                    "description": "Parcel length in centimetres."
                  },
                  "widthCm": {
                    "type": "number",
                    "description": "Parcel width in centimetres."
                  },
                  "heightCm": {
                    "type": "number",
                    "description": "Parcel height in centimetres."
                  },
                  "weightKg": {
                    "type": "number",
                    "description": "Actual parcel weight in kilograms."
                  },
                  "carrier": {
                    "type": "string",
                    "description": "Carrier whose DIM divisor and rules apply.",
                    "enum": [
                      "fedex",
                      "ups",
                      "usps"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dimensional and billable weight calculated.",
            "content": {
              "application/json": {
                "example": {
                  "carrier": "ups",
                  "divisor": 5000,
                  "dimensionalWeightKg": 16,
                  "billableWeightKg": 16,
                  "oversized": true
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "carrier": {
                      "type": "string"
                    },
                    "divisor": {
                      "type": "number"
                    },
                    "dimensionalWeightKg": {
                      "type": "number"
                    },
                    "billableWeightKg": {
                      "type": "number"
                    },
                    "oversized": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid dimensions, weight or carrier supplied."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Planned for launch: an API key issued on request. Free tier for evaluation, paid tiers by volume; nothing is charged before launch."
      }
    }
  }
}
