createAccount
Creates a new chart of accounts
/Accounts
Usage and SDK Samples
xero_client.set_token_set(user.token_set)
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'
account = {
code: "123456",
name: "FooBar",
type: XeroRuby::Accounting::AccountType::EXPENSE,
description: "Hello World"
}
begin
response = xero_client.accounting_api.create_account(xero_tenant_id, account, idempotency_key)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling create_account: #{e}"
end
Scopes
accounting.settings | Grant read-write access to organisation and account settings |
Parameters
Name | Description |
---|---|
xero-tenant-id* |
String
Xero identifier for Tenant
Required
|
Idempotency-Key |
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
Name | Description |
---|---|
account * |
Account
Account object in body of request
Required
|