0

Its give me 3120 errorI use QBFC v13 and asp.net with c#. I have create one invoice and paid some amount for this invoice, problem is that now i want to undo payment for this invoice.I try this but not working.

 ITxnDel txnDelRq = RecPayrequestMsgSet.AppendTxnDelRq();
 txnDelRq.TxnDelType.SetValue(ENTxnDelType.tdtReceivePayment);
 txnDelRq.TxnID.SetValue(TxnId);
ITSGuru
  • 194
  • 8
  • What isn't working about it? What error are you getting? What response is QuickBooks sending back to you? – Keith Palmer Jr. Oct 04 '17 at 11:21
  • @KeithPalmerJr. i don't get any error but payment not remove from quickbook desktop . Is this right code for undo payment? – ITSGuru Oct 04 '17 at 12:32
  • @KeithPalmerJr. Receive payment in quickbook using IReceivePaymentAdd interface – ITSGuru Oct 04 '17 at 12:37
  • If you're not getting anything back from QuickBooks, then you're not even sending it to QuickBooks. QuickBooks ALWAYS returns something. Please post the rest of your code, and do some work to troubleshoot the problem further yourself. – Keith Palmer Jr. Oct 04 '17 at 13:15
  • @KeithPalmerJr. can you please tell me is this right code for undo payment? – ITSGuru Oct 05 '17 at 03:58
  • @KeithPalmerJr. edited my question and put image for what i get from quickbook – ITSGuru Oct 05 '17 at 05:12

1 Answers1

0

So if you look at the Exception, you can see that you're getting a response from QuickBooks, and it's an error:

Object 339-1507104811 specified in the request cannot be found.

What QuickBooks is telling you here is that, in your request, you referred to a specific object (the object with TxnID = 339-1507104811) and QuickBooks can not find this object.

That means one of two things. Either:

  1. Somebody else already deleted the object
  2. You're using an incorrect TxnID value

Did somebody else already delete the payment? You? Your program on a previous run?

Are you 100% positive you have the correct TxnID value? It should be from the ReceivePaymentAdd request you initially used to create the payment.

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • yes it's correct TxnID. bescause when ever I create receive payment quickbook return with TxnID and I store it in to my database. So at undo peyment I fetch TxnID from database. – ITSGuru Oct 06 '17 at 03:19
  • OK, well if it's the correct TxnID, then that leaves exactly one other option - somebody else already deleted the transaction. – Keith Palmer Jr. Oct 06 '17 at 18:46