{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mareaalcalina-com/json-schema/mareaalcalina-com-me-response-schema.json",
  "title": "MeResponse",
  "description": "Identity + plan info for the calling key. Available to both user and developer keys (branched by `type`).",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mareaalcalina-com-openapi.json#/components/schemas/MeResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "user",
        "developer"
      ]
    },
    "email": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "verificationStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "pending",
        "verified"
      ]
    },
    "tosAcceptedAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "plan": {
      "$ref": "#/$defs/MePlan"
    },
    "planQuantity": {
      "type": [
        "integer",
        "null"
      ],
      "exclusiveMinimum": 0
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "rateLimit": {
      "$ref": "#/$defs/MeRateLimit"
    },
    "keyId": {
      "type": [
        "string",
        "null"
      ]
    },
    "_links": {
      "$ref": "#/$defs/MeLinks"
    }
  },
  "required": [
    "id",
    "type",
    "email",
    "displayName",
    "scopes",
    "rateLimit",
    "keyId",
    "_links"
  ],
  "$defs": {
    "MeLinks": {
      "type": "object",
      "properties": {
        "upgradeUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "dashboardUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "developerDashboardUrl": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "MePlan": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "tier": {
          "type": "string",
          "enum": [
            "free",
            "basic",
            "pro",
            "business"
          ],
          "description": "Plan tier the calling user is on. Numeric internal plans map to one of these 4."
        },
        "limits": {
          "$ref": "#/$defs/MePlanLimits"
        }
      },
      "required": [
        "tier",
        "limits"
      ]
    },
    "MePlanLimits": {
      "type": "object",
      "properties": {
        "storefronts": {
          "type": "integer",
          "minimum": 0
        },
        "products": {
          "type": "integer",
          "minimum": 0
        },
        "publishable": {
          "type": "boolean"
        }
      },
      "required": [
        "storefronts",
        "products",
        "publishable"
      ]
    },
    "MeRateLimit": {
      "type": "object",
      "properties": {
        "rpm": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "rpd": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "remainingMinute": {
          "type": "integer",
          "minimum": 0
        },
        "remainingDay": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "rpm",
        "rpd",
        "remainingMinute",
        "remainingDay"
      ]
    }
  }
}