Save User Wallet Lock API
Overview
Create a new user wallet lock record to lock funds in a user's wallet for a specific period. This API allows users to lock their wallet funds until a maturity date, preventing withdrawals during the lock period.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet_lock
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: b1910650-f892-496a-b5a3-b0560845c4a1
- Authorization: Token required
Endpoint
POST https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet_lock
Headers
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b1910650-f892-496a-b5a3-b0560845c4a1
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4
Content-Type: application/json
Request Body
{
"wallet_id": "3a3d4e585aeb49e8bf3f3996fca0f82f",
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"wallet_type": 3,
"locked_amount": 10.0,
"user_wallet_id": "e4946877f18946b299fddf0f2133dcba",
"locked_date": 1758639257,
"maturity_date": 1759157657
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
wallet_id | string | Yes | Unique identifier of the wallet |
currency_id | string | Yes | Unique identifier of the currency |
wallet_type | integer | Yes | Type of wallet (1=Main, 2=Category, 3=Saving, 4=Revenue, 5=Commission) |
locked_amount | double | Yes | Amount to be locked in the wallet |
user_wallet_id | string | Yes | Unique identifier of the user wallet |
locked_date | long | Yes | Unix timestamp when the amount was locked |
maturity_date | long | Yes | Unix timestamp when the lock expires |
cURL Request
curl --location 'https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet_lock' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b1910650-f892-496a-b5a3-b0560845c4a1' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "3a3d4e585aeb49e8bf3f3996fca0f82f",
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"wallet_type": 3,
"locked_amount": 10.0,
"user_wallet_id": "e4946877f18946b299fddf0f2133dcba",
"locked_date": 1758639257,
"maturity_date": 1759157657
}'
Response
{
"success": 1,
"error": [],
"data": {
"message": "Wallet lock created successfully",
"wallet_lock_id": "1fc5edbeceaf4f519ddafff4cfb47f20"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | integer | Status indicator (1 = success, 0 = failure) |
error | array | Array of error messages (empty on success) |
data.message | string | Success message |
data.wallet_lock_id | string | Unique identifier of the created wallet lock |
Error Responses
{
"success": 0,
"error": ["Wallet lock already exists for this user and wallet combination"],
"data": null
}
Use Cases
- Savings Lock: Users can lock funds in their savings wallet for a specific period
- Investment Lock: Lock funds for investment purposes with maturity dates
- Goal-based Savings: Create time-bound savings goals with locked amounts
- Financial Planning: Implement structured savings plans with lock periods