Funding your Margin Account

Processes a deposit or withdrawal between main balances and margin account balances. Requires an idempotency key to prevent duplicate operations. User should have enough balance to cover for the operation in margin account balances or main balances (depending the operation).

Important Restrictions

  • Account Status: The margin account must have INACTIVE or ACTIVE status to process any movement. Accounts with BLOCKED status cannot process movements.
  • Currency Availability: Only currencies available for margin trading can be deposited to the margin account. Check the Get Margin Available Currencies endpoint for the list of supported currencies.
  • Withdrawal Requirements: Withdrawals from margin account are only allowed when the withdrawal keeps the account healthy, meaning the margin level remains above the safe threshold after the operation. You can check the safe threshold and current margin level using the Get Margin Account Summary endpoint.

Endpoint URL

POST https://api.bitso.com/margin_trading/v1alpha/movements


Request

Headers

ParameterTypeDescriptionRequired
X-Idempotency-KeystringUnique key to prevent duplicate operationsYes

Fields

ParameterTypeDescriptionRequired
typestringType of movement. Possible values: DEPOSIT, WITHDRAWAL. Deposits are a transfer to margin account balances from main balances and increase total assets and margin level. Withdrawals are a transfer to main balances from margin account balances and reduce total assets and margin level.Yes
amountstringAmount to move from main balance to margin (for deposits) or from margin to main balance (for withdrawals)Yes
currencystringCurrency codeYes

Payload Example

{
  "type": "DEPOSIT",
  "amount": "1000.50",
  "currency": "btc"
}

Response

Fields

FieldTypeDescription
idstringUnique identifier for the movement
typestringType of movement. Values: DEPOSIT, WITHDRAWAL
amountstringAmount moved
currencystringCurrency code
created_atstringTimestamp when the movement was created

Payload Example

{
  "id": "22c19e48-280d-4775-a9d9-b971f83cd09d",
  "type": "DEPOSIT",
  "amount": "1000.50",
  "currency": "btc",
  "created_at": "2025-12-03T10:15:30Z"
}

Error

Responses

Status CodeError CodeError Message
422not_enough_balanceUser doesn't have enough balance to perform the requested operation.

Payload Example

{
  "errors": [
    {
      "code": "not_enough_balance",
      "message": "User doesn't have enough balance to perform the requested operation."
    }
  ]
}