{
  "info": {
    "name": "Ecomiq Auth API 1.0.0",
    "description": "Identity, OpenID Connect, user session, and token endpoints.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://auth.ecomiq.pe",
      "type": "string"
    },
    {
      "key": "accessToken",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Identity",
      "item": [
        {
          "name": "Register an OAuth client",
          "description": "Operation ID: postConnectRegister",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: postConnectRegister\n\nRegister an OAuth client. A successful request returns HTTP 201 with the documented response body.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/connect/register",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "connect",
                "register"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"client_name\": \"Example resource\",\n  \"redirect_uris\": [\n    \"example\"\n  ],\n  \"token_endpoint_auth_method\": \"replace_with_the_issued_token\",\n  \"grant_types\": [\n    \"example\"\n  ],\n  \"response_types\": [\n    \"example\"\n  ],\n  \"application_type\": \"example\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Request an access token",
          "description": "Operation ID: postConnectToken",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: postConnectToken\n\nExchanges an OAuth 2.0 grant for an access token and, when applicable, a refresh token.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/connect/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "connect",
                "token"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials",
                  "type": "text"
                },
                {
                  "key": "client_id",
                  "value": "app_replace_with_your_client_id",
                  "type": "text"
                },
                {
                  "key": "client_secret",
                  "value": "replace_with_your_client_secret",
                  "type": "text"
                },
                {
                  "key": "scope",
                  "value": "api_admin",
                  "type": "text"
                }
              ]
            }
          }
        },
        {
          "name": "Register user",
          "description": "Operation ID: Register User",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: Register User\n\nRegister user. A successful request returns HTTP 200 with the documented response body.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"andrea@example.com\",\n  \"clientId\": \"app_replace_with_your_client_id\",\n  \"password\": \"Example-Password-2026!\",\n  \"firstName\": \"Andrea\",\n  \"lastName\": \"Ramos\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Request login code",
          "description": "Operation ID: RequestLoginLink",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: RequestLoginLink\n\nSends a one-time login code to the user's email address.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/users/login-link",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "login-link"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"andrea@example.com\",\n  \"clientId\": \"app_replace_with_your_client_id\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Log out user",
          "description": "Operation ID: Logout User",
          "request": {
            "method": "POST",
            "description": "Operation ID: Logout User\n\nEnds the current authenticated user session.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "logout"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Get the current user",
          "description": "Operation ID: getV1UsersMe",
          "request": {
            "method": "GET",
            "description": "Operation ID: getV1UsersMe\n\nReturns the profile of the current authenticated user.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Update the current user",
          "description": "Operation ID: UpdateCurrentUser",
          "request": {
            "method": "PUT",
            "description": "Operation ID: UpdateCurrentUser\n\nUpdates the profile information of the current authenticated user.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firstName\": \"Andrea\",\n  \"lastName\": \"Ramos\",\n  \"birthDate\": \"2026-08-01\",\n  \"gender\": \"male\",\n  \"documentType\": \"dni\",\n  \"documentNumber\": \"example\",\n  \"phoneNumber\": \"+51987654321\",\n  \"address\": \"example\",\n  \"countryCode\": \"PE\",\n  \"avatarUrl\": \"https://example.com/resource\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Cancel a scheduled account deletion",
          "description": "Operation ID: deleteV1UsersMeDeletion",
          "request": {
            "method": "DELETE",
            "description": "Operation ID: deleteV1UsersMeDeletion\n\nBrings the account back to active while it is still inside the grace period.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/deletion",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "deletion"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Schedule the account for deletion",
          "description": "Operation ID: postV1UsersMeDeletion",
          "request": {
            "method": "POST",
            "description": "Operation ID: postV1UsersMeDeletion\n\nSchedules permanent deletion after a 30 day grace period. The user can sign in to cancel during that period. Owners must close or transfer their stores first.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/deletion",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "deletion"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Update the current user's password",
          "description": "Operation ID: UpdateUserPassword",
          "request": {
            "method": "PUT",
            "description": "Operation ID: UpdateUserPassword\n\nChanges the authenticated user's password after action-bound security verification.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "password"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currentPassword\": \"Example-Password-2026!\",\n  \"newPassword\": \"Example-Password-2026!\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Enable two-factor authentication",
          "description": "Operation ID: postV1UsersMeTwoFactor",
          "request": {
            "method": "POST",
            "description": "Operation ID: postV1UsersMeTwoFactor\n\nVerifies the first code from the authenticator app, turns two-factor on and returns the recovery codes. The codes are shown once.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/two-factor",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "two-factor"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"example_code\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Disable two-factor authentication",
          "description": "Operation ID: deleteV1UsersMeTwoFactor",
          "request": {
            "method": "DELETE",
            "description": "Operation ID: deleteV1UsersMeTwoFactor\n\nTurns two-factor off and discards the authenticator secret and recovery codes. The action requires a current authenticator or recovery code.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/two-factor",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "two-factor"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Get two-factor status",
          "description": "Operation ID: getV1UsersMeTwoFactor",
          "request": {
            "method": "GET",
            "description": "Operation ID: getV1UsersMeTwoFactor\n\nReports whether an authenticator app is active and how many recovery codes are left.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/two-factor",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "two-factor"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Start authenticator enrollment",
          "description": "Operation ID: postV1UsersMeTwoFactorEnrollment",
          "request": {
            "method": "POST",
            "description": "Operation ID: postV1UsersMeTwoFactorEnrollment\n\nIssues a fresh authenticator secret and the otpauth URI to scan. Two-factor is not active until the code is confirmed.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/two-factor/enrollment",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "two-factor",
                "enrollment"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Generate new recovery codes",
          "description": "Operation ID: postV1UsersMeTwoFactorRecoveryCodes",
          "request": {
            "method": "POST",
            "description": "Operation ID: postV1UsersMeTwoFactorRecoveryCodes\n\nReplaces every recovery code with a fresh set. The previous codes stop working immediately. The action requires a current authenticator or recovery code.",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer <token>",
                "description": "OAuth 2.0 bearer token.",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/me/two-factor/recovery-codes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "me",
                "two-factor",
                "recovery-codes"
              ],
              "query": [],
              "variable": []
            }
          }
        },
        {
          "name": "Request a password reset",
          "description": "Operation ID: UserRecoveryPassword",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: UserRecoveryPassword\n\nSends password-reset instructions when the account and client context are valid.",
            "header": [
              {
                "key": "X-Client-Id",
                "value": "7204558912004325301",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/users/recovery-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "recovery-password"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"andrea@example.com\",\n  \"identityScope\": \"global\",\n  \"tenantId\": \"7204558912004325301\",\n  \"storeId\": \"7204558912004325301\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Reset a user password",
          "description": "Operation ID: UserResetPassword",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "description": "Operation ID: UserResetPassword\n\nSets a new password using a valid password-reset token.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/users/reset-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "users",
                "reset-password"
              ],
              "query": [],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"2f40d7e4-3d9c-4ab2-b04e-7a6a132db821\",\n  \"token\": \"replace_with_the_issued_token\",\n  \"newPassword\": \"Example-Password-2026!\",\n  \"confirmPassword\": \"Example-Password-2026!\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}