CreateSwitchOrders

CreateSwitchOrders

Inputs (Array of SwitchOrders) inherits from EntityBase

Name

Type

Description

Mandatory

Available from version

Name

Type

Description

Mandatory

Available from version

Account

Guid

Id of account where the allocation order should be created

true

2.32

AllocationItems 

AllocationItem[]

List of AllocationItem. The list must contain at least one item, instruments that will be bought. 

true

2.32

SellOrders

SellOrder[]

List of SellOrder. The list must contain at least one item, instruments that will be sold. 

true

2.32

Comment

string

If you want comment text linked to the object

 

2.32

Reseller

Guid

The id of reseller that you want to connect to the switch order

 

2.32

ExternalReference

string

An external reference to the order

 

2.32

DecisionMakerWithinFirm

Guid

The id of the person that represents the decision maker within firm

 

2.34

DecisionMakers

Guid[]

The id of the persons that represents the decision makers

 

2.34

ExchangeAlgorithm

ExchangeAlgorithmEnum?

The exchange algorithm that should be used if currency exchange orders should be produced by the switch order

 

2.34

Outputs

Name

Type

Description

Available from version

Name

Type

Description

Available from version

Entities

Array

All switch orders in the request is returned along with each allocation orders BrickId, and array of Errors per allocation order

 2.32

 

Code example

//Create an allocation order with the CreateAllocationOrders method var client = new BFSServiceReference.bfsapiSoapClient(); var credentials = new BFSServiceReference.Credentials() { UserName = bfsusername, //Username of administrative user in your instance of BFS Password = bfspassword, //Password of the administrative user in your instance of BFS }; var AI1 = new AllocationItem() //The first allocation item { Asset = new Guid("138e92a5-f1d6-4473-9ca4-45f511881676"), AllocationPercentage = 0.5M }; var AI2 = new AllocationItem() //The second allocation item { Asset = new Guid("00257b66-0000-4ab7-9712-bf11aeabc3f7"), AllocationPercentage = 0.5M }; var SO1 = new SellOrder() { Asset = new Guid("60133aa1-a22d-4b0b-80fa-b35303a8c83f"), SellPercentage = 0.53M }; var response = client.CreateAllocationOrders(new BFSServiceReference.CreateAllocationOrdersRequest() { Credentials = credentials, identify = bfsidentifier, //Identifier is a unique token for your instance of BFS Entities = new[] { new AllocationOrder() { Account = new Guid("40045f57-9914-41d2-9ffd-a33a59de10c9"), AllocationItems = new [] { AI1, AI2 }, SellOrders = new [] { SO1 }, Reseller = new Guid("3bb24d5d-bab3-44bb-a6db-741f5c177e9d"), Comment = "This is a test", ExternalReference = "45906238-38d8-4539-b0ec-41a06f456bb7" }, } }); foreach (var c in response.Entities) { Console.WriteLine(c.BrickId); }