{"action":"created","issue":{"url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/220","labels_url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/220/comments","events_url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/220/events","html_url":"https://github.com/ruckus/quickbooks-ruby/issues/220","id":57255068,"number":220,"title":"ItemRef required to create an invoice","user":{"login":"bretweinraub","id":214091,"avatar_url":"https://avatars.githubusercontent.com/u/214091?v=3","gravatar_id":"","url":"https://api.github.com/users/bretweinraub","html_url":"https://github.com/bretweinraub","followers_url":"https://api.github.com/users/bretweinraub/followers","following_url":"https://api.github.com/users/bretweinraub/following{/other_user}","gists_url":"https://api.github.com/users/bretweinraub/gists{/gist_id}","starred_url":"https://api.github.com/users/bretweinraub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bretweinraub/subscriptions","organizations_url":"https://api.github.com/users/bretweinraub/orgs","repos_url":"https://api.github.com/users/bretweinraub/repos","events_url":"https://api.github.com/users/bretweinraub/events{/privacy}","received_events_url":"https://api.github.com/users/bretweinraub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-10T23:34:16Z","updated_at":"2015-02-11T00:15:43Z","closed_at":null,"body":"This works via the API (https://developer.intuit.com/v2/apiexplorer?apiname=V3QBO#?id=Invoice)\r\n\r\n    <Invoice xmlns=\"http://schema.intuit.com/finance/v3\">\r\n      <DocNumber>385</DocNumber>\r\n      <TxnDate>2015-02-10 04:22:59 UTC</TxnDate>\r\n      <Line>\r\n    \t<Amount>100</Amount>\r\n        <DetailType>SalesItemLineDetail</DetailType>\r\n        <SalesItemLineDetail>\r\n          <ItemRef>1</ItemRef>\r\n        </SalesItemLineDetail>\r\n      </Line>\r\n      <CustomerRef type=\"Customer\">99</CustomerRef>\r\n    </Invoice>\r\n\r\nNote the use of ItemRef.  If I use the quickbooks-ruby API, I get something like this:\r\n\r\n    <Invoice xmlns=\"http://schema.intuit.com/finance/v3\" sparse=\"false\">\r\n      <Line>\r\n    \t<Amount>100</Amount>\r\n    \t<DetailType>SalesItemLineDetail</DetailType>\r\n    \t<SalesItemLineDetail>\r\n    \t  <Name>.......</Name>\r\n    \t  <Type>Inventory</Type>\r\n    \t  <IncomeAccountRef name=\"Services\" type=\"Account\">1</IncomeAccountRef>\r\n    \t</SalesItemLineDetail>\r\n      </Line>\r\n      <CustomerRef type=\"Customer\">99</CustomerRef>\r\n    </Invoice>\r\n\r\nWhich QBO hates and sends back an error like:\r\n\r\n     <Fault type=\"ValidationFault\"><Error code=\"2020\" element=\"Line.SalesItemLineDetail\">         <Message>Required param missing, need to supply the required value for the API</Message><Detail>Required parameter Line.SalesItemLineDetail is missing in the request</Detail></Error></Fault>\r\n\r\nUsing the API explorer, I can only seem to get an invoice created using the \"ItemRef\" model, although I can't use quickbooks-ruby to create it [although I will shortly attempt to hack same].\r\n"},"comment":{"url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/comments/73812658","html_url":"https://github.com/ruckus/quickbooks-ruby/issues/220#issuecomment-73812658","issue_url":"https://api.github.com/repos/ruckus/quickbooks-ruby/issues/220","id":73812658,"user":{"login":"bretweinraub","id":214091,"avatar_url":"https://avatars.githubusercontent.com/u/214091?v=3","gravatar_id":"","url":"https://api.github.com/users/bretweinraub","html_url":"https://github.com/bretweinraub","followers_url":"https://api.github.com/users/bretweinraub/followers","following_url":"https://api.github.com/users/bretweinraub/following{/other_user}","gists_url":"https://api.github.com/users/bretweinraub/gists{/gist_id}","starred_url":"https://api.github.com/users/bretweinraub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bretweinraub/subscriptions","organizations_url":"https://api.github.com/users/bretweinraub/orgs","repos_url":"https://api.github.com/users/bretweinraub/repos","events_url":"https://api.github.com/users/bretweinraub/events{/privacy}","received_events_url":"https://api.github.com/users/bretweinraub/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T00:15:43Z","updated_at":"2015-02-11T00:15:43Z","body":"Here are the original and modified docs.....\r\n\r\n    --- REQUEST --- \r\n    \r\n    <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n    <Invoice xmlns=\"http://schema.intuit.com/finance/v3\" sparse=\"false\">\r\n      <Line>\r\n    \t<Amount>1686.28109</Amount>\r\n    \t<DetailType>SalesItemLineDetail</DetailType>\r\n    \t<SalesItemLineDetail>\r\n    \t  <Type>Inventory</Type>\r\n    \t  <IncomeAccountRef name=\"Services\" type=\"Account\">1</IncomeAccountRef>\r\n    \t</SalesItemLineDetail>\r\n      </Line>\r\n      <CustomerRef type=\"Customer\">99</CustomerRef>\r\n    </Invoice>\r\n    \r\n    --- Modified REQUEST --- \r\n    \r\n    <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n    <Invoice xmlns=\"http://schema.intuit.com/finance/v3\" sparse=\"false\">\r\n      <Line>\r\n    \t<Amount>1686.28109</Amount>\r\n    \t<DetailType>SalesItemLineDetail</DetailType>\r\n    \t<SalesItemLineDetail><ItemRef>1</ItemRef></SalesItemLineDetail>\r\n      </Line>\r\n      <CustomerRef type=\"Customer\">99</CustomerRef>\r\n    </Invoice>\r\n"}}