Quotes API - Automatically set 'Your info'

Hi everyone,

I’m currently using a workflow to create a quote, associate a deal, associate line items, associate a company and associate a contact.

Everything is working as expected except for the fact that the ‘Your information’ is not set.
I do not see my personal information in the ‘Your info’ step and the company information is also missing.
If I create a quote from the UI and select a deal, that data is set automatically.
What am I missing? I am setting a HubSpot owner ID through the API for my quote.

Here is my code:

const axios = require('axios');

exports.main = async (event, callback) => {
 const dealName = event.inputFields['dealname'];
 const ownerID = event.inputFields['hubspot_owner_id'];

 const quoteID = await axios({
 method: 'post',
 url: 'https://api.hubapi.com/crm/v3/objects/quotes',
 headers: { 'Authorization': `Bearer ${process.env.dealtoken}`, 'Content-Type': 'application/json' },
 data: JSON.stringify({
 "properties": {
 "hs_title": dealName,
 "hs_expiration_date": "2023-12-30",
 "hubspot_owner_id": ownerID
 }
 })
 }).then((response) => {
 console.log(`Succesfully created quote ${response.data.id}`)
 return response.data.id
 }).catch((error) => {
 console.log(error.response.data)
	throw new Error(error.response.data.message)
 })

 callback({
 outputFields: {
 quoteID: quoteID
 }
 });
}

I am setting the status to ‘DRAFT’ at the end of my workflow.

hs_sender_image_url
hs_sender_company_name
hs_sender_firstname
hs_sender_company_domain
hs_sender_lastname
hs_sender_company_address
hs_sender_email
hs_sender_company_address2
hs_sender_phone
hs_sender_company_city
hs_sender_jobtitle
hs_sender_company_state
hs_sender_company_zip
hs_sender_company_country
hs_sender_company_image_url

All these properties aren’t dynamically set based on the hubspot_owner_id when creating through the api, they only get set when creating the through the ui, so you’ll have to manually set them. Also something interesting I found while testing is that on quote create the owner will get unassociated after a couple of seconds. Loom as proof: Quotes - 3 November 2022 | Loom

I fixed this by immediately after deal creation sending a patch request with the same exact information.

@CMcKay saves the day as usual. Please tell me you are a community champion, cause you definitely deserve to be one.

This should definitely be in the docs.

@Teun Hold up a second, you can accept your own solution? :winking_face_with_tongue:

Not a community champion, more of an above average community respondant, hahaha.

That was a mistake :rofl:, but I can not unaccept this as a solution.

If they would count Slack solutions as well, you would be competing with Karsten Köhler.

Oh wait, I can unaccept solutions!

He’s the real deal.