Appearance
Initiate a transfer
Creates a pending transfer and returns the recipient's name. No money moves until you confirm.
POST /api/v1/transfer
Body
| Field | Type | Required | Description |
|---|---|---|---|
recipient | string | Yes | The recipient's Xash user number. |
amount | number | Yes | More than 0, at most 99999999.99. |
currency | string | Yes | A currency your wallet holds, for example USD. |
reference | string | No | A note stored with the transfer. Up to 50 characters. This is a label only: it does not make the request safe to repeat. |
Example
bash
curl -X POST https://app.xash.co.zw/api/v1/transfer \
-H "Authorization: Bearer YOUR_SERVER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"recipient":"1098765432","amount":2.5,"currency":"USD","reference":"Float top-up"}'Response 200
json
{
"success": true,
"message": "Transfer initiated successfully.",
"data": {
"id": "00000000-0000-7000-8000-0000000000f1",
"recipient": "1098765432",
"first_name": "Rudo Trading",
"last_name": "Sample",
"amount": "2.5",
"currency": "USD",
"reference": "Float top-up"
}
}Keep id for the confirm call. first_name is the recipient's business name when they have one, otherwise their first name.
Errors
| Status | When | message |
|---|---|---|
400 | The recipient is your own account. | You cannot transfer to yourself. |
400 | Your balance is lower than the amount. | You do not have enough balance to make this transaction. |
422 | The amount is over a spending limit on your server tokens. No transfer is created. | error_code is LIMIT_PER_TRANSACTION or LIMIT_DAILY. |
422 | No account has this user number, or a field is invalid. | Validation error |