Hi all,
How to create custom attributes to LineItem object type?
Thanks
Hi all,
How to create custom attributes to LineItem object type?
Thanks
Hi @ASpyropoulos,
Line items can be thought of as child objects and they inherit all of the product object properties. Therefore in order to create a custom line item property you must create a custom product property. Once done, the custom property will be visible to use within segmentation via lists, automation via workflows and reporting.
I’ve recorded a short video walking through this in more detail:
I hope this helps!
Jack
Hi Jack,
Thank you for the video that was really helpful. One question when I add the custom property as a product I can indeed later on added to the line item. However when I go the webhook integration → subsriptions to include this new customer property in the event trigger, after selecting lineItem object type, is not displayed in the list. Can you please check and verify?
Hey @ASpyropoulos,
You can also setup webhook subscriptions to trigger when custom properties are updated for line items. It’s expected that they won’t actually be displayed from the dropdown of available properties when creating the webhook. Instead you need to type the internal name of the property.
For instance in my example I have a custom property “Colour”. I can create the subscription as shown below:
Which results in the following (notice it’s been triggered three times):
and below is the payload my endpoint receives:
I’ve also recorded a short video to showcase how this works:
Hope this helps!
Jack
Thank you Jack for all the info. I follow the instructions as per your video. However when I change the value of my custom property in a line item and save, it does not fire an event. The webhook works fine for any other property besides the newly custom one. The webhook is also triggered when I tried to send a test event from this custom property.
Can you please assist on that?
When you are creating the webhook subscription can you ensure that you enable “Use expanded object support?”. I notice when I do this the subscriptions fire immediately. With it disabled there is some latency/lag with regards the events being detected.
Jack
Hi Jack,
With this option on it worked!
Something else that I noticed is that the event that is triggered the 1st time contained
subscriptionType: object.propertyChange
and not
subscriptionType: line_item
as it should.
The rest of the times though the subscriptionType was correct.
Thanks again for the time. The videos have been really helpful too!