Skip to main content
POST
/
api
/
transfer
{
  "payment_response": {
    "payment_id": null,
    "state": "-2",
    "substate": "0",
    "code": "0",
    "id": "123456789"
  },
  "error": "",
  "success": true
}

Overview

Execute a money transfer from your merchant account to any phone number in supported countries. This endpoint processes the actual transfer and debits your account.
Important: Always call Check Transfer before executing a transfer to validate parameters and check receiver status.

Endpoint

POST /api/transfer

Authentication

API-KEY
string
required
Your CashQ API Key for authentication
Content-Type
string
required
Must be application/json

Request Body

The request body parameters are identical to Check Transfer.
id
string
required
Unique numeric identifier for this transfer. Should match the ID used in Check Transfer. Must be numeric only.
sender_phone
string
required
Sender’s phone number in E.164 format (e.g., "+15615019469")
receiver_phone
string
required
Receiver’s phone number in E.164 format (e.g., "+201234567890")
amount
string
required
Transfer amount in dollars (e.g., "5.0" for $5.00)
service
string
required
ID of corridor (e.g., "1271" for EGP). Payment attributes depend on the corridor and will be provided for the requested corridor upon request.
receiver_country
string
required
Country code of receiver (e.g., "MX" for Mexico, "EG" for Egypt).
receiver_currency
string
required
Currency code for the receiver (e.g., "MXN" for Mexican Peso, "EGP" for Egyptian Pound)
attribute
array
required
Array of corridor-specific payment attributes. Required attributes vary by corridor and include receiver details, bank information, address, and identification. Contact support for specific corridor requirements.
Important: approvelyId AttributeIf you’re using the Payout API with our Payin API, you must include the approvelyId attribute to link the payout with the payin transaction:
{
  "name": "approvelyId",
  "value": "46364493"
}
Without this attribute, the transaction will be created but will wait for automated/manual reconciliation checking, which may cause delays.

Request Example

curl -X POST 'https://api.cashqbot.com/api/transfer' \
  -H 'API-KEY: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "123456789",
    "sender_phone": "+15551234567",
    "receiver_phone": "+525551234568",
    "amount": "5.0",
    "service": "1234",
    "receiver_country": "MX",
    "receiver_currency": "MXN",
    "attribute": []
  }'

Response

success
boolean
required
Indicates if the transfer was initiated successfully
error
string
Error message if transfer failed, empty string if successful
payment_response
object
Transfer response details

Response Examples

{
  "payment_response": {
    "payment_id": null,
    "state": "-2",
    "substate": "0",
    "code": "0",
    "id": "123456789"
  },
  "error": "",
  "success": true
}

Complete Transfer Flow

Follow this recommended flow for executing transfers:
1

Check balance

Verify you have sufficient funds using Get Balance
const balance = await getBalance();
if (balance.balance + balance.overdraft < amountInCents) {
  throw new Error('Insufficient funds');
}
2

Check KYC

Verify receiver’s KYC status using Check KYC
const kyc = await checkKYC(receiverPhone);
if (parseFloat(kyc.money_limit) < amount) {
  throw new Error('Amount exceeds receiver limit');
}
3

Validate transfer

Call Check Transfer to validate parameters
const validation = await checkTransfer(transferData);
if (!validation.success) {
  throw new Error('Validation failed');
}
4

Execute transfer

Call this endpoint to execute the transfer
const result = await executeTransfer(transferData);
5

Monitor status

Use Check Status to monitor transfer completion
const status = await pollTransferStatus(transferId);

Transfer States

After initiating a transfer, monitor its status:
StateDescriptionAction
0NewTransfer created, processing starting
40ProcessingTransfer in progress
60SuccessTransfer completed successfully
80ErrorTransfer failed
-2Not FoundTransfer ID not found
See the complete Status Codes Reference for all possible states.

Error Responses

Error CodeDescriptionSolution
authentication_errorInvalid or missing API keyVerify your API key
insufficient_fundsNot enough balanceAdd funds or reduce amount
invalid_phone_numberPhone number format incorrectUse E.164 format without +
invalid_amountAmount is invalidCheck amount is positive and formatted correctly
kyc_not_verifiedReceiver KYC limits exceededReduce amount or ask receiver to verify
duplicate_transferTransfer ID already usedUse a unique transfer ID
internal_server_errorServer error occurredRetry the request

Best Practices

Call Check Transfer before executing to catch errors early and check receiver status.
Generate unique IDs for each transfer. Reusing IDs may cause duplicate transfer errors.
Verify sufficient funds to avoid insufficient balance errors.
Poll the status endpoint to track transfer completion and handle any issues.
Inform users when sending to new receivers about the 6-hour expiration window.
Store transfer IDs and results to prevent duplicate transfers if requests are retried.
Keep detailed logs of all transfer attempts for debugging and reconciliation.