Best answer

Quickbooks online apply payment to multiple invoices

  • 6 June 2020
  • 2 replies
  • 1121 views

Userlevel 1

I’m trying to query multiple invoices from QuickBooks Online and then create a payment that links to all of them, but I can’t figure out the workflow for it.

My zap starts by receiving a webhook whenever a payment is made in some other billing software. The webhook’s payload provides the invoices’ document numbers (not the ID) and the amounts to be applied from the payment. In this example, a customer is trying to pay off two invoices with a single payment of $424.78.

Quickbook’s “Create Payment” step requires the invoices’ IDs (primary key in QB) in order to link it. An “Object Not Found” error will occur if you try to use the document numbers. However, the “Find Invoice” step does not support line items, so I have to break up my line items into an array so the “Find Invoice” step can run for each document number. (documentation)

After doing this and getting an invoice ID for each document number, how am I supposed to combine them back into line items for the final “Create Payment” step?

icon

Best answer by Danvers 10 June 2020, 12:25

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 1

The number of invoice IDs is variable, so I don’t think this would work. Also, since the code step returns an array with multiple objects in it, it’s my understanding that all subsequent steps (even those after the quickbooks Invoice ID lookup) would also be executed for each object in the array. So if I had 5 invoice IDs, the formatter step would run 5 times with only a single invoice ID in each which wouldn’t work.

Regardless, I eventually got something working with a digest and filters so I’ll mark this question answered. Thanks!

Userlevel 7
Badge +12

Hi @asallen67!

 

You can use the Formatter by Zapier app to convert the individual fields back into lines items:]

  1. Add an action in the Zap and select the Formatter app
  2. Choose the utilities option
  3. Choose the Transform ‘Text to Line item’
  4. For input, add each invoice ID, separated by commas. 

That will convert the text back into a line item array that you can use in later steps.