May 20, 20216:32 PM - edited May 21, 20219:53 AM
Contributor
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
I have managed to whip up a really nice system with my product and HubSpot's API pretty quickly; however, I found myself pretty stumped at the part where I need to manage the start date for a line item. For example, the second column in this screenshot mentions "Start Date":
When looking at the documentation for this object (https://developers.hubspot.com/docs/api/crm/line-items), I don't see anything here regarding the "Start Date". In our particular case, we're automating all of our payments via Stripe from the SaaS platform, so the user never interacts with HubSpot, any PDF documents, etc.
So basically, when the user submits payment from Stripe, Stripe informs us and we update the deal to include additional line items in Hubspot CRM.
Is there a better way for me to do this or are there any suggestions on how to create this line item to include the start date of the current date? I've tried adding the "start_date", "startdate" to the properties json keys, but doesn't seem like any of them work.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Happy news - I managed to escape my wife and found the solution! (I just want this sentence to be a part of the official solution so dont you dare edit this Dennis!)
Answer: Property name is "hs_recurring_billing_start_date".
It returns null if its "at payment" and date if the date is specified.
Example:
Calling the line-item with API gives:
Using the call:
GET https://api.hubapi.com/crm/v3/objects/line_items?limit=10&properties=hs_recurring_billing_start_date&archived=false&hapikey=my-super-duper-secret-api-key
Have a great weekend guys! 🙂
Edit:
Finally let me know how I found out:
Calling the properties API -- it was not listed anywhere in the official documentation - or even visible in the settings of the portal properties.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
@altjx If you are selling subscriptions, services or things on a monthly/ quarterly/ yearly payment plan you need to take terms of contract into consideration as well.
Lets say its a contract for 2 years - you need to take the value per month times x 24 months.
Equation is:
Amount of items x price per item x amount of times per year the line-item will be invoiced (monthly = 12, quarterly = 4 and so on) x terms of contract in years
Lets say im selling a subscription:
Terms of contract is 3 years (you have to subscribe for 3 years)
Renting Dennis shoes (2 pair x 50 USD per month x 12 x 3)
Renting Dennis hat (1 hat x 25 USD per quarter x 4 x 3)
Renting Dennis t-shirt (1 t-shirt x 10 USD per year x 1 x 3)
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Unsure how @MichaelC had access to my unreleased business plans 👀
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Thanks again for your help, Michael! I took a little bit of time to understand how the Properties work, which was super helpful in figuring out which values were available and which ones could be updated.
I also updated the code to automatically update the total cost of the deal amount upon completion of adding/removing/updating line items. FWIW if anyone else needs guidance:
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Well its not done with automation if you do it with the api. You would need to make your own script do the math and from that update the deal using objects deals patch api.
Alternative is to create a workflow to do the work (not really sure how though)
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
One more question if you're still around @MichaelC . After associating a line item to a deal, do you know how to have the deal's amount automatically updated? I see this is possible in the UI. So if I have a deal that has an amount of $0, and I associate a line item that contains a price, the UI gives me the ability to "Update the deal amount" or "Save without updating the deal amount". I wonder how this can be accomplished via the API?
I think alternatively, I'd have to automatically update and keep track of these.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Gotcha. Thanks Michael. I've implemented a good portion of the HubSpot API through the SaaS platform, but I think this is just the first time I've run across something that I had to guess/assume and not see specifically documented/mentioned, so it threw me off a bit.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Nice!!! Thanks a lot !!! Hahaha. Yeah that's really weird that it doesn't exist in the documentation, but really happy you found it!! Much appreciated!!
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Happy news - I managed to escape my wife and found the solution! (I just want this sentence to be a part of the official solution so dont you dare edit this Dennis!)
Answer: Property name is "hs_recurring_billing_start_date".
It returns null if its "at payment" and date if the date is specified.
Example:
Calling the line-item with API gives:
Using the call:
GET https://api.hubapi.com/crm/v3/objects/line_items?limit=10&properties=hs_recurring_billing_start_date&archived=false&hapikey=my-super-duper-secret-api-key
Have a great weekend guys! 🙂
Edit:
Finally let me know how I found out:
Calling the properties API -- it was not listed anywhere in the official documentation - or even visible in the settings of the portal properties.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
love it!
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Thanks Michael! I'll be generating the connection with Stripe and PDF reports through my own system as we'll be leveraging the API to communicate back to Hubspot to update the deal.
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
Thanks @dennisedson . Sorry I haven't been much help in the other threads you've tagged me in. Going through the growing pains so I've been knee deep in code with the platform lol.
How to create, update, or read the "Start Date" for a Line Item object?
SOLVE
no worries!
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!