User Management & Session Guide

User registration, login/logout session tokens, and user profile management.

View as Markdown

The User Management API enables registering new users, managing user credentials, handling authentication sessions, and retrieving user profiles.


1. Creating Users

Single User Registration

Create a single user record via POST /user:

Request Payload (POST /v3/user)
1{
2 "id": 1,
3 "username": "johndoe",
4 "firstName": "John",
5 "lastName": "Doe",
6 "email": "john.doe@example.com",
7 "password": "SecurePassword123!",
8 "phone": "+1-555-0199",
9 "userStatus": 1
10}

Batch User Import

Import an array or list of users in a single atomic request using POST /user/createWithList:

Request Payload (POST /v3/user/createWithList)
1[
2 {
3 "id": 1,
4 "username": "johndoe",
5 "email": "john.doe@example.com"
6 },
7 {
8 "id": 2,
9 "username": "janesmith",
10 "email": "jane.smith@example.com"
11 }
12]

2. User Authentication & Sessions

User Login

Authenticate credentials and obtain an active session token:

1GET /v3/user/login?username=johndoe&password=SecurePassword123! HTTP/1.1
2Host: api.plantstore.dev
3Accept: application/json
Response Payload (200 OK)
1{
2 "code": 200,
3 "type": "SUCCESS",
4 "message": "logged in user session: sess_98a7b6c5d4e3f210"
5}

The returned session token should be stored securely and passed in subsequent calls.

User Logout

Invalidate the active user session token:

1GET /v3/user/logout HTTP/1.1
2Host: api.plantstore.dev

3. User Profile Operations

Fetching User Details

Retrieve public user profile data by username:

1GET /v3/user/johndoe HTTP/1.1
2Host: api.plantstore.dev

Updating User Data

Modify account settings using PUT /user/{username}:

Request Payload (PUT /v3/user/johndoe)
1{
2 "id": 1,
3 "username": "johndoe",
4 "firstName": "Johnathan",
5 "lastName": "Doe",
6 "email": "johnathan.doe@example.com",
7 "phone": "+1-555-0200"
8}

Deleting a User

Remove a user record permanently:

1DELETE /v3/user/johndoe HTTP/1.1
2Host: api.plantstore.dev

Deleting a user permanently clears their profile. Any open orders associated with the user account must be closed or transferred prior to deletion.