I’m trying to combine both Transaction Line Items and Stripe Fees and output them in the QuickBooks Make An API Call module. Not sure if I need to use something like the Parse JSON module to then format the Iterator Array into the QB “Line” format. Or, if I’m just making things hard for myself and there’s an easier way…
Essentially, I want all line items + all Stripe Fees for a given transaction to be part of one Sales Receipt/Invoice. They are coming from different modules further up the Scenario, so they need to be combined some how.
I’ve seen some previous questions asking about this exact scenario, but each of the solutions isn’t detailed enough for me to understand how to implement it myself (missing solutions/partial solutions).
I’ve tried Iterators, Aggregators, JSON Parsing and I’m now stuck.
Array Aggregator to combine the data/bundles into the QB Line Item format. In here, I used a nested IF and IfEmpty function to swap out the Line Item Amounts depending on if there’s a value or not. (Needed this to handle the Fee Amount, which comes from the Balance Transaction Module and won’t have an invoice amount.
Aggregate to JSON to transform the Array into the QB JSON Line Item format. (Not sure this is needed since the Array Aggregator is doing something similar, but will play with that later)
Replace the Create JSON module further up the scenario with the Array Aggregator module
In the Make an API Call, replace the Array Aggregator map with the Create JSON module further down the scenario and do some trimming of the output using the Substring function.