我想为Quickbook创建Account对象。然而,当我尝试的时候:
service.create(account_object)它返回错误:
Quickbooks::InvalidModelException: Classification is not included in the list我尝试输入一个默认值(https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/account),但返回相同的错误。
发布于 2015-07-22 00:37:12
帐户中的分类将类似于负债、收入、费用或资产等。
转到此URL https://developer.intuit.com/docs/api/accounting/Account
查看AccountType部分=>子属性
它包含了我们在创建帐户时可以使用所有分类和帐户类型列表
您可以使用以下示例代码来创建帐户
begin
oauth_client = OAuth::AccessToken.new($qb_oauth_consumer, token, secret)
service = Quickbooks::Service::Account.new(:access_token => oauth_client, :company_id => realm_id)
new_account = Quickbooks::Model::Account.new(:name => 'Undeposited money', :account_type => 'Other Current Asset', :classification => 'Asset' )
create_acccount = service.create(new_account)
rescue Exception => e
# e.message will show response of quickbooks for you request
puts e.message
# e.message.inspect will show logs
puts e.backtrace.inspect
endhttps://stackoverflow.com/questions/28220552
复制相似问题