Versions Compared

Key

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

...

Code Block
languagec#
themeRDark
titleResult in console
linenumberstrue
83adad04-02db-4dae-a5da-50b15d5fedbc,CapitalInsuranceAccount
95e3bf07-3f18-4f35-9365-1a8339493e78,HouseAccountingAccount
9c296549-41c9-4aef-bd48-e9602584f098,IPSAccount
2848b95f-8bf4-462e-8db3-2020f049e184,HouseSystemAccount
4d639562-1234-4b05-ba97-f4da03542278,HoldingAccount
20af188c-f6be-4fb7-9ae1-9d579143ea32,InheritedIRAAccount
8364af96-6a26-45a9-8e8e-3a3eaf91029e,FundAccount
bc610399-c33f-4681-a443-8886947692d8,ISKAccount
f2fa06d2-ff2c-4d4a-9a21-cb77157f41c3,CounterpartyAccount
cdc125ed-78c6-41a0-b385-f253144539ed,HouseCustodyAccount

 

 

 For the currency code I will navigate to System Data -> Currencies in the GUI of BFS to see what currencies are available.

Image Added

I will use SEK as my currency of choice.

With the code below I will create the new account and write the returned account number in the console.

Code Block
languagec#
themeRDark
titleC# - Create a new account with CreateAccount()
linenumberstrue
//Create a new account with the CreateAccount 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 response = client.CreateAccounts(new BFSServiceReference.CreateAccountRequest()
{    
    Credentials = credentials,
    
    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS
    Entities = new[]
    {
        new Account()
        {
            AccountTypeKey = "HoldingAccount",
            Owner = bnuserbrickid,
            OwnerAccountLabel = "Test",
            BaseCurrencyCode = "SEK",
            ExternalReference = "123456789",
            AccountStatus = 1,
            RequestReference = "My system reference"
        }
    }
    
});
foreach (var c in response.Entities)
{
    Console.WriteLine(c.AccountNo);
}
Code Block
languagec#
themeRDark
titleResult in console
linenumberstrue
10000685

And this is how it looks in BFS.

Image Added