0

For some reason when I try to revert a credit memo in Quickbooks IPP, I get a blank response. I removed the authorization header so I could post it below The request:

POST https://services.intuit.com/sb/creditmemo/v2/[realmid] HTTP/1.1
Content-Type: text/xml
Content-Length: 312

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<Revert RequestId="73c6e0d1268aaac3a34e8e00a73d0e74"
   xmlns="http://www.intuit.com/sb/cdm/v2">
   <Object xsi:type="CreditMemo"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Id idDomain="NG">46537073</Id>
   </Object>
</Revert>

The response:

HTTP/1.1 200 OK
Date: Thu, 22 Aug 2013 06:39:25 GMT
Server: Apache/2.2.3 (Red Hat)
Response-Routing-Time: 185
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain; charset=UTF-8

I'm using the php devkit

Jeremy
  • 163
  • 3
  • 14
  • you can't revert credit memo if there is a linked transaction like against it – DevZer0 Aug 22 '13 at 06:47
  • so then how can I get it out of an error state? – Jeremy Aug 22 '13 at 06:59
  • An object can be reverted only if it has been synched with QuickBooks at least once. This implies that the object has been updated by Data Services (that is, by a operation) and yes, there should not any linked transaction against it – nimisha shrivastava Aug 22 '13 at 07:10
  • Thanks. How can I get it out of error state if it has already been synced once, but does have transactions against it? – Jeremy Aug 22 '13 at 07:11
  • Can you try doing an update directly? It is not documented in our docs but works sometimes. – nimisha shrivastava Aug 22 '13 at 07:14
  • Well, for credit memo, I don't see any TXNId field, so revert also should work. https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/creditmemo – nimisha shrivastava Aug 22 '13 at 07:17
  • I can try that. Is there a way to get it included in a creditmemo query? – Jeremy Aug 22 '13 at 07:18
  • I need to be able to get the current xml of the object so I can update it without missing anything. – Jeremy Aug 22 '13 at 07:25
  • I found out credit memos don't support revert: https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0500_supported_objects – Jeremy Aug 22 '13 at 07:29
  • Is there a way for me to query for the credit memo even though it's in error state? – Jeremy Aug 22 '13 at 07:29
  • 1
    I figured it out. added ErroredObjectsOnly="true" to my query. – Jeremy Aug 22 '13 at 08:48
  • @Jeremy you should post an answer with your finding so it's documented for others in the future – DevZer0 Aug 22 '13 at 09:04

1 Answers1

1

It turns out that you can't revert a credit memo according to the Intuit developer site: https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0500_supported_objects

What I ended up doing to resolve the issue was doing a query with ErroredObjectsOnly="true" to get the currently errored credit memo:

<CreditMemoQuery ErroredObjectsOnly="true" xmlns="http://www.intuit.com/sb/cdm/v2">
</CreditMemoQuery>

and then posting my credit memo back to intuit with valid fields. That bumped the CreditMemo out of error state and allowed it to sync.

Jeremy
  • 163
  • 3
  • 14