Save User Wallet API
Overview
Create a new user wallet record to associate a user with a specific wallet. This API allows users to be linked to wallets with specific currency configurations and default settings.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: 57f5da28-1362-410c-b914-6398bcf308e9
- Authorization: Token required
Endpoint
POST https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet
Headers
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: 57f5da28-1362-410c-b914-6398bcf308e9
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4
Content-Type: application/json
Request Body
{
"wallet_id": "3a3d4e585aeb49e8bf3f3996fca0f82f",
"user_id": "e4946877f18946b299fddf0f2133dcba",
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"is_default": false
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
wallet_id | string | Yes | Unique identifier of the wallet to associate with the user |
user_id | string | Yes | Unique identifier of the user |
currency_id | string | Yes | Unique identifier of the currency for this wallet association |
is_default | boolean | Yes | Whether this wallet should be set as the user's default wallet |
cURL Request
curl --location 'https://api.gafapay.com:8443/gafapay/v3/transaction/user_wallet' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU4OTY2OTAzfQ.4e8MwJFrhoh2-vSvyR-s828TmEbgpYp-ocHlfo3Fnu4' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: 57f5da28-1362-410c-b914-6398bcf308e9' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "3a3d4e585aeb49e8bf3f3996fca0f82f",
"user_id": "e4946877f18946b299fddf0f2133dcba",
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"is_default": false
}'
Response
{
"success": 1,
"error": [],
"data": {
"message": "TRANSACTION_USER_WALLET_SAVED_SUCCESS"
}
}
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 indicating the user wallet was saved successfully |
Integration Notes
- Idempotent: Multiple calls with the same parameters will not create duplicates
- Atomic Operation: The wallet association is created as a single database operation
- Consistent State: All related data (wallet, user, currency) must be valid for successful creation