The TechStore Explorer API uses Laravel Sanctum personal access tokens for authentication. Obtain a token by registering a new account or logging in with an existing one, then include it in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header of every subsequent request that targets a protected endpoint. Tokens are stored in the personal_access_tokens table and remain valid until manually revoked.
POST /api/register
Creates a new user account with thecustomer role and immediately returns a Bearer token. Use this token to begin making authenticated requests without a separate login step.
Request headers
| Header | Value |
|---|---|
Content-Type | application/json |
Accept | application/json |
The user’s display name. Maximum 255 characters.
A unique email address for the account. Must be a valid email format and not already registered.
The account password. Minimum 8 characters.
201 Created
Human-readable confirmation — always
"User registered successfully" on success.The newly created user object.
role_id will correspond to the customer role.The plain-text Sanctum personal access token. Store this securely — it will not be shown again.
POST /api/login
Authenticates an existing user and returns a fresh Bearer token. Each successful login creates a new personal access token namedapi-token.
Request headers
| Header | Value |
|---|---|
Content-Type | application/json |
Accept | application/json |
The email address associated with the account.
The account password.
200 OK
Human-readable confirmation — always
"Login successful" on success.The authenticated user object including their
role_id.A fresh plain-text Sanctum personal access token. Use this value in the
Authorization header for all subsequent protected requests.401 Unauthorized
Returned when the email does not exist or the password does not match.
Using the Token
Once you have a token, include it in theAuthorization header as a Bearer token on every request to a protected endpoint. The header value must use the exact format Bearer {token} — note the space between Bearer and the token string.
GET /api/wishlist
- Open your request in Postman.
- Click the Authorization tab.
- Set the Auth Type dropdown to Bearer Token.
- Paste your token into the Token field.
- Postman will automatically add the
Authorization: Bearer {token}header to the request.
Admin Access
Some endpoints require the authenticated user to hold theadmin role in addition to a valid token. All /api/roles/* endpoints are protected by the admin.api middleware, which checks that $request->user()->role->name === 'admin'.
403 Forbidden response when using a non-admin token:
Test Credentials
The database seeder provisions two ready-to-use accounts for local development and testing.| Password | Role | Access level | |
|---|---|---|---|
admin@example.com | admin123 | admin | Full access — all endpoints including /api/roles/* |
test@example.com | customer123 | customer | Wishlist endpoints only (/api/wishlist) |
These credentials are seeded by
DatabaseSeeder and are only intended for local development. Do not use them in a production environment.