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?
Best answer by Danvers
You can use the Formatter by Zapier app to convert the individual fields back into lines items:]
- Add an action in the Zap and select the Formatter app
- Choose the utilities option
- Choose the Transform ‘Text to Line item’
- 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.