Wallet Refund Money API
Overview
Process refund transactions for wallet-based payments, allowing users to get their money back from previous transactions.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/transaction/wallet_refund_money
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
- Authorization: Token required
Endpoint
POST https://api.gafapay.com:8443/gafapay/v3/transaction/wallet_refund_money
Request Body
{
"initial_txn_id": "905ec61662594ecc8d5a52a431dc39d8",
"wallet_id": "4010122e9d604e798b9a6e961df3e5b4",
"payment_response": null,
"card_info": null,
"txn_amount": 10,
"txn_code": "MR",
"txn_status": null,
"payment_mode": 3,
"note": null,
"txn_device_info": {
"device_name": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
"os_name": "MacIntel",
"location": {},
"host_name": "localhost",
"url": "http://localhost:9000"
},
"debit_user_info": {
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"debit_type": 1,
"debit_type_id": "4010122e9d604e798b9a6e961df3e5b4",
"debit_account_type": 3,
"debit_account_type_id": "b52aef3999ea4545a868a772377699a3",
"username": "Hardik Pandya"
},
"credit_user_info": {
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"credit_type": 1,
"credit_type_id": "4010122e9d604e798b9a6e961df3e5b4",
"credit_account_type": 2,
"credit_account_type_id": "fb8f09210e0f46b7b4262d77f5b6c273",
"username": "Suresh Raina"
},
"company_admin_user_info": {
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"credit_type": 1,
"credit_type_id": "4010122e9d604e798b9a6e961df3e5b4",
"credit_account_type": 1,
"credit_account_type_id": "640b793d04e2428dbf19ab10399f4edb",
"username": "Mouhamad Amine"
}
}
Request Parameters
- initial_txn_id (String, required): Initial transaction ID from the original transaction
- Example:
905ec61662594ecc8d5a52a431dc39d8
- Example:
- wallet_id (String, required): Wallet ID from the Main Wallet API
- Example:
4010122e9d604e798b9a6e961df3e5b4
- Example:
- txn_amount (Double, required): Amount to be refunded
- Example:
10
- Example:
- txn_code (String, required): Transaction code for refund
- Example:
MR(Money Refund) orCR(Credit Refund)
- Example:
- payment_mode (Integer, required): Payment mode identifier
- Example:
3
- Example:
- debit_user_info (Object, required): Information about the debit user (logged-in user)
- credit_user_info (Object, required): Information about the credit user
- company_admin_user_info (Object, required): Information about the company admin user
- txn_device_info (Object, required): Device information for transaction tracking
- note (String, optional): Transaction note
- charges_info (Object, optional): Charges information from Calculate Charges API if applicable
Response
{
"success": 1,
"error": [],
"data": {
"message": "TRANSACTION_WALLET_REFUND_MONEY_SUCCESS",
"transaction": {
"txn_number": "22431869",
"txn_id": "fbfc7835ae9e494e8f5888e2ee3e9d0c",
"txn_status": 3
}
}
}
Response Fields
- success (integer): Response status indicator
1= Success0= Failure
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message indicating refund completion
- transaction (object): Transaction details object
Transaction Object Fields
- txn_number (string): Transaction number for the refund
- txn_id (string): Unique transaction identifier
- txn_status (integer): Transaction status code
Example Usage
curl --location 'https://api.gafapay.com:8443/gafapay/v3/transaction/wallet_refund_money' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{"initial_txn_id": "YOUR_INITIAL_TXN_ID", "wallet_id": "YOUR_WALLET_ID", "txn_amount": 10, "txn_code": "MR"}'
Notes
- This API requires the
initial_txn_idfrom the original transaction to process the refund - The
txn_codeshould be set to "MR" (Money Refund) or "CR" (Credit Refund) for refund transactions - All user information (debit, credit, company admin) must be provided with proper currency and account type details
- Device information is captured for transaction tracking and security purposes
- The refund amount (
txn_amount) should match the amount being refunded from the original transaction - Currency ID and wallet ID values can be referenced from the Common Transaction Flow documentation