Skip to main content

Save Cash Transfer Request API

Overview

Create a cash transfer request between users, allowing one user to request money from another user through the GafaPay system.

API Details

Endpoint

POST https://api.gafapay.com:8443/gafapay/v3/transaction/cash_transfer_request

Headers

companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
Content-Type: application/json
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3MTYwNzEzfQ.b3RU1QWT7N7WQQJ5kHAO2yptdnEO6vr-7GwdCAGUpCA

Request Body

{
"to_user_type": null,
"from_user_type": 2, // user
"to_user_detail": {
"dial_code": "+221",
"first_name": "test",
"last_name": "user",
"phone_number": "967468480",
"user_id": "",
"user_type": 0
},
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"from_user_detail": {
"dial_code": "+221",
"first_name": "Suresh",
"last_name": "Raina",
"phone_number": "968784529",
"user_id": "fb8f09210e0f46b7b4262d77f5b6c273",
"user_type": 2
},
"amount": 100,
"sender_txn_id": "9ce964d02d3a48ada60ee28b8d61c7d3",
"note": "Cash transfer to test user"
}

Request Parameters

  • to_user_type (integer, optional): Type of the recipient user
  • from_user_type (integer, optional): Type of the sender user
  • to_user_detail (object, required): Details of the recipient user
    • dial_code (string, required): Country dial code
      • Example: "+221"
    • first_name (string, required): Recipient's first name
      • Example: "test"
    • last_name (string, required): Recipient's last name
      • Example: "user"
    • phone_number (string, required): Recipient's phone number
      • Example: "967468480"
    • user_id (string, optional): Recipient's user ID
    • user_type (integer, required): Recipient's user type
      • Example: 0
  • from_user_detail (object, required): Details of the sender user
    • dial_code (string, required): Country dial code
      • Example: "+221"
    • first_name (string, required): Sender's first name
      • Example: "Suresh"
    • last_name (string, required): Sender's last name
      • Example: "Raina"
    • phone_number (string, required): Sender's phone number
      • Example: "968784529"
    • user_id (string, optional): Sender's user ID
    • user_type (string, optional): Sender's user type
  • currency_id (string, required): Currency identifier for the transaction
    • Example: "1f1519903ed240578f071aa45cb479f2"
  • amount (number, required): Amount to be transferred
    • Example: 100
  • sender_txn_id (string, required): Unique transaction ID from sender
    • Example: "9ce964d02d3a48ada60ee28b8d61c7d3"
  • note (string, optional): Additional note for the transaction

Response

{
"success": 1,
"error": [],
"data": {
"message": "TRANSACTION_CASH_TRANSFER_REQUEST_MADE_SUCCESSFULLY",
"cash_transfer_request_id": "8d917bd67d94d5b97d84b46209ec2b3"
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • message (string): Success message indicating cash transfer request was created
    • cash_transfer_request_id (string): Unique identifier for the cash transfer request

Example Usage

curl --location 'https://api.gafapay.com:8443/gafapay/v3/transaction/cash_transfer_request' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3MTYwNzEzfQ.b3RU1QWT7N7WQQJ5kHAO2yptdnEO6vr-7GwdCAGUpCA' \
--header 'Content-Type: application/json' \
--data '{
"to_user_type": null,
"from_user_type": 2, // user
"to_user_detail": {
"dial_code": "+221",
"first_name": "test",
"last_name": "user",
"phone_number": "967468480",
"user_id": "",
"user_type": 0
},
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"from_user_detail": {
"dial_code": "+221",
"first_name": "Suresh",
"last_name": "Raina",
"phone_number": "968784529",
"user_id": "fb8f09210e0f46b7b4262d77f5b6c273",
"user_type": 2
},
"amount": 100,
"sender_txn_id": "9ce964d02d3a48ada60ee28b8d61c7d3",
"note": "Cash transfer to test user"
}'

Notes

  • This API creates a cash transfer request that needs to be accepted by the recipient
  • The sender_txn_id should be a unique identifier generated by the sender's system
  • Both sender and recipient user details must be provided with valid phone numbers and dial codes
  • The amount field should contain the numeric value of the transfer amount
  • The currency_id should match a valid currency in the system
  • The response includes a cash_transfer_request_id that can be used to track the request status