[!info] Overview The P2P Commission Part REST API manages individual commission parts in the BMMS billing system. Commission parts define the components of transaction fees, including fixed amounts and percentage-based charges that can be combined into commission groups.
📋 Table of Contents
Quick Reference
[!abstract] API Configuration
Entity Name: P2PCommissionPart
Controller: P2pCommissionPartResource
Framework: Spring Boot + JHipster
Auth: Required (Spring Security)
Content-Type: application/json
Endpoints Summary
Method
Endpoint
Description
Status
/api/p-2-p-commission-parts
Create new commission part
/api/p-2-p-commission-parts/{id}
/api/p-2-p-commission-parts/{id}
/api/p-2-p-commission-parts
/api/p-2-p-commission-parts/{id}
/api/p-2-p-commission-parts/count
/api/p-2-p-commission-parts/{id}
/api/p-2-p-commission-parts/{partId}/{groupId}
Delete part from specific group
P2pCommissionPartDTO Structure
[!note] Data Transfer Object Represents a commission part with amount and calculation type.
Field Specifications
Field
Type
Required
Max/Range
DB Column
Description
CommMultiplierType Enum
[!info] Commission Calculation Types Defines how the commission amount is applied.
Usage Examples:
PERCENT with amount = 1.5 → 1.5% of transaction
FIXED with amount = 1000 → 1000 UZS fixed fee
Create Commission Part
POST /api/p-2-p-commission-parts
Creates a new commission part entity.
Headers:
Body:
[!warning] Validation Rules
id must be null (auto-generated)
name must be non-empty and unique
commMultiplierType must be non-null (PERCENT or FIXED)
code must match pattern ^[a-zA-Z0-9]{1,15}$ (max 16 chars)
✅ Success (201 Created):
❌ Error (400 - Name exists):
❌ Error (400 - ID exists):
Update Commission Part
PUT /api/p-2-p-commission-parts/{id}
Completely updates an existing commission part.
Path Parameters
id (Long) - Commission part identifier
Headers:
Body:
[!warning] Validation
Path id must match body id
Commission part must exist in database
New name must be unique (if changed)
✅ Success (200 OK):
❌ Errors:
Partial Update Commission Part
PATCH /api/p-2-p-commission-parts/{id}
Updates only specified fields. Null fields are ignored.
Path Parameters
id (Long) - Commission part identifier
Headers:
Body (Example - update only amount):
Body (Example - update name and description):
[!tip] Partial Update Behavior
Only non-null fields are updated
Other fields remain unchanged
Perfect for updating single fields without affecting others
Name uniqueness is validated if name is being changed
✅ Success (200 OK):
Get All Commission Parts
GET /api/p-2-p-commission-parts
Retrieves paginated list with filtering criteria.
Query Parameters
Pagination:
page - Page number (0-indexed, default: 0)
size - Items per page (default: 20)
sort - Sort criteria (e.g., name,asc)
unPaged - Boolean for unpaged results
Filters (P2pCommissionPartCriteria):
name.contains, name.equals
code.equals, code.contains
commMultiplierType.equals - Filter by type
isResidualReceiver.equals - Filter by residual flag
Example Requests
✅ Success (200 OK):
Get Single Commission Part
GET /api/p-2-p-commission-parts/{id}
Retrieves a single commission part by ID with all relationships.
Path Parameters
id (Long) - Commission part identifier
✅ Success (200 OK):
❌ Error (404 Not Found):
Count Commission Parts
GET /api/p-2-p-commission-parts/count
Returns count of commission parts matching criteria.
Query Parameters
Same filtering parameters as [[#Get All Commission Parts]]
Example Requests
✅ Success (200 OK):
Delete Commission Part
DELETE /api/p-2-p-commission-parts/{id}
Deletes a commission part from the system.
Path Parameters
id (Long) - Commission part identifier
✅ Success (204 No Content):
❌ Error (400 - Part is in use):
[!danger] Deletion Constraint Warning A commission part cannot be deleted if:
It is referenced by any commission part group
The system performs this check before deletion:
Workaround: Remove the part from all commission groups before attempting deletion.
Delete Commission Part from Group
DELETE /api/p-2-p-commission-parts/{partId}/{groupId}
Removes a specific commission part from a specific group.
Path Parameters
partId (Long) - Commission part identifier
groupId (Long) - Commission part group identifier
✅ Success (204 No Content):
[!info] Use Case This endpoint is useful for:
Removing a part from a specific group without deleting the part entirely
Maintaining the part for use in other groups
Precise group membership management
Example 1: Create Percentage-Based Commission Part
Setup Percentage Fee Request:
Example 2: Create Fixed Amount Commission Part
Example 3: Create Residual Receiver Part
Setup Residual Receiver Request:
Example 4: Update Commission Amount
Update Fee Amount Request:
Response:
Example 5: Change Commission Type
[!example]- Convert from Percent to Fixed Request:
Example 6: Remove Part from Specific Group
[!example]- Remove from Group Request:
[!failure] RFC 7807 Problem Details All errors follow standardized format.
HTTP Status Codes
Code
Type
Description
Common Causes
Validation failure, ID mismatch, duplicate name, part in use
Invalid ID, deleted entity
Database error, exception
Validation Error Example
[!bug] Field Validation Errors
Validation Rules
Required Fields
[!check] Mandatory Fields
✅ name - Part name (unique)
✅ amount - Commission amount
✅ commMultiplierType - Calculation type (PERCENT or FIXED)
Field Constraints
"A new commission part cannot already have an ID"
"must not be empty", "name already exists"
"P2pCommissionPart amount can not be null"
"P2pCommissionPart multiplier type can not be null"
"size must be between 0 and 16", "must match pattern"
Code Pattern Validation
[!info] Code Field Rules
Pattern: ^[a-zA-Z0-9]{1,15}$
Max Length: 16 characters
Allowed Characters: Letters (a-z, A-Z) and numbers (0-9)
Examples:
✅ Valid: TXN_FEE, FEE123, COMMISSION1
❌ Invalid: TXN-FEE (contains hyphen), FEE_123 (contains underscore)
[!info] Business Validation
name must be globally unique across all commission parts
amount must be a valid positive number
commMultiplierType determines how amount is interpreted:
PERCENT: amount is percentage (e.g., 1.5 = 1.5%)
FIXED: amount is fixed sum (e.g., 1000 = 1000 UZS)
Commission part cannot be deleted if referenced by any group
Only one isResidualReceiver part recommended per configuration
code should be unique (recommended but not enforced)
🔧 cURL Command Reference
Delete from Group