Safe withdrawal sequence
1
Create a durable operation
Generate a unique CRM reference and store the withdrawal as
PENDING before sending the request.2
Send the request once
Call
/investor/withdraw with the CRM reference in comment.3
Persist the full outcome
Store requested and effective amounts, pending fee, available balance, and
mt5_deal_id.4
Reconcile uncertainty
If the HTTP outcome is unknown, inspect the MT5 balance and fee records before considering another request.
5
Complete locally
Mark the CRM operation
COMPLETED only after the executed result is known.Safe unassignment sequence
- Resolve the active relationship with
/info/investor/{login}/master. - Send
/subscriptions/unassignonce. - If the response is
PAUSED, poll/info/subscriptions; do not repeat the command. - Complete the CRM workflow only when the subscription is
CANCELLEDandended_atis populated.
Critical rules
Previous: Asynchronous operations
Review polling and completion conditions.
Next: Errors
Handle HTTP failures without creating inconsistent state.