Response field
[!info] Overview The ResponseField REST API manages response field configurations for payment transaction results in the pkbillms billing system. ResponseFields define which data fields are returned from backend services, their visibility, formatting, and display order with multilingual support.
📋 Table of Contents
Quick Reference
[!abstract] API Configuration
Base URL:
/apiEntity Name:
ResponseFieldController:
ResponseFieldResourceFramework: Spring Boot + JHipster
Auth: Required (Spring Security)
Content-Type:
application/json
Endpoints Summary
POST
/api/response-fields
Create new response field
201
PUT
/api/response-fields/{id}
Full update
200
PATCH
/api/response-fields/{id}
Partial update
200
GET
/api/response-fields
Get all with pagination
200
GET
/api/response-fields/{id}
Get by ID
200
GET
/api/response-fields/count
Count by criteria
200
DELETE
/api/response-fields/{id}
Delete response field
204
Data Models
ResponseField Specifications
id
Long
❌ Auto
-
Primary key
name
String
✅
128
Response field name (account_id, phone, etc.)
visibility
Visibility
❌
ENUM
UI visibility setting
ord
Integer
❌
-
Display order
requestType
RequestType
❌
ENUM
Transaction type association
type
ResponseFieldType
❌
ENUM
Field data type
amountRatio
Integer
❌
-
Amount fraction (1=sum, 100=tiyin)
active
Boolean
❌
-
Activation status
recipient
RecipientDTO
✅
-
Payment recipient reference
labels
Set
✅
-
Multilingual labels
Visibility Enum
RequestType Enum
ResponseFieldType Enum
API Endpoints
Create ResponseField
POST
/api/response-fieldsCreates a new response field configuration.
Request
Headers:
Body:
[!warning] Validation Rules
idmust be null (auto-generated)
name,recipient, andlabelsare required
namemax length is 128 charactersAt least one label translation required
Response
✅ Success (201 Created):
❌ Error (400 - ID exists):
Update ResponseField
[!example] PUT
/api/response-fields/{id}Updates an existing response field (full update).
Request
Headers:
Body:
[!warning] Validation Rules
idmust match path parameter
idmust not be nullResponseField must exist in database
Response
✅ Success (200 OK):
❌ Error (400 - Invalid ID):
❌ Error (400 - Not found):
Partial Update
[!example] PATCH
/api/response-fields/{id}Partially updates response field properties.
Request
Headers:
Body:
Response
✅ Success (200 OK):
❌ Error (404 - Not Found):
Get All ResponseFields
[!example] GET
/api/response-fieldsRetrieves all response fields with pagination and filtering.
Request
Headers:
Query Parameters:
page
Integer
❌
Page number (default: 0)
size
Integer
❌
Page size (default: 20)
sort
String
❌
Sort field and direction
unPaged
Boolean
❌
Disable pagination
Example:
Response
✅ Success (200 OK):
ResponseFieldCriteria - Advanced Filtering
[!abstract] JHipster Criteria Filtering ResponseFieldCriteria provides powerful filtering capabilities for querying response fields. All filter parameters support multiple operators for precise data retrieval.
Available Filter Types
String Filters:
equals
Exact match
name.equals=account_balance
notEquals
Not equal
name.notEquals=temp_field
in
Match any value
name.in=account_id,phone,login
notIn
Not in list
name.notIn=hidden,test
contains
Partial match
name.contains=balance
doesNotContain
Doesn't contain
name.doesNotContain=temp
specified
Field exists/null
name.specified=true
Numeric Filters (Long, Integer):
equals
Exact match
id.equals=5
notEquals
Not equal
amountRatio.notEquals=1
in
Match any value
id.in=1,2,3,4,5
notIn
Not in list
id.notIn=99,100
greaterThan
Greater than
ord.greaterThan=5
lessThan
Less than
ord.lessThan=10
greaterOrEqualThan
Greater or equal
amountRatio.greaterOrEqualThan=100
lessOrEqualThan
Less or equal
amountRatio.lessOrEqualThan=100
specified
Field exists/null
ord.specified=true
Boolean Filters:
equals
Exact match
active.equals=true
notEquals
Not equal
active.notEquals=false
specified
Field exists/null
active.specified=true
Enum Filters (Visibility, RequestType, ResponseFieldType):
equals
Exact match
visibility.equals=ALL
notEquals
Not equal
visibility.notEquals=HIDDEN
in
Match any value
requestType.in=CHECK,PAY,STATUS
notIn
Not in list
visibility.notIn=HIDDEN
specified
Field exists/null
requestType.specified=true
ResponseFieldCriteria Parameters
Common Query Examples
Filter by Recipient:
Filter by Request Type:
Filter Active Fields:
Filter by Visibility:
Filter by Type:
Search by Name:
Filter Amount Ratio:
Complex Filter (AND operation):
Combining Filters
[!tip] Multiple Criteria All criteria are combined with AND logic. Use
.inoperator for OR logic on same field.
Example:
Get Single ResponseField
[!example] GET
/api/response-fields/{id}Retrieves a single response field by ID.
Request
Headers:
Example:
Response
✅ Success (200 OK):
❌ Error (404 - Not found):
Count ResponseFields
[!example] GET
/api/response-fields/countCounts response fields matching criteria.
Request
Headers:
Query Parameters: Any ResponseFieldCriteria filters.
Example:
Response
✅ Success (200 OK):
Delete ResponseField
[!example] DELETE
/api/response-fields/{id}Deletes a response field.
Request
Headers:
Example:
Response
✅ Success (204 No Content):
Error Handling
Error Response Format
HTTP Status Codes
200
OK
Successful GET/PUT/PATCH
201
Created
Successful POST
204
No Content
Successful DELETE
400
Bad Request
Validation error
401
Unauthorized
Missing/invalid authentication
403
Forbidden
Insufficient permissions
404
Not Found
Resource doesn't exist
500
Internal Server Error
Server error
Validation Rules
Required Fields
[!check] Mandatory Fields
✅
name- Response field name✅
recipient- Payment recipient reference✅
labels- At least one label translation
Field Constraints
id
Null for POST
"A new responseField cannot already have an ID"
id
Not null for PUT/PATCH
"Invalid id"
name
@NotNull, @Size(max=128)
"must not be null", "size must be between 0 and 128"
recipient
@NotNull
"must not be null"
labels
@NotNull
"must not be null"
Business Rules
[!info] Business Validation
nameidentifies the field in backend response (e.g., account_id, phone, balance)
visibilitycontrols where the field is displayed (UI, printer, monitor)
requestTypedetermines which transaction type this field belongs to
typedefines data formatting (TEXT, AMOUNT, DATE)
amountRatiospecifies amount division: 1 for sum, 100 for tiyin (cents)
activeflag enables/disables the field in responses
orddetermines display order in UI
labelsmust include at least one language translation
🔧 cURL Command Reference
Create
Update
Partial Update
Get All
Get by Criteria
Get Single
Count
Delete
📝 Notes
[!tip] Best Practices
Set appropriate
visibilityfor each field based on requirementsUse
HIDDENfor system fields not meant for user displaySet
amountRatioto 100 for tiyin/cents, 1 for sum/dollarsAlways provide translations for all supported languages
Use meaningful
namevalues that match backend response keysSet proper
ordvalues for consistent display orderUse
requestTypeto organize fields by transaction type
[!warning] Important
namemust match the field name in backend service responsesDeleting response fields may affect transaction display
amountRatiois critical for proper amount formattingInactive fields (
active=false) will not appear in responses
HIDDENvisibility still stores data but hides from UI
📊 Amount Ratio Explained
[!info] Amount Ratio Usage The
amountRatiofield determines how amounts are divided:amountRatio = 1:
Amount is in major currency unit (sum, dollar, euro)
Example: 50000 = 50,000 sum
amountRatio = 100:
Amount is in minor currency unit (tiyin, cents)
Example: 5000000 = 50,000.00 sum (5,000,000 tiyin ÷ 100)
Common Use:
Last updated