# Creating quotes via API

**URL:** <https://community.hubspot.com/t/creating-quotes-via-api/101496>\
**Category:** APIs & Integrations\
**Tags:** oauth, object\
**Created:** [March 1, 2024, 2:33pm UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496 "2024-03-01T14:33:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NThiele](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@NThiele](https://community.hubspot.com/u/NThiele)\
**Post date:** [March 1, 2024, 2:33pm UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496/1 "2024-03-01T14:33:08Z")

</div>

Hello everyone 🙂  
I’m still quite new to Hubspot so this might be some silly mistake I don’t see but the support couldn’t help me on this so here we are.  
I want to automate the creation of quotes. I got really far as I can now create quotes via postman with all the necessary information and associations. When I created the quote and open it in Hubspot I can click ‘next’ on all pages to eventually publish the quote.  
Obviously I don’t want to click anything manually.  
If I understand the documentation correctly, I must change the state of the quote to ‘Approval not needed’.  
I’m using postman.  
I have tried both ways:  
1. Creating a quote with said state

2. Creating a quote with with a draft status and then patching it with the said state.  
In both cases I get an error:

“status”: “error”,

“message”: “There was a problem with the request.”,

“correlationId”: “ca2c524b-f48f-4f08-a05f-6517d330b33g”  
Correlation ID varies obviously  
Unfortunately this error doesnt tell me what I did wrong.  
And now here I am…  
Hope anyone can guide me in the correct direction of what I might have done wrong.  
Thanks! 🙂

---

<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:** [March 1, 2024, 10:47pm UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496/2 "2024-03-01T22:47:10Z")

</div>

Hey, @NThiele 👋 Thanks for your question. I agree the error returned isn’t very helpful. I did a bit of digging and found this solution from one of our amazing community champions [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) — [Update quote status](https://community.hubspot.com/t5/APIs-Integrations/POST-quote-quot-There-was-a-problem-with-the-request-quot/m-p/848631/highlight/true#M67383). Can you follow his steps and report back if that works for you, please?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![NThiele](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@NThiele](https://community.hubspot.com/u/NThiele)\
**Post date:** [March 4, 2024, 7:24am UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496/3 "2024-03-04T07:24:12Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)  
Thanks for solution from Zach.  
Unfortunately I was already doing all the steps already.  
I have included the 286, 64 and 67 associations successfully for the status draft but not for any other status.  
I had enabled e-sign and also linked an ‘e-signer’ and just now tried to crate a quote without it. Status ‘APPROVAL\_NOT\_NEEDED’ still gives me the same error.  
Any chance you could try my code to identify if the problem is in the request or maybe even with postman settings etc.?  
Would be much appreciated. Thanks!  
Edit: Yes I also tried copy & paste of Zachs solution but it gave me the error that it needs a currency. Added the currency and I’m back where I startet with:

“status”: “error”,

“message”: “There was a problem with the request.”,

“correlationId”: “f020de9e-fc95-499e-b688-e71600b84abc”

My Code:

```lia-code-sample
{
"properties": {
"hs_title": "API Testquote 11",
"hs_expiration_date": "2024-09-30",
//"hs_esign_enabled": "true",
"hs_status": "APPROVAL_NOT_NEEDED",
//"hs_template": "307938224762",
//Company Sender
"hs_sender_company_name": "Test GmbH",
"hs_sender_company_address": "Teststreet 5",
"hs_sender_company_zip": "50743",
"hs_sender_company_city": "Köln",
"hs_sender_company_country": "Deutschland",

"hs_sender_email": "nickstestmail@web.de",
"hs_sender_firstname": "NT",
"hs_sender_lastname": "NThi",
"hs_sender_phone": "01512323423",
//Vertragsdetails
"hs_currency": "EUR",
"hs_language": "de"
//receiver

},
"associations": [
{
"to": {
"id": 307938224762
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 286 //Quote to quote template
}
]
},
{
"to": {
"id": 17804791675
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 64 //Quote to deal
}
]
},

/*
{
"to": {
"id": 8459875223 //Nicks Test Produkt
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 67 //Quote to line item
}
]
}*/
{
"to": {
"id": 8484061566 //premium 20
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 67 //Quote to line item
}
]
},
/*
{
"to": {
"id": 9911
},

"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 702 //Quote to Contact signer
}
]
},*/
{
"to": {
"id": 19321716766
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 71 //Quote to receiver Company
}
]
}

]
}

```

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [March 7, 2024, 2:04am UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496/4 "2024-03-07T02:04:16Z")

</div>

Hi @NThiele 👋

Based on my testing, it looks like this **could** be related to the Quote property “hs\_currency”.

It seems as though a Quote’s currency can only be set to either:

1. The given HubSpot Portal’s primary/default currency, OR
2. The associated Deal’s currency

This is mentioned in the [relevant HubSpot API documentation](https://developers.hubspot.com/docs/api/crm/quotes) (search for “hs\_currency”).

I get the same error message as you’ve shared when I try to set the Quote’s “hs\_currency” to anything other than the above. As such, I’m guessing [1] euros (code “EUR”) is not your default currency AND/OR is not the currency of the Deal you’re trying to associate with the Quote. Hopefully it’s that simple 🤞

I hope this proves helpful. Please let me know if you have any follow-up questions.

---

<div class="post-metadata">

**Author:** ![NThiele](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@NThiele](https://community.hubspot.com/u/NThiele)\
**Post date:** [March 7, 2024, 9:04am UTC](https://community.hubspot.com/t/creating-quotes-via-api/101496/5 "2024-03-07T09:04:25Z")

</div>

Hi [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811)  
Thank you for testing!  
I think you are correct. Funny enough I tried the quote creating in the production area and it worked perfectly fine. I had no Idea what is different, as the sandbox had been copied from production a couple of month ago.  
I checked and someone seems to have changed the primary currency in the sandbox area.  
What I’m trying to say: Thank you so much.  
Maybe Hubspot can include this in their error messages from now on.
