Sep 26, 2022 4:52 AM
Hello,
I'm using the API to build a quote.
If i'm using one of the standard template the quote is well generated.
If I'm using a custom quote template the amount of the quote is good but all the products are not shown (either on the PDF or WebPage)
If I recalled this quote and published it again from the Hubspot Web UI, all the products are shown.
Do you have the same issue? Do you have any idea about what I'm doint wrong?
Sep 27, 2022 9:08 AM
Would need you to share the code you used to create the quote.
Sep 29, 2022 7:02 AM
Hello,
I deep dive alone the issue.
If I'm linking only ONE line_tiem to the quote, the rendering is fine ! But if I'm adding 2 or more line_items it failed....
I tried also with the nodejs "sdk"
Sep 29, 2022 8:31 AM
I move forward, if I reuse on of the line_item modified by the web browser, I could have multipe line.
To create a line_item, I'm using this JSON:
Sep 29, 2022 8:47 AM
I found the issue:
I need to set hs_position_on_quote, it is not automaticaly incremented
Sep 27, 2022 12:46 PM
In order to create the quote I'm doing:
await createDeals()
await LinkDealsContact()
await createQuote()
await LinkQuoteQuoteTemplate();
await createTax()
for (let i in quoteData.products) {
await createProduct(quoteData.products[i], 1);
}
await LinkQuoteProduct();
await LinkDealsProduct();
await LinkQuoteContact();
await LinkQuoteTax()
await LinkQuoteDeals()
await updateQuoteState("APPROVAL_NOT_NEEDED");
await sendQuote();
More detail for some specific method
Create a deal with the JSON payload::
"dealname": "Quote_XXXX",
"dealstage": "presentationscheduled",
"pipeline": "default"
POST on https://api.hubapi.com/crm/v3/objects/deals
Create a Quote with the JSON payload:
"hs_title": "Title",
"hs_currency": "EUR",
"hs_expiration_date": 'YYYY-MM-DD',
"hs_sender_email": "mail",
"hs_sender_company_name": "VVVVV",
"hs_sender_firstname":"firstname",
"hs_sender_lastname": "LastName",
"hs_sender_company_address": "CCCC",
"hs_sender_company_city": "YYYYY",
"hs_sender_company_zip": "XXXX",
"hs_sender_company_country": "France"
Create LinkQuoteToCustomTemplate
Sep 26, 2022 12:02 PM - edited Sep 26, 2022 12:02 PM
Hi, @PEscrieut 👋 Thanks for reaching out! Hey @BootstrapC, do you have any tips you can share with @PEscrieut? Thank you! — Jaycee
Sep 29, 2022 7:07 AM
Can you ask your team to look on my comments? Thanks
Sep 29, 2022 8:48 AM - edited Sep 29, 2022 8:49 AM
I was able to create a quote with the API in Postman and then create 2 line items and associate those line items to the quote and then view the quote in HubSpot. So I think functionally the APIs are fine. I even tried adding with product ids and it worked fine as well.
My first debugging step would be to output the results of the API calls. Something like this:
const createLineItemsResponse2 = await hubspotClient.crm.lineItems.basicApi.create(productObject);
console.log(createLineItemsResponse2);
const associateResponse = await hubspotClient.crm.lineItems.associationsApi.create(
createLineItemsResponse2.id,
'quote',
createQuotesResponse.id,
'line_item_to_quote'
);
console.log(associateResponse );
I would want to ensure that the response to those API calls were indeed successfull and what I thought it was. If both return 2xx status codes then we'll have to dig further.
I don't use the SDK much but I thought you had to use a nested property to get the response data.
So instead of createLineItemsResponse2.id, don't you have to do createLineItemsResponse2.body.id or something like that? Outputting the result of those calls should surface if you are referencing the correct properties or not.