Update User Threshold Master API
Overview
Update an existing user threshold master record with new values. This API allows you to modify threshold configurations such as minimum balance, maximum balance, user type, and other parameters for a specific user threshold master.
API Details
- Method: PUT
- URL: https://api.gafapay.com:8443/gafapay/v3/transaction/user_threshold_master
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: 5bb30135-1815-41d5-827f-baed3daba4af
- Authorization: Token required
Endpoint
PUT https://api.gafapay.com:8443/gafapay/v3/transaction/user_threshold_master
Headers
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: 5bb30135-1815-41d5-827f-baed3daba4af
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4
Content-Type: application/json
Request Body
{
"id": "41ebd05c2e614c22ba0e73ad330d2bd6",
"min_balance": 100.0,
"max_balance": 1000000.0,
"user_type": 2,
"name": "Updated Customer Threshold",
"is_modified": true
}
Request Parameters
- id (string, required): Unique identifier of the threshold master to update
- min_balance (number, optional): New minimum balance value
- max_balance (number, optional): New maximum balance value
- user_type (integer, optional): New user type value (2=USER, 3=MERCHANT)
- name (string, optional): New name for the threshold configuration
- is_modified (boolean, optional): Whether the threshold has been modified
- threshold_id (string, optional): New threshold configuration ID
- currency_id (string, optional): New currency identifier
cURL Request
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/transaction/user_threshold_master' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: 5bb30135-1815-41d5-827f-baed3daba4af' \
--header 'Content-Type: application/json' \
--data '{
"id": "41ebd05c2e614c22ba0e73ad330d2bd6",
"min_balance": 100.0,
"max_balance": 1000000.0,
"user_type": 2,
"name": "Updated Customer Threshold",
"is_modified": true
}'
Response
Success Response
{
"success": 1,
"error": [],
"data": {
"message": "USER_THRESHOLD_MASTER_UPDATE_SUCCESS"
}
}
Error Response - Threshold Master Not Found
{
"success": 0,
"error": ["USER_THRESHOLD_MASTER_DATA_NOT_FOUND"],
"data": {}
}
Error Response - Update Failed
{
"success": 0,
"error": ["USER_THRESHOLD_MASTER_UPDATE_FAILED"],
"data": {}
}
Error Response - Validation Error
{
"success": 0,
"error": ["USER_THRESHOLD_MASTER_UPDATE_ERROR: Invalid data provided"],
"data": {}
}
Response Fields
- success (integer): Status indicator
1= Success0= Failure
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message indicating the threshold master was updated successfully
Additional Examples
Update Only Balance Limits
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/transaction/user_threshold_master' \
--header 'authorization: Token YOUR_TOKEN' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"id": "41ebd05c2e614c22ba0e73ad330d2bd6",
"min_balance": 500.0,
"max_balance": 5000000.0
}'
Update User Type and Name
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/transaction/user_threshold_master' \
--header 'authorization: Token YOUR_TOKEN' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"id": "41ebd05c2e614c22ba0e73ad330d2bd6",
"user_type": 3,
"name": "Premium Customer Threshold",
"is_modified": true
}'
Notes
- Partial Updates: You can update any combination of fields in the request body
- Direct Fields: All fields are sent directly in the request body without a wrapper object
- Idempotent: Multiple calls with the same parameters will not cause issues
- Validation: The API validates that the threshold master exists before updating
- Company Access: Only threshold masters belonging to the authenticated user's company can be updated
- Audit Trail: The
updated_byandupdated_datefields are automatically updated - Required Fields: The
idfield is required to identify the record to update - Data Types: Ensure proper data types for numeric fields (min_balance, max_balance, user_type)
- Error Handling: The API provides specific error messages for different failure scenarios