{
  "openapi": "3.1.1",
  "info": {
    "title": "Ecomiq Auth API",
    "version": "1.0.0",
    "description": "Identity, OpenID Connect, user session, token, and step-up authentication endpoints."
  },
  "paths": {
    "/connect/token": {
      "post": {
        "tags": [
          "Identity"
        ],
        "summary": "Request an access token",
        "description": "Exchanges an OAuth 2.0 grant for an access token and, when applicable, a refresh token.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "required": [
                  "grant_type",
                  "client_id"
                ],
                "type": "object",
                "properties": {
                  "grant_type": {
                    "enum": [
                      "client_credentials",
                      "password",
                      "authorization_code",
                      "refresh_token"
                    ],
                    "type": "string",
                    "description": "OAuth 2.0 grant type."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "OAuth application client ID."
                  },
                  "client_secret": {
                    "type": "string",
                    "description": "OAuth application secret. Required for confidential clients."
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-separated OAuth scopes."
                  },
                  "username": {
                    "type": "string",
                    "description": "User email for the password grant."
                  },
                  "password": {
                    "type": "string",
                    "description": "User password for the password grant.",
                    "format": "password"
                  },
                  "refresh_token": {
                    "type": "string",
                    "description": "Refresh token for the refresh_token grant."
                  },
                  "code": {
                    "type": "string",
                    "description": "Authorization code returned by /connect/authorize. Required for the authorization_code grant."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "Redirect URI used in the authorization request, when that request included one.",
                    "format": "uri"
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "PKCE verifier. Required for the authorization_code grant."
                  },
                  "identity_scope": {
                    "enum": [
                      "global",
                      "tenant",
                      "store"
                    ],
                    "type": "string",
                    "description": "Identity scope for the password grant. Defaults to global."
                  },
                  "tenant_id": {
                    "type": "string",
                    "description": "Organization identifier. Required with tenant or store identity scope."
                  },
                  "store_id": {
                    "type": "string",
                    "description": "Store identifier. Required with store identity scope."
                  }
                }
              },
              "example": {
                "grant_type": "client_credentials",
                "client_id": "app_replace_with_your_client_id",
                "client_secret": "replace_with_your_client_secret",
                "scope": "api_admin"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token issued.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "access_token",
                    "token_type",
                    "expires_in"
                  ],
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "Bearer access token."
                    },
                    "token_type": {
                      "type": "string",
                      "description": "Token type. Ecomiq returns Bearer."
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Access-token lifetime in seconds.",
                      "format": "int32"
                    },
                    "refresh_token": {
                      "type": "string",
                      "description": "Refresh token when the grant and requested scopes allow it."
                    },
                    "scope": {
                      "type": "string",
                      "description": "Scopes granted to the token."
                    },
                    "id_token": {
                      "type": "string",
                      "description": "OpenID Connect ID token when the grant and requested scopes issue one."
                    }
                  }
                },
                "example": {
                  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "token_type": "Bearer",
                  "expires_in": 3600,
                  "scope": "api_admin"
                }
              }
            }
          },
          "400": {
            "description": "Invalid OAuth request or grant.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "OAuth 2.0 error code."
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable details about the OAuth error."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Client authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "error"
                  ],
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "OAuth 2.0 error code."
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable details about the OAuth error."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Token",
        "operationId": "postConnectToken",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/auth/step-up/verify": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "VerifyStepUp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepUpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-ecomiq-anonymous": false,
        "x-ecomiq-resource": "Auth",
        "summary": "Verify step up",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "Register User",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              },
              "example": {
                "email": "andrea@example.com",
                "clientId": "app_replace_with_your_client_id",
                "password": "Example-Password-2026!",
                "firstName": "Andrea",
                "lastName": "Ramos"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCreatedDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Users",
        "summary": "Register user",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/login-link": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "RequestLoginLink",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginLinkRequest"
              },
              "example": {
                "email": "andrea@example.com",
                "clientId": "app_replace_with_your_client_id"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Users",
        "summary": "Request login link",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/logout": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "Logout User",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-ecomiq-anonymous": false,
        "x-ecomiq-resource": "Users",
        "summary": "Logout user",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/me": {
      "get": {
        "tags": [
          "Identity"
        ],
        "summary": "Get the current user",
        "description": "Returns the profile of the current authenticated user.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDetailsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-ecomiq-anonymous": false,
        "x-ecomiq-resource": "Users",
        "operationId": "getV1UsersMe",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      },
      "put": {
        "tags": [
          "Identity"
        ],
        "summary": "Update the current user",
        "description": "Updates the profile information of the current authenticated user.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-ecomiq-anonymous": false,
        "x-ecomiq-resource": "Users",
        "operationId": "putV1UsersMe",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/me/password": {
      "put": {
        "tags": [
          "Identity"
        ],
        "operationId": "Update Password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-ecomiq-anonymous": false,
        "x-ecomiq-resource": "Users",
        "summary": "Update password",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/recovery-password": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "Request Password Reset",
        "parameters": [
          {
            "name": "X-Client-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordRecoveryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Users",
        "summary": "Request password reset",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/reset-password": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "Reset Password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Users",
        "summary": "Reset password",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    },
    "/v1/users/verify-code": {
      "post": {
        "tags": [
          "Identity"
        ],
        "summary": "Verify a login code",
        "description": "Verifies a one-time login code and signs in the user.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Command"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [],
        "x-ecomiq-anonymous": true,
        "x-ecomiq-resource": "Users",
        "operationId": "postV1UsersVerifyCode",
        "x-ecomiq-surface": "auth",
        "x-ecomiq-visibility": "public",
        "x-ecomiq-lifecycle": "stable"
      }
    }
  },
  "components": {
    "schemas": {
      "Command": {
        "required": [
          "email",
          "code"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "identityScope": {
            "enum": [
              "global",
              "tenant",
              "store"
            ],
            "type": "string",
            "default": "global"
          },
          "tenantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateUserRequest": {
        "required": [
          "email",
          "clientId"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "enum": [
              "admin",
              "user",
              "customer",
              "service"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "identityScope": {
            "enum": [
              "global",
              "tenant",
              "store"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "tenantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DocumentType": {
        "enum": [
          "dni",
          "passport",
          "foreignId",
          "ruc"
        ],
        "type": [
          "null",
          "string"
        ]
      },
      "GenderType": {
        "enum": [
          "male",
          "female",
          "other"
        ],
        "type": [
          "null",
          "string"
        ]
      },
      "LoginLinkRequest": {
        "required": [
          "email",
          "clientId"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "identityScope": {
            "enum": [
              "global",
              "tenant",
              "store"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "tenantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PasswordRecoveryRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "identityScope": {
            "enum": [
              "global",
              "tenant",
              "store"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "tenantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code returned by Ecomiq."
          }
        }
      },
      "ResetPasswordRequest": {
        "required": [
          "userId",
          "token",
          "newPassword",
          "confirmPassword"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "token": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          },
          "confirmPassword": {
            "type": "string"
          }
        }
      },
      "StepUpVerifyRequest": {
        "required": [
          "challengeId",
          "code"
        ],
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          }
        }
      },
      "UpdatePasswordRequest": {
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": [
              "null",
              "string"
            ]
          },
          "newPassword": {
            "type": "string"
          }
        }
      },
      "UpdateUserRequest": {
        "required": [
          "firstName",
          "lastName",
          "birthDate",
          "gender",
          "documentType",
          "documentNumber",
          "phoneNumber",
          "address",
          "countryCode",
          "avatarUrl"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GenderType"
              }
            ]
          },
          "documentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ],
            "description": "Kind of identity or tax document."
          },
          "documentNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "National identity or tax document number."
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO 3166-1 alpha-2 country code, for example `PE`."
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserCreatedDto": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the resource."
          }
        }
      },
      "UserDetailsDto": {
        "required": [
          "id",
          "email",
          "isProfileComplete",
          "isConfirmed",
          "isEmailConfirmed",
          "isPhoneNumberConfirmed",
          "isTwoFactorEnabled",
          "isActive",
          "createdOn",
          "roles",
          "status",
          "hasPassword",
          "loginProviders"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the resource."
          },
          "userName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "documentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ],
            "description": "Kind of identity or tax document."
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GenderType"
              }
            ]
          },
          "documentNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "National identity or tax document number."
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO 3166-1 alpha-2 country code, for example `PE`."
          },
          "isProfileComplete": {
            "type": "boolean"
          },
          "isConfirmed": {
            "type": "boolean"
          },
          "isEmailConfirmed": {
            "type": "boolean"
          },
          "isPhoneNumberConfirmed": {
            "type": "boolean"
          },
          "isTwoFactorEnabled": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdOn": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the resource was created, in ISO 8601."
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "$ref": "#/components/schemas/UserStatus"
          },
          "hasPassword": {
            "type": "boolean"
          },
          "loginProviders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserStatus": {
        "enum": [
          "inactive",
          "active",
          "suspended"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "OAuth2 access token issued by Ecomiq Auth."
      }
    }
  },
  "tags": [
    {
      "name": "Identity",
      "description": "Users, sessions, OIDC connect flows, tokens, and step-up authentication.",
      "x-displayName": "Identity"
    }
  ],
  "servers": [
    {
      "url": "https://auth.ecomiq.pe",
      "description": "Production auth service"
    }
  ]
}