Overview
The Tenant Management API provides endpoints for managing tenant accounts, including tenant creation, configuration, and status management. Tenants represent separate organizations or instances within the multi-tenant jshERP system. Base Path:/tenant
CRUD Operations
Get Tenant Information
Tenant record ID
Response status code (200 for success)
Tenant entity object
Get Tenant List
JSON string containing search filters:
loginName: Filter by login nametype: Filter by tenant typeenabled: Filter by enabled statusremark: Filter by remark text
Array of TenantEx objects with extended information
Total number of records matching the search criteria
Create Tenant
Unique tenant business ID
Associated login name
Maximum number of users allowed
Tenant type:
0: Free tenant1: Paid tenant
Tenant enabled status
Expiration date (format: yyyy-MM-dd HH:mm:ss)
Additional remarks or notes
Update Tenant
Tenant record ID
Associated login name
Maximum number of users allowed
Tenant type (0: free, 1: paid)
Tenant enabled status
Expiration date
Additional remarks
Delete Tenant
Tenant record ID to delete
Response status code
Batch Delete Tenants
Comma-separated tenant IDs (e.g., “1,2,3”)
Response status code
Tenant Management
Check Tenant Name Exists
Tenant record ID (0 for new tenant)
Login name to check
true if name exists, false otherwiseBatch Set Tenant Status
Status to set:
true: Enable tenantsfalse: Disable tenants
Comma-separated tenant IDs
Response status code
Data Models
Tenant Entity
Unique tenant record identifier
Tenant business identifier (used throughout the system)
Associated login name for the tenant account
Maximum number of users allowed for this tenant
Tenant type:
0: Free tenant (limited features)1: Paid tenant (full features)
Tenant enabled status:
true: Tenant is activefalse: Tenant is disabled
Timestamp when the tenant was created
Expiration timestamp for the tenant subscription
Additional remarks or notes about the tenant
Soft delete flag (used internally)
Tenant Types
Free Tenant (Type: 0)
- Limited number of users
- Basic features only
- May have restricted functionality
- No expiration date required
Paid Tenant (Type: 1)
- Higher user limits
- Full feature access
- Requires expiration date
- Premium support
Common Use Cases
Creating a New Tenant
- Check if the tenant name exists using
/tenant/checkIsNameExist - Create the tenant using
/tenant/addwith appropriate limits - Configure the expiration date for paid tenants
- Set the user limit based on subscription plan
Managing Tenant Expiration
- Retrieve tenant information using
/tenant/info - Check the
expireTimefield - Update the expiration date using
/tenant/updatewhen renewing - Monitor tenant status - expired tenants are automatically disabled
Disabling Multiple Tenants
- Collect tenant IDs to disable
- Use
/tenant/batchSetStatuswithstatus: false - Verify changes using
/tenant/list
Best Practices
Error Codes
| Code | Description |
|---|---|
| 200 | Success |
| 500 | Internal server error |
All endpoints return a standard response format with
code and data fields. Check the code field to determine success or failure.