# Does creating a quote through custom code not work?

**URL:** <https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311>\
**Category:** Data Hub\
**Created:** [November 1, 2022, 2:56pm UTC](https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311 "2022-11-01T14:56:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarwanDajani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marwandajani/32/2839_2.png) [@MarwanDajani](https://community.hubspot.com/u/MarwanDajani)\
**Post date:** [November 1, 2022, 2:56pm UTC](https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311/1 "2022-11-01T14:56:05Z")

</div>

Here is my process and end goal:

- I have a deal expiring
- I auto-create a renewal deal and assign it to the correct user
- I want to create a quote that is in draft stage and associate it with the new deal.
- I use custom code to create the new quote
- following the API documentation, I was able to create a quote
- I was able to associate it to the deal
- I was NOT able to associate a quote template. Figured it might be my custom template, so I created a new custom template and used the proper endpoint as in the documentation

`/crm/v3/objects/quote/{QUOTE_ID}/associations/quote_template/{QUOTE_TEMPLATE_ID}/quote_to_quote_template​`

- I get a response saying success, but when I open a quote, the quote template is not associated
- Same thing when I try to associate a product/line item.

Is the documentation wrong? Am I doing something wrong? Happy to share my code if needed.

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [November 2, 2022, 9:24am UTC](https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311/2 "2022-11-02T09:24:25Z")

</div>

Hi @MarwanDajani

Thank you for reaching out.

I want to tag some of our experts here - @LMeert [@klloyd\_\_1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/381293) @Teun do you have any thoughts for @MarwanDajani on this?

Thank you!

Best

Tiphaine

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [November 2, 2022, 9:53am UTC](https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311/3 "2022-11-02T09:53:23Z")

</div>

Hi @MarwanDajani ,

You won’t believe this, but I build exactly the same functionality last week.

Can you share your code so I can compare it to my workflows?

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [November 7, 2022, 4:13pm UTC](https://community.hubspot.com/t/does-creating-a-quote-through-custom-code-not-work/68311/4 "2022-11-07T16:13:02Z")

</div>

Hi @MarwanDajani ,

I created a 10 minute video showing my workflow. Hope it helps!

[https://www.linkedin.com/posts/teun-rutten-500a2b90\_hubspotdevelopertipsandtricks-hubspottipsandtricks-activity-6995404590204514304-IfuQ?utm\_source=share&utm\_medium=member\_android](https://www.linkedin.com/posts/teun-rutten-500a2b90_hubspotdevelopertipsandtricks-hubspottipsandtricks-activity-6995404590204514304-IfuQ?utm_source=share&utm_medium=member_android)
