{
  "openapi": "3.0.0",
  "paths": {
    "/profiles/{userId}": {
      "get": {
        "operationId": "getUserProfile",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "description": "User ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "profile/read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "summary": "Get a user's public profile.",
        "tags": [
          "Profiles"
        ]
      }
    },
    "/user": {
      "get": {
        "description": "Includes non-public profile details.",
        "operationId": "getCaller",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "user/read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "summary": "Get the authenticated user's full profile.",
        "tags": [
          "User"
        ]
      }
    },
    "/user/quotas": {
      "get": {
        "description": "The API key from the `X-API-Key` header is used to determine usage quotas, so the header is still required, but the request won't count against the quotas.",
        "operationId": "getUsageQuotas",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageQuota"
                }
              }
            }
          }
        },
        "summary": "Get API key usage quotas for the current UTC date.",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Hopscotch API",
    "description": "",
    "version": "v1",
    "contact": {
      "name": "Hopscotch Support",
      "url": "hopscotch.trade/support",
      "email": "support@hopscotch.trade"
    },
    "termsOfService": "hopscotch.trade/legal/tos",
    "x-hopscotch-rate-limit-burst-capacity": 100,
    "x-hopscotch-rate-limit-quota": 20000,
    "x-hopscotch-rate-limit-steady-rate": 50,
    "x-hopscotch-access-token-validity": 1
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "http",
        "flows": {
          "clientCredentials": {
            "scopes": {},
            "tokenUrl": "https://api.hopscotch.trade/token"
          }
        },
        "bearerFormat": "Bearer <AccessToken>",
        "in": "header",
        "scheme": "bearer",
        "name": "authorization",
        "description": "Get `clientId` and `clientSecret` from the [Hopscotch App Settings](https://hopscotch.trade/settings/api)."
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Get an API key from the [Hopscotch App Settings](https://hopscotch.trade/settings/api)."
      }
    },
    "schemas": {
      "UserProfile": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Ethereum address of the user's Hopscotch wallet."
          },
          "avatar": {
            "type": "string",
            "description": "URL of the user's profile avatar."
          },
          "createdDate": {
            "type": "number",
            "description": "User joined date, in milliseconds since Unix epoch."
          },
          "userId": {
            "type": "string",
            "description": "Hopscotch User ID."
          },
          "displayName": {
            "type": "string",
            "description": "User's profile name."
          },
          "merchantId": {
            "type": "number",
            "description": "User's Store ID"
          }
        },
        "description": "Represents a User's public profile.",
        "required": [
          "address",
          "createdDate",
          "userId"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Ethereum address of the user's Hopscotch wallet."
          },
          "avatar": {
            "type": "string",
            "description": "URL of the user's profile avatar."
          },
          "createdDate": {
            "type": "number",
            "description": "User joined date, in milliseconds since Unix epoch."
          },
          "userId": {
            "type": "string",
            "description": "Hopscotch User ID."
          },
          "displayName": {
            "type": "string",
            "description": "User's profile name."
          },
          "merchantId": {
            "type": "number",
            "description": "User's Store ID"
          },
          "currency": {
            "type": "string",
            "description": "User's preferred traditional currency (code)."
          },
          "email": {
            "type": "string",
            "description": "User's email."
          },
          "locale": {
            "type": "string",
            "description": "User's preferred language."
          },
          "status": {
            "enum": [
              "allowed",
              "pending",
              "blocked"
            ],
            "type": "string",
            "description": "User's account status."
          },
          "units": {
            "type": "string",
            "enum": [
              "imperial",
              "metric"
            ],
            "description": "User's preferred units (imperial or metric)."
          }
        },
        "description": "Represents a User's full private profile.",
        "required": [
          "address",
          "createdDate",
          "userId"
        ]
      },
      "UsageQuota": {
        "type": "object",
        "properties": {
          "used": {
            "type": "number",
            "description": "Used quota for the current UTC date."
          },
          "remaining": {
            "type": "number",
            "description": "Remaining quota for the current UTC date."
          }
        },
        "description": "API key usage for the current UTC date.",
        "required": [
          "used",
          "remaining"
        ]
      },
      "ErrorResponseDto": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "type": "number"
          }
        },
        "required": [
          "requestId"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "API Docs",
    "url": "https://hopscotch.trade/docs/api"
  }
}