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.
Related
I use Intuit QBO SDK v3 DataService.FindById to get a Customer entity, modify some of the attributes including PreferredDeliveryMethod then call DataService.Update. When I set PreferredDeliveryMethod to 'Print' or 'Email', the Customer is modified correctly as shown by the response object. When I set PreferredDeliveryMethod to 'None', the response comes back with 'Print' regardless of what it was before I applied the modification. How do I set PreferredDeliveryMethod to 'None' for a proper response?
Update: This issue was with a Sandbox Company. When I tried it with a Production Company, the update worked correctly. There is some suspicion Company settings are involved but I don't know what yet.
Request:
<?xml version="1.0"?>
<Customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" domain="QBO" sparse="false" xmlns="http://schema.intuit.com/finance/v3">
<Id>3</Id>
<SyncToken>2</SyncToken>
<MetaData>
<CreateTime>2014-09-19T19:51:22-04:00</CreateTime>
<LastUpdatedTime>2015-02-10T09:53:30-05:00</LastUpdatedTime>
</MetaData>
<GivenName>Grace</GivenName>
<FamilyName>Pariente</FamilyName>
<FullyQualifiedName>Cool Cars</FullyQualifiedName>
<CompanyName>Cool Cars</CompanyName>
<DisplayName>Cool Cars</DisplayName>
<PrintOnCheckName>Cool Cars</PrintOnCheckName>
<Active>true</Active>
<PrimaryPhone>
<FreeFormNumber>(415) 555-9933</FreeFormNumber>
</PrimaryPhone>
<AlternatePhone />
<Fax />
<PrimaryEmailAddr>
<Address>Cool_Cars#intuit.com</Address>
</PrimaryEmailAddr>
<DefaultTaxCodeRef />
<Taxable>false</Taxable>
<BillAddr>
<Id>4</Id>
<Line1>65 Ocean Dr.</Line1>
<City>Half Moon Bay</City>
<CountrySubDivisionCode>CA</CountrySubDivisionCode>
<PostalCode>94213</PostalCode>
<Lat>37.4300318</Lat>
<Long>-122.4336537</Long>
</BillAddr>
<ShipAddr />
<Job>false</Job>
<BillWithParent>false</BillWithParent>
<SalesTermRef />
<Balance>0</Balance>
<BalanceWithJobs>0</BalanceWithJobs>
<PreferredDeliveryMethod>None</PreferredDeliveryMethod>
</Customer>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2015-02-10T06:53:55.320-08:00">
<Customer domain="QBO" sparse="false">
<Id>3</Id>
<SyncToken>3</SyncToken>
<MetaData>
<CreateTime>2014-09-19T16:51:22-07:00</CreateTime>
<LastUpdatedTime>2015-02-10T06:53:55-08:00</LastUpdatedTime>
</MetaData>
<GivenName>Grace</GivenName>
<FamilyName>Pariente</FamilyName>
<FullyQualifiedName>Cool Cars</FullyQualifiedName>
<CompanyName>Cool Cars</CompanyName>
<DisplayName>Cool Cars</DisplayName>
<PrintOnCheckName>Cool Cars</PrintOnCheckName>
<Active>true</Active>
<PrimaryPhone><FreeFormNumber>(415) 555-9933</FreeFormNumber></PrimaryPhone>
<PrimaryEmailAddr><Address>Cool_Cars#intuit.com</Address></PrimaryEmailAddr>
<Taxable>false</Taxable>
<BillAddr>
<Id>4</Id>
<Line1>65 Ocean Dr.</Line1>
<City>Half Moon Bay</City>
<CountrySubDivisionCode>CA</CountrySubDivisionCode>
<PostalCode>94213</PostalCode>
<Lat>37.4300318</Lat>
<Long>-122.4336537</Long>
</BillAddr>
<Job>false</Job>
<BillWithParent>false</BillWithParent>
<Balance>0</Balance>
<BalanceWithJobs>0</BalanceWithJobs>
<PreferredDeliveryMethod>Print</PreferredDeliveryMethod>
</Customer>
</IntuitResponse>
Can you capture and share the raw request/response XML.
I tried the following java code and it worked fine.
Customer customer = new Customer();
customer.setId("1");
Customer cust = this.service.findById(customer);
System.out.println(cust.getPreferredDeliveryMethod());
cust.setPreferredDeliveryMethod("None");
this.service.update(cust);
System.out.println("Updated - " + cust.getPreferredDeliveryMethod());
GetById
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2015-02-10T02:10:51.595-08:00">
<Customer domain="QBO" sparse="false">
<Id>1</Id>
<SyncToken>4</SyncToken>
<MetaData>
<CreateTime>2015-02-02T20:34:19-08:00</CreateTime>
<LastUpdatedTime>2015-02-10T02:10:39-08:00</LastUpdatedTime>
</MetaData>
<GivenName>John</GivenName>
<FamilyName>Doe</FamilyName>
<FullyQualifiedName>John Doe</FullyQualifiedName>
...
<Job>false</Job>
<BillWithParent>false</BillWithParent>
<Balance>242.25</Balance>
<BalanceWithJobs>242.25</BalanceWithJobs>
<PreferredDeliveryMethod>Print</PreferredDeliveryMethod>
</Customer>
</IntuitResponse>
Update PrefDelMethod to 'None'
<Customer domain="QBO" sparse="false" xmlns="http://schema.intuit.com/finance/v3">
<Id>1</Id>
<SyncToken>4</SyncToken>
<MetaData>
<CreateTime>2015-02-02T20:34:19-08:00</CreateTime>
<LastUpdatedTime>2015-02-10T02:10:39-08:00</LastUpdatedTime>
</MetaData>
<GivenName>John</GivenName>
<FamilyName>Doe</FamilyName>
<FullyQualifiedName>John Doe</FullyQualifiedName>
...
<BalanceWithJobs>242.25</BalanceWithJobs>
<PreferredDeliveryMethod>None</PreferredDeliveryMethod>
</Customer>
Update response
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2015-02-10T02:10:53.800-08:00">
<Customer domain="QBO" sparse="false">
<Id>1</Id>
<SyncToken>5</SyncToken>
<MetaData>
<CreateTime>2015-02-02T20:34:19-08:00</CreateTime>
<LastUpdatedTime>2015-02-10T02:10:53-08:00</LastUpdatedTime>
</MetaData>
<GivenName>John</GivenName>
<FamilyName>Doe</FamilyName>
<FullyQualifiedName>John Doe</FullyQualifiedName>
...
<BalanceWithJobs>242.25</BalanceWithJobs>
<PreferredDeliveryMethod>None</PreferredDeliveryMethod>
</Customer>
</IntuitResponse>
Per Intuit Developer Community, "Most probably it is a sandbox issue as it has data already setup which can sometimes cause data issues."
Yes, I have seen other data issues with Sandbox. This is the accepted answer.
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.
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?
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.
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.