Users
Get and update your user profile, change your password, and check completion status
Retrieve and update your user profile, change your password, and check your profile completion status.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/users/me | Get your current user profile |
| PATCH | /v1/users/me | Update your profile |
| POST | /v1/users/change-password | Change your password |
| GET | /v1/users/me/completion | Check profile completion percentage |
All endpoints on this page require authentication. Include your access token in the
Authorizationheader or pass your API key in theX-API-Keyheader. See Authentication for details.
Get Current User
Retrieve the profile of the currently authenticated user.
curl https://e-invoicing.earnipay.com/v1/users/me \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."{
"statusCode": 200,
"message": "User profile retrieved successfully.",
"data": {
"id": "usr_abc123",
"email": "[email protected]",
"firstName": "Ada",
"lastName": "Okafor",
"phone": "+2348012345678",
"isEmailVerified": true,
"defaultBusinessId": "biz_xyz789",
"createdAt": "2025-11-15T10:30:00.000Z",
"updatedAt": "2026-03-01T14:22:00.000Z"
}
}Update Profile
Update your first name, last name, or phone number. Send only the fields you want to change.
curl -X PATCH https://e-invoicing.earnipay.com/v1/users/me \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"firstName": "Adaeze",
"phone": "+2348098765432"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
firstName | string | No | Your first name |
lastName | string | No | Your last name |
phone | string | No | Phone number (include country code) |
{
"statusCode": 200,
"message": "Profile updated successfully.",
"data": {
"id": "usr_abc123",
"email": "[email protected]",
"firstName": "Adaeze",
"lastName": "Okafor",
"phone": "+2348098765432",
"isEmailVerified": true,
"defaultBusinessId": "biz_xyz789",
"createdAt": "2025-11-15T10:30:00.000Z",
"updatedAt": "2026-03-11T09:15:00.000Z"
}
}Change Password
Change your password while logged in. Provide your current password for verification and your new password.
curl -X POST https://e-invoicing.earnipay.com/v1/users/change-password \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"currentPassword": "oldPassword123",
"newPassword": "newSecurePassword456"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
currentPassword | string | Yes | Your current password |
newPassword | string | Yes | New password (minimum 8 characters) |
{
"statusCode": 200,
"message": "Password changed successfully."
}Changing your password does not invalidate existing access tokens. To fully sign out of all sessions, call
POST /v1/auth/logoutwith each refresh token after changing your password.
Profile Completion
Check how complete your profile is. Use this to prompt users to fill in missing information like phone number or business setup.
curl https://e-invoicing.earnipay.com/v1/users/me/completion \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."{
"statusCode": 200,
"message": "Profile completion status retrieved.",
"data": {
"completionPercentage": 75,
"completedSteps": [
"email_verified",
"name_added",
"business_created"
],
"remainingSteps": [
"phone_added"
]
}
}Use the remainingSteps array to guide users through completing their profile. A fully completed profile (100%) typically includes: verified email, name, phone number, and at least one business created.
Error Handling
| Status Code | Error | Description |
|---|---|---|
400 | Bad Request | Invalid parameters (e.g., new password too short) |
401 | Unauthorized | Missing or expired access token |
403 | Forbidden | Current password is incorrect (change password) |
{
"statusCode": 403,
"message": "Current password is incorrect.",
"error": "Forbidden"
}Updated 2 days ago