QBO Line incomplete. Missing value of required parameter 'type'

:bullseye: What is your goal?

I need to create a Purchase Order record with its X number of line items in Quickbooks Online.
I am creating the JSON for the line items based on the Intuit API guide Intuit Developer

I also have tested the “create a PO” module using the Lines with the Map toggle turned off and it has worked, because I set everything manually, so what I found so far is that the Create a PO module uses “type” and then it translates it to DetailType as the intuit documentation expects it.

I would prefer to use the JSON for the Lines field since I am already creating them and would like to just pass them on.

Any thoughts?

:thinking: What is the problem & what have you tried?

The Create Purchase Order module is asking for a parameter “type”, which I know I am including.

:clipboard: Error messages or input/output bundles

Missing value of required parameter ‘type’.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

This is the way I am trying to avoid, since I don’t know how many line items each PO will have I’d rather pass the JSON.

Any help is appreciate it.

Hi @amm,

You should be able to handle this using an Array Aggregator rather than manually defining line items in the QuickBooks module.

I’ve included a couple of screenshots from a sample SuiteCRM → QuickBooks Purchase Order sync. The general approach is to build an array of line items before the QuickBooks step and then map that array into the Lines field.

If your source system returns multiple line items, you’ll typically use:

Iterator → Array Aggregator → QuickBooks Create Purchase Order

The Iterator processes each line item individually, and the Array Aggregator groups them back into a single array that represents all line items for the purchase order. Within the Array Aggregator, map the relevant fields (amount, description, type, item/account references, etc.) from the earlier modules to create the structure expected by QuickBooks.

Once the Array Aggregator outputs the array, enable the Map toggle for the Lines field in the QuickBooks module and map the resulting array[] datapill into it.

I’d be interested in seeing the structure of the JSON you’re currently generating, as that may explain why the module is still reporting that type is missing.

Hope this helps or at least gets you moving in the right direction!

-@Trainward_Consulting

Thank you for your reply.

I thought I had included the aggregator part but I’ve must have missed it.

I do have an aggregator in charge of creating the array of line items.

I’ll include a few screenshots for reference,

The PO test record has 3 line items ( see the 3 operations below)

Here is the flow, the google sheets it’s just for me to check data on my side, don’t mind that I’ll remove it once in PROD.

Here it is the Aggregator I forgot to mention in my original message:

And here is the output of the aggregator, You’ll notice the “Detailtype” field matches what the intuit documentation describes.

I ran it ‘manually’ just for testing purposes to check a few things but my goal is to send the Line items as a JSON.

[
  {
    "array": [
      {
        "Id": null,
        "Amount": 1000,
        "LineNum": null,
        "DetailType": "ItemBasedExpenseLineDetail",
        "Description": "Fountain Pumps1",
        "CustomExtensions": [],
        "ItemBasedExpenseLineDetail": {
          "Qty": 100,
          "ItemRef": {
            "name": "Design:Fountains:Pump",
            "value": "11"
          },
          "UnitPrice": 10,
          "TaxCodeRef": {
            "value": "NON"
          },
          "CustomerRef": {
            "name": "Cool Cars",
            "value": "3"
          },
          "BillableStatus": "Billable"
        }
      },
      {
        "Id": null,
        "Amount": 250,
        "LineNum": null,
        "DetailType": "ItemBasedExpenseLineDetail",
        "Description": "Sprinkler Pipes",
        "CustomExtensions": [],
        "ItemBasedExpenseLineDetail": {
          "Qty": 100,
          "ItemRef": {
            "name": "Landscaping:Sprinklers:Sprinkler Pipes",
            "value": "17"
          },
          "UnitPrice": 2.5,
          "TaxCodeRef": {
            "value": "NON"
          },
          "CustomerRef": {
            "name": "Kate Whelan",
            "value": "14"
          },
          "BillableStatus": "Billable"
        }
      },
      {
        "Id": null,
        "Amount": 75,
        "LineNum": null,
        "DetailType": "ItemBasedExpenseLineDetail",
        "Description": "Sprinkler Headsa",
        "CustomExtensions": [],
        "ItemBasedExpenseLineDetail": {
          "Qty": 100,
          "ItemRef": {
            "name": "Landscaping:Sprinklers:Sprinkler Heads",
            "value": "16"
          },
          "UnitPrice": 0.75,
          "TaxCodeRef": {
            "value": "NON"
          },
          "CustomerRef": {
            "name": "Freeman Sporting Goods",
            "value": "7"
          },
          "BillableStatus": "Billable"
        }
      }
    ],
    "__IMTAGGLENGTH__": 3
  }
]

Here is the specific error message from Create a PO module

Hello,

Have you tried to set up your Aggregator to Quickbooks data structure using Target structure option?

@mszymkowiak Thank you! that worked!

So interesting. Thank you for the detail!