πŸ” POST /move_balance

Transfers a specified amount from one account to another.


πŸ“Œ Summary

  • Method: POST
  • URL: /move_balance
  • Auth: Required
  • Tag: accounts

πŸ” Headers

Authorization: Bearer <your-token>
Content-Type: application/json

πŸ“€ Request Parameters

Name Type Required Description
from_uuid string βœ… UUID of the source account
to_uuid string βœ… UUID of the destination account
amount number βœ… Amount to transfer (must be > 0)

πŸ“₯ Example Request

{
  "from_uuid": "acc-2024-abc",
  "to_uuid": "acc-2024-def",
  "amount": 2500
}

βœ… Success Response

{
  "success": true,
  "status": 200,
  "message": "Moved 2500 from Emergency to Farming",
  "from_uuid": "acc-2024-abc",
  "to_uuid": "acc-2024-def",
  "amount": 2500,
  "start_time": "2025-07-10T12:42:15.155Z",
  "end_time": "2025-07-10T12:42:15.190Z",
  "execution_time": 0.035
}

❌ Failure Response Examples

Status Reason
400 Missing or invalid amount
400 Missing from_uuid or to_uuid
404 Source or target account not found
500 Internal server error

🧠 Notes

  • This action internally calls from_account$move_balance().
  • The operation is atomic and wrapped in a file lock for consistency.
  • Will fail if source or target account doesn’t exist, or if balance is insufficient.

πŸ’– Sponsors

Support my work through GitHub Sponsors!

GitHub Sponsors