[!info] Overview The Setting REST API manages payment transaction settings and configurations in the pkbillms billing system. Settings define terminal properties, merchant configurations, and system parameters required for processing payments through various payment gateways (UZCARD, PAYNET, HUMO, WAY4).
📋 Table of Contents
Quick Reference
[!abstract] API Configuration
Controller: SettingResource
Framework: Spring Boot + JHipster
Auth: Required (Spring Security)
Content-Type: application/json
Endpoints Summary
Method
Endpoint
Description
Status
Setting Specifications
Field
Type
Required
Max/Range
Description
Map<Prop, SettingProperty>
Configuration properties map
SettingProperty Specifications
Field
Type
Required
Max/Range
DB Column
Description
POST /api/settings
Creates a new payment setting configuration.
Headers:
Body:
[!warning] Validation Rules
id must be null (auto-generated)
shortName and active are required
shortName max length is 64 characters
props map must contain valid Prop keys
Each property must have valid key, type, and value
✅ Success (201 Created):
❌ Error (400 - ID exists):
[!example] PUT /api/settings/{id} Updates an existing payment setting (full update).
Headers:
Body:
[!warning] Validation Rules
id must match path parameter
Setting must exist in database
✅ Success (200 OK):
❌ Error (400 - Invalid ID):
❌ Error (400 - Not found):
[!example] PATCH /api/settings/{id} Partially updates setting properties.
Headers:
Body:
✅ Success (200 OK):
❌ Error (404 - Not Found):
Get All Settings
[!example] GET /api/settings Retrieves all payment settings with pagination and filtering.
Headers:
Query Parameters:
Parameter
Type
Required
Description
Example:
✅ Success (200 OK):
SettingCriteria - Advanced Filtering
[!abstract] JHipster Criteria Filtering SettingCriteria provides powerful filtering capabilities for querying payment settings. All filter parameters support multiple operators for precise data retrieval.
Available Filter Types
String Filters:
Operator
Description
Example
shortName.equals=UZCARD_TERMINAL_01
shortName.notEquals=TEST_TERMINAL
shortName.in=TERM01,TERM02
shortName.contains=UZCARD
shortName.doesNotContain=TEST
Numeric Filters (Long, Integer):
Operator
Description
Example
Boolean Filters:
Operator
Description
Example
SettingCriteria Parameters
Common Query Examples
Filter Active Settings:
Filter by Name:
Filter by Display Order:
Search Specific Terminals:
Active Settings Only:
Complex Filter (AND operation):
Combining Filters
[!tip] Multiple Criteria All criteria are combined with AND logic. Use .in operator for OR logic on same field.
Example:
Get Single Setting
[!example] GET /api/settings/{id} Retrieves a single payment setting by ID.
Headers:
Example:
✅ Success (200 OK):
❌ Error (404 - Not found):
[!example] GET /api/settings/count Counts payment settings matching criteria.
Headers:
Query Parameters: Any SettingCriteria filters.
Example:
✅ Success (200 OK):
[!example] DELETE /api/settings/{id} Deletes a payment setting.
Headers:
Example:
✅ Success (204 No Content):
HTTP Status Codes
Missing/invalid authentication
Validation Rules
Required Fields
[!check] Mandatory Fields
✅ shortName - Setting name
✅ active - Activation status
✅ props - Properties map (can be empty)
Field Constraints
"A new setting cannot already have an ID"
"must not be null", "size must be between 0 and 64"
SettingProperty Constraints
@NotNull, Valid Prop enum
"must not be null", "must be valid Prop value"
"must not be null", "must be valid PropType value"
@NotNull, @Size(max=5000)
"must not be null", "size must be between 0 and 5000"
[!info] Business Validation
shortName identifies the setting in UI
props is a Map with Prop enum as key and SettingProperty as value
Each SettingProperty must have a unique key within the setting
type determines how value should be parsed (TEXT, JSON, BOOLEAN)
value max length is 5000 characters for JSON configurations
Boolean values must be stored as strings: "true" or "false"
JSON values must be valid JSON format
active flag enables/disables the entire setting
🔧 cURL Command Reference
Get by Criteria
📊 Property Types Explained
[!info] PropType Usage Guide
Used for simple string values:
Used for complex configurations:
Used for flags (stored as string):
[!warning] Important Notes
JSON values must be properly escaped
Boolean values are strings: "true" or "false"
Value field max length is 5000 characters
Invalid JSON will cause parsing errors
🔐 Security Considerations
[!warning] Sensitive Data Settings may contain sensitive information:
Passwords: Store encrypted or hashed
API Keys: Use secure vault when possible
Credentials: Never log in plain text
Access Control: Restrict who can view/modify settings
Best Practices:
Encrypt sensitive values before storing
Use environment variables for critical secrets
Audit all setting modifications
Implement role-based access control
Mask passwords in API responses
[!tip] Best Practices
Use meaningful shortName values for easy identification
Set appropriate ord values for UI display order
Group related properties under single setting
Use JSON type for complex configurations
Always validate JSON values before saving
Keep property values under 5000 characters
Document each property's purpose
[!warning] Important
Deleting settings may affect payment processing
Inactive settings will not be used by payment gateways
Changing terminal IDs requires gateway reconfiguration
Props map uses Prop enum as key - case sensitive
Boolean values must be strings: "true" or "false"
JSON values must be valid and properly escaped