OpenAPI

This endpoint is used to request withdrawal of funds from Saxo to an external bank account. Any bank account must be pre-registered in Saxo Banks systems, either by transferring money into the Saxo Bank account from this external account or by contacting Saxo Bank to add the bank account. Futher information about the process can be found here: https://www.help.saxo/hc/en-us/articles/360001256303-How-do-I-withdraw-funds-

Both withdrawals from standard accounts (MT103) and from institutional accounts (MT202) are supported, with the message type being registered on the beneficiary instruction under "MessageType". 

The cash withdrawal process includes three steps which are described below.

Getting the maximum amount available for withdrawal

The maximum amount that can be withdrawn from an account depends on multiple factors, including cash reserved for margin positions or open orders. In order to know how much is available to withdraw the 'atr/v1/cashmanagement/withdrawallimits' endpoint can be used:

GET https://gateway.saxobank.com/sim/openapi/atr/v1/cashmanagement/withdrawallimits/?ClientKey=6LvV4vnUsU8782kJtBgnjQ==&AccountKey=1gm4hJD76DKVkt5XBSYyrw==
 
HTTP/1.1 200 OK
{
  "Data": [
    {
      "AccountKey": "1gm4hJD76DKVkt5XBSYyrw==",
      "ClientKey": "6LvV4vnUsU8782kJtBgnjQ==",
      "MaxAllowedWithdrawalAmount": 5920.45
    }
  ]
}

Listing available external bank accounts (beneficiary instructions)

The accounts that can be withdrawn to can be fetched via the 'atr/v1/cashmanagement/beneficiaryinstructions' endpoint

GET https://gateway.saxobank.com/sim/openapi/atr/v1/cashmanagement/beneficiaryinstructions/?ClientKey=6LvV4vnUsU8782kJtBgnjQ==
 
HTTP/1.1 200 OK
{
  "__count": 2,
  "Data": [
    {
      "BeneficiaryDetails": {
        "AccountNumber": "SSI#97935",
        "Bic": "DBSSSGSGXXX",
        "ClearingCode": "AU016338",
        "CountryCode": "DKK"
      },
      "BeneficiaryInstructionId": "97935",
      "ClientId": "9319113",
      "Currency": "DKK",
      "IntermediaryBank": {
        "AccountNumber": "S672538819",
        "Bic": "CITIUS33"
      },
      "MessageType": "MT202",
      "Name": "SSI#97935",
      "RegulatedBroker": {
        "AccountNumber": "ZYA6312001",
        "Name": "EXT LTD CLIENTS ACCOUNT"
      }
    },
    {
      "BeneficiaryDetails": {
        "AccountNumber": "SSI#97935",
        "Bic": "DBSSSGSGXXX",
        "ClearingCode": "AU016338",
        "CountryCode": "DKK"
      },
      "BeneficiaryInstructionId": "97935",
      "ClientId": "9319113",
      "Currency": "DKK",
      "IntermediaryBank": {
        "AccountNumber": "S672538819",
        "Bic": "CITIUS33"
      },
      "MessageType": "MT103", 
      "Name": "SSI#97935",
      "RegulatedBroker": {
        "AccountNumber": "ZYA6312001",
        "Name": "EXT LTD CLIENTS ACCOUNT"
      }
    }
  ]
}

At lot of information is returned here, mostly for helping select the correct account to withdraw to. The only property needed to request the withdrawal is the "BeneficiaryInstructionId" value.

Requesting the withdrawal

Now that the maximum amount available has been determined and a BeneficiaryInstructionId has been found, the actual withdrawal can be requested.

POST https://gateway.saxobank.com/sim/openapi/atr/v1/cashmanagement/withdrawals
{
  "AccountKey": "1gm4hJD76DKVkt5XBSYyrw==",
  "Amount": 2000,
  "BeneficiaryInstructionId": "97935",
  "Currency": "DKK"
}
 
HTTP/1.1 201 Created
{
  "CutExchangeRate": 1.0,
  "WithdrawalRequestId": "2425"
}

The withdrawal request has now been created and will be processed by Saxo.

Structure of MessageToBeneficiary field for MT202 messages

For MT202 messages this field is used to specify additional information to one of the parties involved in the transaction. Each type of information must start on a new line with a code word, and each additional line of the same type of information must start with a double forward slash. This field must not be used to repeat information that is already mentioned in another field.

The possible code words are:

  • /ACC/ to specify the payment details of your account number with your financial institution.
  • /BNF/ to specify the payment details to the final beneficiary’s financial institution.
  • /INS/ to specify the payment details to the ordering institution.
  • /INT/ to indicate that the following instructions are for the intermediary.
  • /REC/ to indicate that the following information is intended for Euroclear Bank.
  • /RFB/ to specify the payment details to the beneficiary.