quickbooks vendor credit error message - quickbooks

When I sent the following XML to QuickBooks Desktop cloud, I received the following error which I don't understand. Googled but didn't find anything relating. Does anyone know what the source column is?
error message received:
p_validate_txn_ln - unable to find src_column_name_id per ref id acc_id = 39 idDomain = QB
<Object xsi:type="VendorCredit"><Header>
<DocNumber>8D1FC366607</DocNumber>
<TxnDate>2013-09-11</TxnDate>
<Note>Expense Report 09/11/2013 #2</Note>
<VendorName>E100</VendorName>
<TotalAmt>-25.00</TotalAmt>
<APAccountName>Accounts Payable</APAccountName></Header>
<Line>
<Desc>Airfare:</Desc>
<Amount>25.00</Amount>
<ClassId idDomain="QB">5</ClassId>
<ReimbursableInfo>
<CustomerId idDomain="QB">5</CustomerId>
<JobId idDomain="QB">6</JobId>
</ReimbursableInfo>
<BillableStatus>NotBillable</BillableStatus>
<AccountId idDomain="QB">39</AccountId>
</Line>
</Object>

After not including AccountId or ItemId, I was able to send the create VendorCredit object fine. Got success response. However after I ran sync manager, go to QB Desktop, find the Account, the vendorCredit is not there. Any advice?
XML sent:
<Object xsi:type="VendorCredit">
<Header>
<DocNumber>58B58878D79</DocNumber>
<TxnDate>2013-09-12</TxnDate>
<Note>Expense Report 09/12/2013 #2</Note>
<VendorName>E100</VendorName>
<TotalAmt>-43.80</TotalAmt>
<APAccountName>Accounts Payable</APAccountName>
</Header>
<Line>
<Desc>Advertising:</Desc>
<Amount>43.80</Amount>
<ClassId idDomain="QB">1</ClassId>
<ReimbursableInfo>
<CustomerId idDomain="QB">4</CustomerId>
<JobId idDomain="QB">8</JobId>
</ReimbursableInfo>
</Line>
</Object>
Response received:
<?xml version="1.0" encoding="UTF-8"?>
<RestResponse>
<Success RequestId="4a3f1538a01b4a4dac6f03406c6710c7">
<VendorCredit>
<Id idDomain="NG">14542796</Id>
<SyncToken>1</SyncToken>
<MetaData>
<CreatedBy>app</CreatedBy>
<CreateTime>2013-09-12T23:41:38Z</CreateTime>
<LastModifiedBy>app</LastModifiedBy>
<LastUpdatedTime>2013-09-12T23:41:38Z</LastUpdatedTime>
</MetaData>
<Synchronized>false</Synchronized>
<Header>
<DocNumber>58B58878D79</DocNumber>
<TxnDate>2013-09-12T00:00:00Z</TxnDate>
<Note>Expense Report 09/12/2013 #2</Note>
<VendorName>E100</VendorName>
<TotalAmt>-43.8</TotalAmt>
<APAccountName>Accounts Payable</APAccountName>
</Header>
<Line>
<Id idDomain="NG">50786642</Id>
<Desc>Advertising:</Desc>
<Amount>43.8</Amount>
<ClassId idDomain="QB">1</ClassId>
<ReimbursableInfo>
< CustomerId idDomain="QB">4</CustomerId>
<JobId idDomain="QB">8</JobId>
</ReimbursableInfo>
</Line>
</VendorCredit>
<RequestName>VendorCreditAdd</RequestName><ProcessedTime>2013-09-12T23:41:38Z</ProcessedTime>
</Success>
</RestResponse>

Although the docs mention AccountId as a required field, it is not(the docs might be slightly off). You can ignore it. if you chooss to add it then all fields related to Items need to included.
Instead ItemId is a required field. So, please include it in your request.
Please refer:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/vendorcredit
I created a vendor create request as follows and was able to get the correct response.
Request-
<Add xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RequestId="Szey2z7hrGf888888888jfc5hrGSYg99" xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 ./RestDataFilter.xsd">
<Object xsi:type="VendorCredit">
<Header>
<DocNumber>8D1FC366607</DocNumber>
<TxnDate>2013-09-11</TxnDate>
<Note>Expense Report 09/11/2013 #2</Note>
<VendorName>TestVendor4</VendorName>
<TotalAmt>-25.00</TotalAmt>
<APAccountName>Accounts Payable</APAccountName>
</Header>
<Line>
<Desc>Airfare:</Desc>
<Amount>25.00</Amount>
<ClassId idDomain="QB">1</ClassId>
<ReimbursableInfo>
<CustomerId idDomain="QB">31</CustomerId>
</ReimbursableInfo>
<BillableStatus>NotBillable</BillableStatus>
<ItemId idDomain="QB">12</ItemId>
</Line>
</Object>
</Add>
Response-
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="Szey2z7hrGf888888888jfc5hrGSYg99">
<ObjectRef>
<Id idDomain="NG">1925041</Id>
<SyncToken>1</SyncToken>
<LastUpdatedTime>2013-09-12T07:50:34Z</LastUpdatedTime>
</ObjectRef>
<RequestName>VendorCreditAdd</RequestName>
<ProcessedTime>2013-09-12T07:50:34Z</ProcessedTime>
</Success>
</RestResponse>
Edit for the questions asked:
*Please note:*
VendorCredit is an AP transaction representing a credit from a third party for returned goods or services not rendered. In QuickBooks desktop versions, a vendor credit is also known as a "bill credit". That is, it is a credit that a vendor owes you because you overpaid your bill, returned merchandise, or for some other reason. The VendorCredit is not applied until it is referenced in a Bill Payment transaction.
Note: A VendorCredit should not be confused with a Credit Memo, which is something you owe your customer
ItemId refers to those items for which the credit is made. You can get the ItemId by calling the Item api in QBD. Refer is in your request here.
Since, you are not mentioning the itemid in your request xml, you got the response but the sync to QB desktop file failed. You Vendor credit object must have errored out.
To check if the entity is in an error state, you can check by executing a query and setting ErroredObjectsOnly="true".
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0100_Calling_Data_Services/0015_Retrieving_Objects#Objects_in_Error_State
If the entity is in error state, you can query for the specific reason using the SyncStatus API:
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/SyncStatus
Please add the itemid reference in your request and it should work.

http://support.quickbooks.intuit.com/support/articles/SLN74445
QuickBooks has detected that you have no items When trying to enter an Invoice or a Sales Receipt without an item this warning is received:
QuickBooks has detected that you have no items or that one or more of your amounts are not associated with items. Please enter an item.
Why this is happening
If "Require Accounts" is checked in the Preferences this warning will occur.
How to fix it
To be able to enter in an Invoice or Sales Receipt without an Item on it:
1. Click the Edit Menu.
2. Click Preferences...
3. Click Accounting Preference> Company Preferences.
4. Uncheck Require accounts.
5. Click OK.
You will now be able to enter an Invoice or a Sales Receipt without an item on it.

Related

Quickbooks error message: something has been deleted

When we sent some data to Quickbooks Online to sync up, the following error was returned. The values looked fine. How to further investigate this problem?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FaultInfo xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
<Message>Something you're trying to use has been deleted. Check the fields with accounts, customers, items, vendors or employees.</Message>
<ErrorCode>-20403</ErrorCode>
<Cause>SERVER</Cause>
</FaultInfo>
<?xml version="1.0" encoding="UTF-8"?>
<Bill xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbo">
<Header>
<DocNumber>D968866A85B</DocNumber>
<TxnDate>2014-05-18</TxnDate>
<Note>April Home Based Expenses</Note>
<VendorId>2014</VendorId>
<TotalAmt>-150.00</TotalAmt>
</Header>
<Line>
<Desc>Internet/Online Fees:Home Based Expenses:Troy Cable</Desc>
<Amount>50.00</Amount>
<ClassId idDomain="QBO">3000000000000299133</ClassId>
<AccountId idDomain="QBO">51</AccountId>
</Line>
<Line>
<Desc>Mobile/Cellular Phone:Home Based Expenses:Verizon Wireless</Desc>
<Amount>100.00</Amount>
<ClassId idDomain="QBO">3000000000000299133</ClassId>
<AccountId idDomain="QBO">51</AccountId>
</Line>
</Bill>
I searched online and found that could be a bad bank account. But no bank account is in this XML string we sent.
Either your vendor, 2014, or account, 51, reference has been deleted. Check each manually on QBO or with an API call.

QBO unable to upload invoice

My task is to upload an invoice to UK QuickBooks Online.
I always get an error:
"You must select a product/service or an account for each split line with either an amount or a billable $$customer$$."
My XML request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:ns3="http://www.intuit.com/sb/cdm/qbo">
<Header>
<TxnDate>2013-11-30</TxnDate>
<CustomerId idDomain="QBO">1</CustomerId>
<TaxAmt>6.8</TaxAmt>
<BillAddr>
<Line1>Alex</Line1>
<Line2>Test</Line2>
<Line3>Prague</Line3>
</BillAddr>
<ShipAddr>
<Line1>Test</Line1>
<Line2>Prague</Line2>
</ShipAddr>
<BillEmail></BillEmail>
<DiscountTaxable>false</DiscountTaxable>
</Header>
<Line>
<Desc>Internet connection</Desc>
<Amount>34</Amount>
<Taxable>true</Taxable>
<ItemId>3</ItemId>
<UnitPrice>34</UnitPrice>
<Qty>1.00</Qty>
</Line>
How can I solve this problem?
Thanks.
It looks like you're using the v2 APIs, which only support the USA QuickBooks Online editions.
Have you tried using the v3 APIs, which use a global tax model which supports what you're trying to do?

Intuit Partner Platform QBD API v2: Invoice create / update doesn't seem to recognize item Amount, Price & Quantity

I am trying export Invoices from my app to QuickBooks Desktop. The invoice gets created, and I get a success message, but the QuickBooks Desktop app does not reflect the Amount, Price or Quantity sent through the API.
Here is a request / response example of one such operation:
Request:
<?xml version="1.0"?>
<Mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2" RequestId="6ffd7874b723b84ad2eba8146c12fda1">
<ExternalRealmId>MY_REALM_ID</ExternalRealmId>
<Object xsi:type="Invoice">
<Id idDomain="NG">2064384</Id>
<SyncToken>4</SyncToken>
<Header>
<DocNumber>100009</DocNumber>
<TxnDate>2013-10-16</TxnDate>
<Status>Pending</Status>
<CustomerId idDomain="QB">2</CustomerId>
<CustomerName>Jenny Cliff</CustomerName>
<RemitToId idDomain="QB">2</RemitToId>
<RemitToName>Jenny Cliff</RemitToName>
<ShipDate>2013-10-16</ShipDate>
<SubTotalAmt>950.0</SubTotalAmt>
<TaxRate>0.0</TaxRate>
<TaxAmt>0.0</TaxAmt>
<TotalAmt>950.0</TotalAmt>
<ToBePrinted>true</ToBePrinted>
<ToBeEmailed>false</ToBeEmailed>
<ARAccountId idDomain="QB">40</ARAccountId>
<ARAccountName>Accounts Receivable</ARAccountName>
<DueDate>2013-10-17</DueDate>
<BillAddr>
<Line1>217 E Washington Ave,</Line1>
<City>Sunnyvale</City>
<Country>USA</Country>
<CountrySubDivisionCode>CA</CountrySubDivisionCode>
<PostalCode>94086</PostalCode>
<Tag>Billing</Tag>
</BillAddr>
<ShipAddr>
<Line1>217 E Washington Ave,</Line1>
<City>Sunnyvale</City>
<CountrySubDivisionCode>CA</CountrySubDivisionCode>
<PostalCode>94086</PostalCode>
<Default>false</Default>
<Tag>Shipping</Tag>
</ShipAddr>
<Balance>950.0</Balance>
</Header>
<Line>
<Desc>Test Item 1</Desc>
<Amount>500.0</Amount>
<UnitPrice>500.0</UnitPrice>
<Qty>1</Qty>
</Line>
<Line>
<Desc>Test Item 2</Desc>
<Amount>450.0</Amount>
<UnitPrice>450.0</UnitPrice>
<Qty>1</Qty>
</Line>
</Object>
</Mod>
Response:
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="6ffd7874b723b84ad2eba8146c12fda1">
<ObjectRef>
<Id idDomain="NG">2064384</Id>
<SyncToken>5</SyncToken>
<LastUpdatedTime>2013-10-16T17:45:06Z</LastUpdatedTime>
</ObjectRef>
<RequestName>InvoiceMod</RequestName>
<ProcessedTime>2013-10-16T17:45:06Z</ProcessedTime>
</Success>
</RestResponse>
Documentation reference can be found here.
Per the documentation:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/invoice
For each node you specify, you MUST also specify an Item node. From the docs:
ItemId
IdType
Required
ID for the Item object. A reference to the Item is required for the Create operation, either the ItemId or ItemName; ItemId is preferred.
Change your XML request so that you're referring to an item.
This mirrors the behavior of the QuickBooks GUI.

Creating Sales Receipt with Sales Tax QBO API

I am trying to create a sales receipt with tax included. I understand that the SalesTaxCodeId/SalesTaxCodeName has not been implemented for the Quickbooks API v2, so I'm trying to directly add a tax rate through the field. Here is my request:
<SalesReceipt xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:ns3="http://www.intuit.com/sb/cdm/qbo">
<Header>
<CustomerId idDomain="QBO">10</CustomerId>
<TaxRate>5.00</TaxRate>
<DepositToAccountId>52</DepositToAccountId>
</Header>
<Line>
<Id>1</Id>
<Desc>asdfdsafds</Desc>
<Amount>500.00</Amount>
<Taxable>true</Taxable>
<ItemId idDomain="QBO">5</ItemId>
<Qty>1</Qty>
<AccountId>52</AccountId>
</Line>
However, I'm getting a rather cryptic error as a response.
<Message>You must select a product/service or an account for each split line with either an amount or a billable $$customer$$.</Message><ErrorCode>BAD_REQUEST</ErrorCode><Cause>-13012</Cause>
This error only occurs if the tax rate results in a non-zero tax amount. i.e. if the tax rate is non-zero and the line item is taxable, otherwise the request goes through fine. The error code does not exist in any documentation I can find and the error message is not all that helpful. Does anyone have any ideas on how to resolve this issue?
EDIT: updated itembyid response
<Id idDomain="QBO">5</Id>
<SyncToken>2<SyncToken>
<MetaData>
<CreateTime>2013-06-07T15:07:29-07:00</CreateTime>
<LastUpdatedTime>2013-08-02T14:34:47-07:00</LastUpdatedTime>
</MetaData>
<Name>Clothes</Name>
<Taxable>true</Taxable>
<UnitPrice>
<Amount>123</Amount>
</UnitPrice>
<IncomeAccountRef>
<AccountId idDomain="QBO">1</AccountId>
</IncomeAccountRef>
Can you check if the item with ID 5 exists in your account. You should also check the SalesTax settings.
[ QBO Account - 'Company' tab => Preferences ]
I tried with the same condition which you have mentioned above.
i.e. [ if the tax rate is non-zero and the line item is taxable ]
It worked fine. PFB details.
Request XML
<SalesReceipt xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:ns3="http://www.intuit.com/sb/cdm/qbo">
<Header>
<CustomerId idDomain="QBO">3</CustomerId>
<TaxRate>5.00</TaxRate>
<DepositToAccountId>4</DepositToAccountId>
</Header>
<Line>
<Id>1</Id>
<Desc>asdfdsafds</Desc>
<Amount>500.00</Amount>
<Taxable>true</Taxable>
<ItemId idDomain="QBO">1</ItemId>
<Qty>1</Qty>
</Line>
</SalesReceipt>
Retrieve By ID
<SalesReceipt xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">75</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-08-02T22:10:41-07:00</CreateTime>
<LastUpdatedTime>2013-08-02T22:10:41-07:00</LastUpdatedTime>
</MetaData>
<Header>
<DocNumber>1038</DocNumber>
<TxnDate>2013-08-02-07:00</TxnDate>
<CustomerId idDomain="QBO">3</CustomerId>
<SalesTaxCodeId idDomain="QBO">1</SalesTaxCodeId>
<SalesTaxCodeName>IS_TAXABLE</SalesTaxCodeName>
<SubTotalAmt>500.00</SubTotalAmt>
<TaxRate>5</TaxRate>
<TaxAmt>25.00</TaxAmt>
<TotalAmt>525.00</TotalAmt>
<ToBePrinted>false</ToBePrinted>
<ToBeEmailed>false</ToBeEmailed>
<ShipAddr>
<Line1>Park Street</Line1>
<City>Woodland Hills</City>
<CountrySubDivisionCode>CA</CountrySubDivisionCode>
<PostalCode>934657</PostalCode>
<GeoCode>LAT=34.1785255,LNG=-118.597305</GeoCode>
<Tag>CUSTOMER</Tag>
</ShipAddr>
<ShipMethodId idDomain="QBO" />
<DepositToAccountId idDomain="QBO">4</DepositToAccountId>
<DepositToAccountName>Undeposited Funds</DepositToAccountName>
<DiscountTaxable>true</DiscountTaxable>
</Header>
<Line>
<Id>1</Id>
<Desc>asdfdsafds</Desc>
<Amount>500.00</Amount>
<Taxable>true</Taxable>
<ItemId>1</ItemId>
<Qty>1</Qty>
</Line>
</SalesReceipt>
I'll also try to reproduce the exact error msg. If I get something, I'll update it here.
EDIT
GetById - (Item id - 1)
<Item xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">1</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-04-10T08:27:00-07:00</CreateTime>
<LastUpdatedTime>2013-04-10T08:27:00-07:00</LastUpdatedTime>
</MetaData>
<Name>Services</Name>
<Taxable>false</Taxable>
<IncomeAccountRef>
<AccountId idDomain="QBO">1</AccountId>
</IncomeAccountRef>
</Item>
DocRef - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/item
Thanks
In your SalesReceipt request line, you are passing the
< AccountId >52 .
The Line item does not support this tag.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/salesreceipt
I think this might be the issue.

Intuit anywhere API telling me that a field is required when it's already specified

I am trying to create an invoice in QB for windows. Here is the XML:
<?xml version='1.0' encoding='utf-8'?>
<Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2" xsi:schemaLocation="http://www.intuit.com/sb/cdm/V2./RestDataFilter.xsd " RequestId="1836474224e142c9ad9b7dd6cb0eaa41" FullResponse="true">
<OfferingId>ipp</OfferingId>
<ExternalRealmId>596059545</ExternalRealmId>
<Invoice>
<Header>
<TxnDate>2013-01-30</TxnDate>
<DiscountAmt>0</DiscountAmt>
<ARAccountName>Sales - Support and Maintenance</ARAccountName>
<DiscountAccountName>Discounts/Refunds</DiscountAccountName>
<DueDate>2013-02-17</DueDate>
<Currency>USD</Currency>
<CustomerId>4</CustomerId>
</Header>
<Line>
<Qty>1</Qty>
<UnitPrice>7.00</UnitPrice>
<Desc>Follow-up Test, Instant for Person138-Org3 Person138-Org3</Desc>
</Line>
</Invoice>
</Add>
Here's the response:
-2001: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ARAccountName'. One of '{"http://www.intuit.com/sb/cdm/v2":DiscountAccountId, "http://www.intuit.com/sb/cdm/v2":DiscountAccountName, "http://www.intuit.com/sb/cdm/v2":DiscountTaxable, "http://www.intuit.com/sb/cdm/v2":TxnId}' is expected.
I don't understand, as I already have DiscountAccountName specified. I also tried to go with something more like the create example (same as above but with ARAccountName and DiscountAccountName removed) and got a similar response. Thanks in advance for your help.
The Intuit XML requests are validated by an XSD, and with XML validated by XSDs the order of the tags you provide matters.
That means that if the documentation (https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0500_QuickBooks_Windows/0600_Object_Reference/Invoice) dictates that ARAccountName comes before DiscountAmt, then you must put ARAccountName before DiscountAmt.
Switch the order of your XML tags to match the order shown in the docs, and you'll be all set.

Resources