{
  "openapi": "3.1.0",
  "info": {
    "title": "Managed Application import",
    "version": "1.2.0",
    "description": "Import a base64 Managed App ZIP into the server-hosted Marketplace page or Marketplace V2 wizard, optionally with the five Managed App JSON templates used by both pages. A package-only import initializes an editable new offer and plan with sample logos and generated offer/plan IDs. Listing copy, preview subscriptions, and publisher access remain for the user to complete. Import never publishes and never accepts credentials or model settings. The user selects their publisher and explicitly publishes after reviewing the content."
  },
  "paths": {
    "/marketplace-v2": {
      "post": {
        "operationId": "importManagedApplication",
        "summary": "Populate Marketplace V2 from a browser form POST",
        "description": "Submit a top-level browser form navigation, not a JSON HTTP body. Only packageBase64 is required. Each supplied field must occur exactly once and cannot be empty; files and unknown fields are rejected. Omit definition to start a new offer and plan with sample logos, without AI generation. The total encoded request is limited to 100 MiB. Imports are rate limited to five per minute per client IP. Validation does not fetch remote URLs, call AI, or contact Partner Center. On success, follow the 303 redirect to the same Marketplace page in the submitting browser within ten minutes. Its URL fragment is a confidential, random import handle, removed by the page after reading. Package bytes stay on the server and never pass through SignalR or browser local storage. Save a definition archive to keep uploaded files after leaving or reloading the page.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImportForm"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ImportForm"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Validated and staged. Follow Location in a browser to load the draft. No Partner Center operations have run.",
            "headers": {
              "Location": {
                "description": "Relative URL of the requested Marketplace page with an opaque import handle in its fragment. Do not log or share it.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidImport"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "415": {
            "description": "Only multipart/form-data and application/x-www-form-urlencoded are supported.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many imports. Retry after one minute.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Temporary import storage failure. Submit again; no draft was loaded.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/marketplace": {
      "post": {
        "operationId": "importManagedApplicationOriginal",
        "summary": "Populate Marketplace from a browser form POST",
        "description": "Submit a top-level browser form navigation, not a JSON HTTP body. Only packageBase64 is required. Each supplied field must occur exactly once and cannot be empty; files and unknown fields are rejected. Omit definition to start a new offer and plan with sample logos, without AI generation. The total encoded request is limited to 100 MiB. Imports are rate limited to five per minute per client IP. Validation does not fetch remote URLs, call AI, or contact Partner Center. On success, follow the 303 redirect to the same Marketplace page in the submitting browser within ten minutes. Its URL fragment is a confidential, random import handle, removed by the page after reading. Package bytes stay on the server and never pass through SignalR or browser local storage. Save a definition archive to keep uploaded files after leaving or reloading the page.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImportForm"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ImportForm"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Validated and staged. Follow Location in a browser to load the draft. No Partner Center operations have run.",
            "headers": {
              "Location": {
                "description": "Relative URL of the requested Marketplace page with an opaque import handle in its fragment. Do not log or share it.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidImport"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "415": {
            "description": "Only multipart/form-data and application/x-www-form-urlencoded are supported.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many imports. Retry after one minute.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Temporary import storage failure. Submit again; no draft was loaded.",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "InvalidImport": {
        "description": "Malformed form/JSON/base64, unsupported fields, missing or inconsistent listing data, an unsafe ZIP, or an integrity/schema check failed. Correct the indicated field and resubmit. Optional JSON properties must be omitted rather than null.",
        "content": {
          "application/problem\u002Bjson": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TooLarge": {
        "description": "The request, definition, or decoded package exceeds its size limit. Form-parser field/count/boundary limits can also return 400.",
        "content": {
          "application/problem\u002Bjson": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "ImportForm": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "packageBase64"
        ],
        "properties": {
          "definition": {
            "type": "string",
            "minLength": 1,
            "contentMediaType": "application/json",
            "contentSchema": {
              "$ref": "#/components/schemas/ManagedApplicationDefinition"
            },
            "description": "Optional. Omit this field to initialize a new offer and plan with sample logos and editable generated IDs; fill in the remaining listing fields on the page. When supplied, JSON-serialize ManagedApplicationDefinition into this text field, with the five file names as keys and JSON objects (not JSON strings) as values. Limit: 4 MiB of UTF-8. Case-sensitive property names, no duplicate properties, comments, trailing commas, nulls, or unknown properties; maximum JSON depth 32. All offerId values and all planId values must agree. Provide preview subscription GUIDs, one or two supported categories, an AzureLogoLarge HTTP(S) URL, and complete offer/plan copy. URLs must not contain credentials. Publisher IDs in the templates are not used to select an account; the user supplies that on the page.",
            "maxLength": 4194304
          },
          "packageFileName": {
            "type": "string",
            "minLength": 5,
            "pattern": "^[^/\\\\:*?\u0022\u003C\u003E|\\u0000-\\u001f]\u002B\\.[zZ][iI][pP]$",
            "example": "managed-application.zip",
            "description": "Optional .zip base file name without a directory path. Defaults to managed-application.zip when omitted.",
            "maxLength": 128,
            "default": "managed-application.zip"
          },
          "packageBase64": {
            "type": "string",
            "format": "byte",
            "contentEncoding": "base64",
            "minLength": 4,
            "description": "Standard padded base64, without whitespace or a data-URL prefix. Decoded ZIP limit: 50 MiB. The ZIP must contain valid mainTemplate.json and createUiDefinition.json at its root. All entries are read and their CRC-32 checksums and lengths checked. Paths, duplicate names, symbolic links, JSON syntax, ARM/UI schemas, and expansion limits are validated. At most 2048 entries, 32 MiB expanded total, 4 MiB per JSON entry, and compression ratio at most 200. The uploaded bytes take precedence over packageUri in the JSON.",
            "maxLength": 69905068
          },
          "packageSha256": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{64}$",
            "description": "Optional recommended SHA-256 checksum of the original ZIP bytes (not of the base64 text). A mismatch rejects the entire import."
          }
        }
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "ManagedApplicationDefinition": {
        "type": "object",
        "properties": {
          "offer-create.json": {
            "type": "object",
            "properties": {
              "publisherId": {
                "type": "string",
                "description": "Optional source metadata. The user selects the publisher account on the page before publishing."
              },
              "offerId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "alias": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "productType": {
                "type": "string"
              },
              "requestPrivateOfferEnabled": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "required": [
              "offerId",
              "alias",
              "type"
            ]
          },
          "offer-listing.json": {
            "type": "object",
            "properties": {
              "publisherId": {
                "type": "string",
                "description": "Optional source metadata. The user selects the publisher account on the page before publishing."
              },
              "publisherName": {
                "type": "string"
              },
              "offerId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "language": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "summary": {
                "type": "string",
                "maxLength": 100
              },
              "searchResultSummary": {
                "type": "string",
                "maxLength": 100
              },
              "shortDescription": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "keywords": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "categoryIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "industryIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "industries": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "azureSubscriptionForPreview": {
                "type": "string"
              },
              "privacyPolicyLink": {
                "type": "string"
              },
              "privacyPolicyUrl": {
                "type": "string"
              },
              "termsOfUseUrl": {
                "type": "string"
              },
              "supportUrl": {
                "type": "string"
              },
              "documentationUrl": {
                "type": "string"
              },
              "resellThroughCsps": {
                "type": "string"
              },
              "contacts": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "uri": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "cspProgramMarketingMaterials": {
                      "type": "string"
                    },
                    "cloudSolutionProviderMarketingMaterials": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "links": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "fileName": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "order": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "offerId",
              "title",
              "description",
              "azureSubscriptionForPreview",
              "images"
            ]
          },
          "plan-create.json": {
            "type": "object",
            "properties": {
              "publisherId": {
                "type": "string",
                "description": "Optional source metadata. The user selects the publisher account on the page before publishing."
              },
              "offerId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "planId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "alias": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "planType": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "offerId",
              "planId",
              "name",
              "type"
            ]
          },
          "plan-listing.json": {
            "type": "object",
            "properties": {
              "publisherId": {
                "type": "string",
                "description": "Optional source metadata. The user selects the publisher account on the page before publishing."
              },
              "offerId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "planId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "language": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "planSummary": {
                "type": "string",
                "maxLength": 100
              },
              "planDescription": {
                "type": "string"
              },
              "summary": {
                "type": "string",
                "maxLength": 100
              },
              "description": {
                "type": "string"
              },
              "features": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "keywords": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "price": {
                "type": "number"
              },
              "pricing": {
                "type": "number"
              },
              "documentationUrl": {
                "type": "string"
              },
              "supportUrl": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "offerId",
              "planId"
            ],
            "description": "Supply a nonempty summary (or planSummary) and description (or planDescription). Price/pricing cannot be negative."
          },
          "plan-technical-configuration.json": {
            "type": "object",
            "properties": {
              "publisherId": {
                "type": "string",
                "description": "Optional source metadata. The user selects the publisher account on the page before publishing."
              },
              "offerId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "planId": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$"
              },
              "planType": {
                "type": "string"
              },
              "packageUri": {
                "type": "string",
                "description": "Ignored for this import; the validated base64 ZIP is used instead."
              },
              "publicAzureTenantID": {
                "type": "string"
              },
              "publisherTenantId": {
                "type": "string"
              },
              "managedResourceGroupPrefix": {
                "type": "string"
              },
              "notificationEmail": {
                "type": "string"
              },
              "publicAzureAuthorizations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "principalID": {
                      "type": "string"
                    },
                    "roleDefinitionID": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "authorizations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ManagedApplicationDefinition/properties/plan-technical-configuration.json/properties/publicAzureAuthorizations/items"
                }
              },
              "notes": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "allowJitAccess": {
                "type": "boolean"
              },
              "canEnableCustomerActions": {
                "type": "boolean"
              },
              "allowedCustomerActions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "offerId",
              "planId",
              "planType"
            ],
            "description": "planType must be managed-application. When publisher access is configured, supply a tenant GUID and authorization principal GUIDs with Contributor/Owner roles (or their built-in GUIDs). JIT requires publisher access. Markets must be ISO letter codes."
          }
        },
        "required": [
          "offer-create.json",
          "offer-listing.json",
          "plan-create.json",
          "plan-listing.json",
          "plan-technical-configuration.json"
        ],
        "additionalProperties": false
      }
    }
  }
}