# Issues quote and custom quote template

**URL:** <https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853>\
**Category:** APIs & Integrations\
**Created:** [September 26, 2022, 8:52am UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853 "2022-09-26T08:52:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 26, 2022, 8:52am UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/1 "2022-09-26T08:52:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 26, 2022, 4:02pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/2 "2022-09-26T16:02:37Z")

</div>

Hi, @PEscrieut 👋 Thanks for reaching out! Hey [@Jake\_Lett](https://community.hubspot.com/t5/user/viewprofilepage/user-id/72866), do you have any tips you can share with @PEscrieut? Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 29, 2022, 11:07am UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/3 "2022-09-29T11:07:51Z")

</div>

Can you ask your team to look on my comments? Thanks

---

<div class="post-metadata">

**Author:** ![LeeBartelme](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/leebartelme/32/95647_2.png) [@LeeBartelme](https://community.hubspot.com/u/LeeBartelme)\
**Post date:** [September 29, 2022, 12:48pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/4 "2022-09-29T12:48:34Z")

</div>

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:

```lia-code-sample
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.

---

<div class="post-metadata">

**Author:** ![LeeBartelme](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/leebartelme/32/95647_2.png) [@LeeBartelme](https://community.hubspot.com/u/LeeBartelme)\
**Post date:** [September 27, 2022, 1:08pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/5 "2022-09-27T13:08:46Z")

</div>

Would need you to share the code you used to create the quote.

---

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 27, 2022, 4:46pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/6 "2022-09-27T16:46:26Z")

</div>

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](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

PUT/[https://api.hubapi.com/crm/v3/objects/quote/“+quoteId+”/associations/quote\_template/“+templateId+”/quote\_to\_quote\_template](https://api.hubapi.com/crm/v3/objects/quote/%22+quoteId+%22/associations/quote_template/%22+templateId+%22/quote_to_quote_template)

---

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 29, 2022, 11:02am UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/7 "2022-09-29T11:02:46Z")

</div>

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”

const productObject = {

properties: {

“hs\_product\_id”: 89293927,

“quantity”: 1,

}

}

const createLineItemsResponse = await hubspotClient.crm.lineItems.basicApi.create(productObject)

await hubspotClient.crm.lineItems.associationsApi.create(

createLineItemsResponse.id,

‘quote’,

createQuotesResponse.id,

‘line\_item\_to\_quote’

);

productObject.properties.hs\_product\_id=9253938;

const createLineItemsResponse2 = await hubspotClient.crm.lineItems.basicApi.create(productObject)

await hubspotClient.crm.lineItems.associationsApi.create(

createLineItemsResponse2.id,

‘quote’,

createQuotesResponse.id,

‘line\_item\_to\_quote’

);

productObject.properties.hs\_product\_id=96805;

const createLineItemsResponse3 = await hubspotClient.crm.lineItems.basicApi.create(productObject)

await hubspotClient.crm.lineItems.associationsApi.create(

createLineItemsResponse3.id,

‘quote’,

createQuotesResponse.id,

‘line\_item\_to\_quote’

);

One line\_item it is ok, 2 or more it failled. I can create multiple item without link it is fine.

As “Pro” paid solution, is it possible to have an answer ?

Thanks

---

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 29, 2022, 12:31pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/8 "2022-09-29T12:31:00Z")

</div>

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:

const productObject = {

properties: {

“hs\_product\_id”: XXXXXX,

“hs\_line\_item\_currency\_code”: “EUR”,

“quantity”:1

}

}

Is it ok ? (I will compare two line items)

---

<div class="post-metadata">

**Author:** ![PEscrieut](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PEscrieut](https://community.hubspot.com/u/PEscrieut)\
**Post date:** [September 29, 2022, 12:47pm UTC](https://community.hubspot.com/t/issues-quote-and-custom-quote-template/65853/9 "2022-09-29T12:47:45Z")

</div>

I found the issue:

I need to set hs\_position\_on\_quote, it is not automaticaly incremented
