...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <CreateAccounts xmlns="http://tempuri.org/"> <req> <Credentials> <UserName>yourusername</UserName> <Password>yourpassword</Password> </Credentials> <identify>youridentifier</identify> <Entities> <Account> <BrickId>00000000-0000-0000-0000-000000000000</BrickId> <OwnerAccountLabel>Test</OwnerAccountLabel> <Owner>9eefe173-8d54-4dc3-b8f7-5ac7bccdeec6</Owner> <AccountTypeKey>HoldingAccount</AccountTypeKey> <BaseCurrencyCode>SEK</BaseCurrencyCode> <AccountStatus xsi:nil="true" /> <AllocationTemplate>00000000-0000-0000-0000-000000000000</AllocationTemplate> <ExternalReference>123456789</ExternalReference> </Account> </Entities> </req> </CreateAccounts> </s:Body> |
Code examples
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
//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",
AcquisitionValueCalculationMethod = "Average"
}
}
});
foreach (var c in response.Entities)
{
Console.WriteLine(c.AccountNo);
} |
Blog Posts | ||||||
---|---|---|---|---|---|---|
|
...