{
  "openapi": "3.0.3",
  "info": {
    "title": "ShipCove Shipping API",
    "version": "1.1.0",
    "description": "Server-to-server REST API for UPS quotes, label purchases, saved labels and tracking. Customer keys use funded shipping credit; verified ShipCove owner keys bill the connected UPS account directly and access only the owner workspace. US domestic live shipping only. Browser Origin requests are rejected; no CORS, cookies or query-string keys. Preserve idempotency keys and request IDs; never automatically replace uncertain purchases.",
    "termsOfService": "https://shipcove.net/terms"
  },
  "servers": [
    {
      "url": "https://shipcove.net/api/v1"
    }
  ],
  "security": [
    {
      "CustomerApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Shipping"
    }
  ],
  "paths": {
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Read your account identity and billing mode",
        "description": "Customer keys return wallet balance and funding URL. Owner keys return owner identity, ups_account billing, and null customer/balance/funding URL. Owner keys do not impersonate customers.",
        "x-required-scope": "balance:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "customer",
                    "balanceCents",
                    "currency",
                    "fundingUrl",
                    "accountType",
                    "billingMode"
                  ],
                  "properties": {
                    "customer": {
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "email",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string",
                          "format": "email"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "nullable": true
                    },
                    "balanceCents": {
                      "type": "integer",
                      "description": "Available USD cents; may be negative when charges are outstanding.",
                      "nullable": true
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD"
                      ]
                    },
                    "fundingUrl": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "accountType": {
                      "type": "string",
                      "enum": [
                        "customer",
                        "owner"
                      ]
                    },
                    "billingMode": {
                      "type": "string",
                      "enum": [
                        "wallet",
                        "ups_account"
                      ]
                    },
                    "owner": {
                      "type": "object",
                      "description": "Present for owner keys only. This identifier is the immutable portal owner, not a customer UUID.",
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string",
                          "format": "email"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/quotes": {
      "post": {
        "operationId": "createQuote",
        "summary": "Request live UPS quotes without buying postage",
        "description": "Request live UPS quotes without buying postage",
        "x-required-scope": "rates:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShipmentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request payload exceeds the supported size.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "POST requests must use application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "Carrier response could not be confirmed. Recover an existing purchase before retrying new postage.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/labels": {
      "post": {
        "operationId": "purchaseLabel",
        "summary": "Purchase one UPS label using customer shipping credit",
        "description": "Customer keys require available wallet credit, shipping approval, and account limits. Owner keys require the connected live UPS account. Every physical package needs a separate quote and idempotency key. Retry only the original key and identical body. A 202 response is not proof of a printable label; check shipment status. Customer keys debit shipping credit; owner keys bill UPS directly. maxAmountCents validates the selected quote before purchase. Later UPS adjustments remain possible. If an owner shipment is already created with an unexpectedly higher carrier charge, the response preserves its shipment ID and status and includes pricingWarning; do not buy again.",
        "x-required-scope": "labels:write",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Persist a unique key per purchase or void action. Retry the same body with the same key. Never automatically buy replacement postage after an uncertain result.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelPurchase"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ready result of an already saved request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "201": {
            "description": "Newly ready label purchase.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "202": {
            "description": "Saved processing or uncertain outcome. Recover this purchase; do not buy a replacement automatically.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request payload exceeds the supported size.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "POST requests must use application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "Carrier response could not be confirmed. Recover an existing purchase before retrying new postage.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/shipments": {
      "get": {
        "operationId": "listShipments",
        "summary": "List customer shipments with cursor pagination",
        "description": "List customer shipments with cursor pagination",
        "x-required-scope": "labels:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Use nextCursor exactly as returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "shipments",
                    "nextCursor"
                  ],
                  "properties": {
                    "shipments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Shipment"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/shipments/{id}": {
      "get": {
        "operationId": "getShipment",
        "summary": "Read a saved shipment and its purchase outcome",
        "description": "Read a saved shipment and its purchase outcome",
        "x-required-scope": "labels:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/labels/{id}": {
      "get": {
        "operationId": "getLabelImage",
        "summary": "Download original base64 label image",
        "description": "Downloads may be blocked for an unresolved outcome, void, or missing required high-value receipt. This is not a PDF endpoint.",
        "x-required-scope": "labels:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelImage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/labels/{id}/high-value-receipts": {
      "get": {
        "operationId": "listHighValueReceipts",
        "summary": "List required high-value receipt downloads",
        "description": "List required high-value receipt downloads",
        "x-required-scope": "labels:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "Carrier response could not be confirmed. Recover an existing purchase before retrying new postage.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/labels/{id}/high-value-receipts/{index}": {
      "get": {
        "operationId": "downloadHighValueReceipt",
        "summary": "Download a high-value receipt attachment",
        "description": "Download a high-value receipt attachment",
        "x-required-scope": "labels:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original supported receipt format, delivered as an attachment with private caching and restrictive security headers.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/shipments/{id}/void": {
      "post": {
        "operationId": "voidShipment",
        "summary": "Request UPS void confirmation for an eligible label",
        "description": "Requires labels:void permission. An attempted request does not establish carrier confirmation. A used or ineligible label may be rejected. Does not offer arbitrary cash withdrawals.",
        "x-required-scope": "labels:void",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Persist a unique key per purchase or void action. Retry the same body with the same key. Never automatically buy replacement postage after an uncertain result.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "confirmed"
                ],
                "properties": {
                  "confirmed": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "voided"
                  ],
                  "properties": {
                    "voided": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "alreadyVoided": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request payload exceeds the supported size.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "POST requests must use application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "Carrier response could not be confirmed. Recover an existing purchase before retrying new postage.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/shipments/{id}/tracking": {
      "get": {
        "operationId": "getTracking",
        "summary": "Read the last saved tracking snapshot",
        "description": "Read the last saved tracking snapshot",
        "x-required-scope": "tracking:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tracking"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/shipments/{id}/tracking/refresh": {
      "post": {
        "operationId": "refreshTracking",
        "summary": "Request a tracking refresh subject to carrier and account limits",
        "description": "Does not create labels. Live refreshes have additional operation limits. No tracking webhooks or proof download are included in this API.",
        "x-required-scope": "tracking:read",
        "security": [
          {
            "CustomerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tracking"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Scope or account permission denied.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found for this customer.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with saved state, price, or eligibility.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request payload exceeds the supported size.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "POST requests must use application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Honor Retry-After.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Recover a saved purchase before creating another.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "Carrier response could not be confirmed. Recover an existing purchase before retrying new postage.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "A required service is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID to include when contacting support. Never send the API key.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CustomerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ShipCove API key",
        "description": "Create an expiring key in ShipCove API access. Customer keys are scoped to that customer and use shipping credit. Verified owner keys are scoped to the owner workspace and bill the connected UPS account. No cross-customer impersonation. Server use only; never put keys in browser code or URLs."
      }
    },
    "schemas": {
      "Address": {
        "type": "object",
        "required": [
          "name",
          "line1",
          "city",
          "state",
          "zip"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35
          },
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35
          },
          "line2": {
            "type": "string",
            "maxLength": 35,
            "default": ""
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30
          },
          "state": {
            "type": "string",
            "enum": [
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "DC",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY"
            ]
          },
          "zip": {
            "type": "string",
            "pattern": "^\\d{5}(-\\d{4})?$"
          },
          "phone": {
            "type": "string",
            "maxLength": 25,
            "default": "",
            "description": "10\u00e2\u20ac\u201c15 digits after punctuation is removed. Required for the sender."
          },
          "residential": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ShipmentInput": {
        "type": "object",
        "required": [
          "from",
          "to",
          "pounds",
          "ounces",
          "length",
          "width",
          "height"
        ],
        "description": "One packed US domestic package. Combined pounds + ounces / 16 must exceed zero and not exceed 150. Longest side + twice the other two sides must not exceed 165 inches. Sender phone is required.",
        "properties": {
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "object",
                "required": [
                  "phone"
                ]
              }
            ]
          },
          "to": {
            "$ref": "#/components/schemas/Address"
          },
          "pounds": {
            "type": "number",
            "minimum": 0,
            "maximum": 150
          },
          "ounces": {
            "type": "number",
            "minimum": 0,
            "maximum": 15.99
          },
          "length": {
            "type": "integer",
            "minimum": 1,
            "maximum": 108,
            "description": "Whole inches."
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "maximum": 108,
            "description": "Whole inches."
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "maximum": 108,
            "description": "Whole inches."
          },
          "reference": {
            "type": "string",
            "maxLength": 35,
            "default": ""
          },
          "declaredValueCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5000000,
            "default": 0,
            "description": "UPS declared value, not insurance. Higher values have receipt and tender requirements."
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "shipDate": {
            "type": "string",
            "format": "date",
            "description": "Today through the next 7 days, using the US Eastern calendar date."
          },
          "returnLabel": {
            "type": "boolean"
          },
          "returnOfShipmentId": {
            "type": "string",
            "format": "uuid"
          },
          "signature": {
            "type": "string",
            "enum": [
              "none",
              "signature",
              "adult"
            ]
          },
          "packaging": {
            "type": "string",
            "enum": [
              "02",
              "01",
              "03",
              "04",
              "21",
              "2a",
              "2b",
              "2c"
            ]
          },
          "simpleRate": {
            "type": "boolean",
            "description": "Requires own packaging, at most 50 lb and 1,728 cubic inches."
          },
          "contentsDescription": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35,
            "description": "Required for returns."
          },
          "contentsCategory": {
            "type": "string",
            "enum": [
              "general"
            ],
            "description": "Restricted and uncertain contents are not supported."
          }
        }
      },
      "Rate": {
        "type": "object",
        "required": [
          "code",
          "name",
          "amount",
          "currency"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "01",
              "02",
              "03",
              "12",
              "13",
              "14",
              "59"
            ]
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{2}$",
            "description": "Customer price in USD. Convert exactly to cents for maxAmountCents."
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "days": {
            "type": "string"
          },
          "deliveryDate": {
            "type": "string",
            "format": "date"
          },
          "breakdown": {
            "type": "object",
            "additionalProperties": true,
            "description": "Customer-safe price details when UPS returns them."
          }
        }
      },
      "Quote": {
        "type": "object",
        "required": [
          "id",
          "rates",
          "mode",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rate"
            }
          },
          "mode": {
            "type": "string",
            "enum": [
              "live"
            ]
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "Expiry in Unix milliseconds."
          }
        }
      },
      "LabelPurchase": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quoteId",
          "serviceCode",
          "confirmed",
          "maxAmountCents"
        ],
        "properties": {
          "quoteId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceCode": {
            "type": "string",
            "enum": [
              "01",
              "02",
              "03",
              "12",
              "13",
              "14",
              "59"
            ]
          },
          "confirmed": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "maxAmountCents": {
            "type": "integer",
            "minimum": 1,
            "description": "Maximum approved customer price in whole USD cents.",
            "maximum": 10000000
          }
        }
      },
      "Shipment": {
        "type": "object",
        "required": [
          "id",
          "recipient",
          "destination",
          "service",
          "amount",
          "currency",
          "tracking",
          "mode",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "recipient": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "tracking": {
            "type": "string",
            "nullable": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "live"
            ]
          },
          "status": {
            "type": "string",
            "description": "Saved purchase outcome. Do not purchase a replacement when processing or uncertain."
          },
          "createdAt": {
            "type": "integer",
            "format": "int64"
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "voidState": {
            "type": "string"
          },
          "declaredValueCents": {
            "type": "integer"
          },
          "highValueReceiptRequired": {
            "type": "boolean"
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Available only when the label is ready."
          },
          "shipmentUrl": {
            "type": "string",
            "format": "uri"
          },
          "pricingWarning": {
            "type": "string",
            "description": "Owner purchase may be created with an unexpectedly higher carrier charge. Keep this shipment and review; do not buy again. Customer prices remain fixed at purchase."
          }
        }
      },
      "LabelImage": {
        "type": "object",
        "required": [
          "image",
          "format"
        ],
        "properties": {
          "image": {
            "type": "string",
            "format": "byte",
            "description": "Original UPS image encoded as base64. Not a PDF."
          },
          "format": {
            "type": "string",
            "description": "UPS label image format, such as GIF."
          }
        }
      },
      "ReceiptList": {
        "type": "object",
        "required": [
          "required",
          "receipts"
        ],
        "properties": {
          "required": {
            "type": "boolean"
          },
          "receipts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "index",
                "format",
                "downloadPath"
              ],
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "format": {
                  "type": "string"
                },
                "downloadPath": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Tracking": {
        "type": "object",
        "required": [
          "snapshot",
          "lastCheckedAt",
          "missingScan",
          "error",
          "proofAvailable"
        ],
        "properties": {
          "shipment": {
            "type": "object",
            "additionalProperties": true
          },
          "snapshot": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Saved UPS tracking snapshot. May be null before a successful check."
          },
          "lastCheckedAt": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "missingScan": {
            "type": "boolean"
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "proofAvailable": {
            "type": "boolean",
            "description": "Carrier proof availability indication. Proof downloads are not exposed by this API."
          }
        }
      },
      "ApiError": {
        "type": "object",
        "required": [
          "error",
          "requestId"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "requestId"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              }
            }
          },
          "requestId": {
            "type": "string"
          }
        }
      }
    }
  }
}
