Versions Compared

Key

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

...

...

Inputs (Array of

...

SwitchOrders) inherits from EntityBase

NameTypeDescriptionMandatoryAvailable from version
AccountGuidId of account where the allocation order should be created  true  2.32
AllocationItems AllocationItem[]List of AllocationItem   true  2.32
SellOrdersSellOrder[]List of SellOrder   true  2.32
BuyOrderSettlementTypeCommentEnum

Order settlement type is only applicable for orders with the Internal execution interface.

PAYMENT

CONFIRMATION

PRICE (Not supported)

 2.02SellOrderSettlementTypeEnum

Order settlement type is only applicable for orders with the Internal execution interface.

PAYMENT

CONFIRMATION

PRICE (Not supported)

 2.02string

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

Outputs

Name
Type
Description
Available from version
EntitiesArray

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

 

...

2.32


Code example

Code Block
languagec#
themeRDark
titleC# - Create Allocation 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"),
    IsUnitOrderSellPercentage = true,
    Amount = 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"),
			BuyOrderSettlementType = OrderSettlementType.CONFIRMATION,
            SellOrderSettlementType = OrderSettlementType.CONFIRMATION,
            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 + "," + c.Errors);
}

 


Blog Posts
sortcreation
contenttitles
labelscreateallocationorders