• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

  • Important: Any reported problems and issues with your integration will be reported to you and we will encourage the app developers help to resolve those integration issues.

How to Configure Request Body JSON of an Action Compatible with Line Item(s)

Status
Not open for further replies.
Line items in terms of accounting are subsets of individual items/products. For example, “quantity, unit price, amount” are line items of "Invoice".

If your app supports Line Item(s) like JSON structure which consists of an array of JSON objects as shown in below example:

JSON:
{
"Invoice": {
  "TxnDate": "2014-09-19",
  "PrintStatus": "NeedToPrint",
  "TotalAmt": 362.07,
  "Line": [
   {
    "Description": "Rock Fountain",
    "DetailType": "SalesItemLineDetail",
    "SalesItemLineDetail": {
     "TaxCodeRef": {
      "value": "TAX"
     },
     "Qty": 1,
     "UnitPrice": 275,
     "ItemRef": {
      "name": "Rock Fountain",
      "value": "5"
     }
    },
    "LineNum": 1,
    "Amount": 275,
    "Id": "1"
   },
   {
    "Description": "Fountain Pump",
    "DetailType": "SalesItemLineDetail",
    "SalesItemLineDetail": {
     "TaxCodeRef": {
      "value": "TAX"
     },
     "Qty": 1,
     "UnitPrice": 12.75,
     "ItemRef": {
      "name": "Pump",
      "value": "11"
     }
    },
    "LineNum": 2,
    "Amount": 12.75,
    "Id": "2"
   },
   {
    "Description": "Concrete for fountain installation",
    "DetailType": "SalesItemLineDetail",
    "SalesItemLineDetail": {
     "TaxCodeRef": {
      "value": "TAX"
     },
     "Qty": 5,
     "UnitPrice": 9.5,
     "ItemRef": {
      "name": "Concrete",
      "value": "3"
     }
    },
    "LineNum": 3,
    "Amount": 47.5,
    "Id": "3"
   },
   {
    "DetailType": "SubTotalLineDetail",
    "Amount": 335.25,
    "SubTotalLineDetail": {}
   }
  ],
  "DueDate": "2014-10-19",
  "DocNumber": "1037",
  "CustomerMemo": {
   "value": "Thank you for your business and have a great day!"
  },
  "Balance": 362.07,
  "BillEmail": {
   "Address": "[email protected]"
  },
  "ShipAddr": {
   "City": "Middlefield",
   "Line1": "5647 Cypress Hill Ave.",
   "PostalCode": "94303",
   "Lat": "37.4238562",
   "Long": "-122.1141681",
   "CountrySubDivisionCode": "CA",
   "Id": "25"
  },
  "BillAddr": {
   "Line4": "Middlefield, CA  94303",
   "Line3": "5647 Cypress Hill Ave.",
   "Line2": "Sonnenschein Family Store",
   "Line1": "Russ Sonnenschein",
   "Long": "-122.1141681",
   "Lat": "37.4238562",
   "Id": "95"
  },
  "Id": "130"
},
"time": "2015-07-24T10:48:27.082-07:00"
}

You can see in the above code, Line is an array of JSON objects. If your action allows this type of JSON structure then, you can set up Line Item compatible action of your app in Pabbly Connect.

All you have to do is, just declare the JSON Key that holds such dynamic data as in the above example "Line[{....}]" is the one.

1635764698578.png

Define one object of "line":[{....}] array in the Body Request (Raw JSON) with variables as shown below:

1635769637321.png

While defining the variables in the request body field on the action step, there is some syntax that helps Pabbly Connect to typecast the dynamic value of JSON as explained below:

For Numeric Value:
Use numeric# prefix in the variable as explained in the following example:

JSON:
{
    "tax": "numeric#{{tax_amount}}",
}

For Repeating Dropdown Values in all objects of Line Item array:
Use repeat# prefix in the variable as explained in the following example:

JSON:
{
   "item_name": "repeat#numeric#{{item_name}}",
   "amount": "repeat#{{amount}}"
}


For custom pabbly object

Used pabbly_object_ as a prefix for custom Pabbly object variables , Example -
JSON:
{
  "product_name": "{{name}}",
  "line": {
    "pabbly_object_fields": [
      [
        "{{key}}",
        "{{value}}"
      ]
    ]
  }
}
Pabbly object setting -
AD_4nXdq1FOY9gcFT4FoYp6qF2YHR4qujtx20FLCXc9AdlPEZ3iMbwxcTZ-dZs5fU2SAdVocEtdJ5Oh00-CrEVZ7tDu1mwxWP-sE1voTO8hJJXiUIpQh2EEPuygYI3j3sKvq6J9oo6fKDg

AD_4nXfhDeiOC5MpTfZKBzRwqZSbWSsOxaIFeOi3wUM1rB55FBoD5hg-LDGK7KNWdtFC0BqYpBBlGlZ3-labrwpk94U_FkLEn99G2qteNmcunWxTt3YJ3OFzWMca9Oerr4IsJ6VwMYBURA


Input for the pabbly object

1740396335919.png

Output -

1740396279776.png

For Root array -
Added option to support line itemizer on root level by passing array of object in root_array json key.
JSON:
{
    "root_array": [
        {
            "email": "{{email}}",
            "firstName": "{{firstName}}",
            "lastName": "{{lastName}}"
        }
    ]
}
Root array setting -
1741436868589.png


1741436910495.png

Output-
1741437111379.png

Once you configure the action with Line Item support, users will be able to enter or map comma-separated values for the line item fields as explained in this tutorial: https://forum.pabbly.com/threads/how-to-use-line-itemizer.1624/
 
Last edited by a moderator:
Status
Not open for further replies.
Top