Overview
The Ecom API uses Laravel Sanctum for authentication. After successful login or signup, you’ll receive an access token that must be included in subsequent API requests.Authentication Flow
- User signs up or logs in
- API returns an access token
- Include token in
Authorizationheader for protected endpoints
Register User
Request
User’s full name
Email address or phone number (based on register_by)
Registration method:
email or phonePassword (minimum 6 characters)
Password confirmation (must match password)
reCAPTCHA response (if enabled)
Response
Success status
Success or error message
Bearer token for authentication
Token type (always “Bearer”)
User information
Example
Login
Request
Email address or phone number
User password
Login method:
email or phoneUser type:
customer, seller, or delivery_boyIdentity verification matrix
Response
Same structure as signup response.Example
Social Login
Request
Provider name:
facebook, google, twitter, or appleAccess token from social provider
Secret token (required for Twitter)
Provider ID
Get User Info
Example
Logout
Response
Email Verification
Resend Verification Code
Confirm Verification Code
6-digit verification code
Password Reset
Request Password Reset
Confirm Reset
Resend Reset Code
Account Deletion
Get User by Access Token
User’s access token
Using the Access Token
Include the access token in theAuthorization header for all protected endpoints: