Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Inputs (Array of SwitchOrders) inherits from EntityBase

...

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 Block
languagec#
themeRDark
titleC# - Create Allocation Switch Orders in a BFS instance
linenumberstrue
collapsetrue
//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);
}

...