APIs & Integrations

Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Quotes API - Automatically set 'Your info'

SOLVE

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.

Schermafbeelding 2022-11-03 om 13.47.56.png

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.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
1 Accepted solution
CMcKay
Solution
Top Contributor

Quotes API - Automatically set 'Your info'

SOLVE
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: https://www.loom.com/share/dece8286dce04d59bd62fcb754243567 

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

View solution in original post

6 Replies 6
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Quotes API - Automatically set 'Your info'

SOLVE

@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.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
CMcKay
Top Contributor

Quotes API - Automatically set 'Your info'

SOLVE

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

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

0 Upvotes
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Quotes API - Automatically set 'Your info'

SOLVE

That was a mistake 🤣, 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.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
CMcKay
Top Contributor

Quotes API - Automatically set 'Your info'

SOLVE

He's the real deal.

0 Upvotes
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Quotes API - Automatically set 'Your info'

SOLVE

Oh wait, I can unaccept solutions!



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
CMcKay
Solution
Top Contributor

Quotes API - Automatically set 'Your info'

SOLVE
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: https://www.loom.com/share/dece8286dce04d59bd62fcb754243567 

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