CreateSwitchOrders

Inputs (Array of SwitchOrders) inherits from EntityBase

NameTypeDescriptionMandatoryAvailable from version
AccountGuidId of account where the allocation order should be createdtrue2.32
AllocationItems AllocationItem[]List of AllocationItem. The list must contain at least one item, instruments that will be bought. true2.32
SellOrdersSellOrder[]List of SellOrder. The list must contain at least one item, instruments that will be sold. true2.32
Commentstring

If you want comment text linked to the object


2.32
ResellerGuid

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


2.32
ExternalReferencestringAn external reference to the order
2.32
DecisionMakerWithinFirmGuidThe id of the person that represents the decision maker within firm
2.34
DecisionMakersGuid[]The id of the persons that represents the decision makers
2.34
ExchangeAlgorithmExchangeAlgorithmEnum?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
EntitiesArray

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

C# - Create Switch Orders in a BFS instance
//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);
}


Blog stream

Create a blog post to share news and announcements with your team and company.


Related pages

Terms of License
Change Policy
© 2009 - 2024 Huddlestock Technologies AB All rights reserved