Overview
The merchant login process authenticates your credentials and provides an access token that you'll use for all subsequent API requests. The login endpoint is specifically designed for merchants and differs from the admin login endpoint.
Copy POST /api/v2/auth/login Full Endpoint Example
Copy https://api.switchwallet.com/api/v2/auth/login
Copy Content-Type: application/json Field Descriptions
Field
Type
Required
Description
Your registered merchant email address
Example Requests
JavaScript/Node.js
Success Response
HTTP Status: 200 OK
Response Fields
Indicates if the login was successful
HTTP status code (200 for success)
Access token - Use this in the Authorization header for API requests
Token used to refresh your access token when it expires
Unix timestamp (milliseconds) when the token expires
Your registered email address
Array of user roles (e.g., ["Merchant"])
Error Responses
Invalid Credentials
HTTP Status: 400 Bad Request
Common Causes:
Email address not registered
Using Your Access Token
After successful login, include the token in all subsequent API requests using the Authorization header:
Example Request with Token
JavaScript Example
When your access token expires, use the refresh token to obtain a new access token.
Refresh Token Endpoint
Complete Login Flow Example
JavaScript/Node.js
Troubleshooting
Invalid Login Credentials
Problem: You're getting "Invalid Login Credentials" error.
Solutions:
Verify your email address is correct (check for typos)
Ensure your password is correct
Make sure you're using the email you registered with
Try resetting your password if you've forgotten it
If you've forgotten your password:
Request a password reset OTP: POST /api/v2/auth/password-reset/otp
Complete password reset: POST /api/v2/auth/password-reset
KYC/KYB Status Issues
Problem: Login is blocked due to KYC/KYB status.
Solutions:
UnVerified: Complete your Know Your Business (KYB) verification
Initiated/InProgress: Wait for verification to complete
Rejected: Review the rejection reason and resubmit your KYB documents
Note: Sandbox accounts typically don't require KYC verification.
Problem: Your API requests are returning 401 Unauthorized.
Solutions:
Use the refresh token endpoint to get a new access token
If refresh token also expired, log in again to get new tokens
Email Not Found
Problem: Getting "Invalid Login Credentials" but email seems correct.
Solutions:
Confirm you registered as a merchant (not admin)
Check if you completed the registration process
Contact support if you believe your account should exist
Security Best Practices
Never Share Your Credentials
Keep your email and password secure
Don't commit tokens to version control
Use environment variables for credentials
Token Storage
Store tokens securely (environment variables, secure storage)
Don't log tokens in console or files
Implement token refresh logic
HTTPS Only
Always use HTTPS endpoints
Never send credentials over unencrypted connections
Token Expiration
Monitor token expiration times
Implement automatic token refresh
Re-authenticate when refresh tokens expire
Merchant Login vs Admin Login
Important: This guide is for merchant login only .
Merchant Login: POST /api/v2/auth/login (this guide)
Admin Login: POST /api/v2/auth/admin/login (different endpoint, not covered here)
The merchant login endpoint:
Requires a merchant account (not admin account)
Validates merchant KYC/KYB status
Returns merchant-specific data
Has different authorization requirements
Next Steps After Login
Once you've successfully logged in:
Store Your Token - Save the access token for API requests
Check Wallet Status - Verify your wallet addresses are available
Review Account Settings - Check your merchant profile
Explore API Endpoints - Start making authenticated API calls
Set Up Webhooks - Configure payment notifications
API Reference Summary
Endpoint
Method
Description
/api/v2/auth/refreshToken
/api/v2/auth/password-reset/otp
Request password reset OTP
/api/v2/auth/password-reset
For additional help:
Documentation: https://docs.switchwallet.com
API Status: https://status.switchwallet.com
Last Updated: November 2025
Last updated 3 months ago