# POST quote "There was a problem with the request"

**URL:** <https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [September 12, 2023, 8:19am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421 "2023-09-12T08:19:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![csuch](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@csuch](https://community.hubspot.com/u/csuch)\
**Post date:** [September 12, 2023, 8:19am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421/1 "2023-09-12T08:19:19Z")

</div>

A “GET” request to

[https://api.hubapi.com/crm/v3/objects/quotes](https://api.hubapi.com/crm/v3/objects/quotes)

produces a response of all the quotes in the system.

A “POST” request to  
[https://api.hubapi.com/crm/v3/objects/quote/QUOTE\_ID](https://api.hubapi.com/crm/v3/objects/quote/QUOTE_ID)

consisting of this data to update the quotes status

_{_

```
*"properties": {*

    *"hs\_status": "APPROVAL\_NOT\_NEEDED"*

*}*

```

_}_

produces an error “Error 405 Method Not Allowed”  
To create a new Quote with a POST request to  
[https://api.hubapi.com/crm/v3/objects/quote](https://api.hubapi.com/crm/v3/objects/quote)  
which consists of this data.

{

```
"properties": {

    "hs\_title": "CRS Quote 5",

    "hs\_status": "APPROVAL\_NOT\_NEEDED",

     "hs\_expiration\_date": "2023-09-13"

}

```

}

produces this error

“status”: “error”,

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

“correlationId”: “1c085753-ffaf-4171-bc34-f237f7ee1bdb”

There are no descriptive error logs or detail which assists me with a diagnosis. The detail in the error is very limited and doesnt help me determine an appropriate fix

---

<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:** [September 13, 2023, 1:38am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421/2 "2023-09-13T01:38:08Z")

</div>

Hi @csuch 👋

I’ve managed to successfully create a Quote via API. In order to do so, I had to read in-between the lines (a lot!). I completely agree that [the documentation](https://developers.hubspot.com/docs/api/crm/quotes) is lacking and some of the API error responses are not helpful.

Relating to your Update Quote request, you’ll need to use request method “PATCH”, not “POST”. That should explain the 405 error message for that case.

Finally, here’s an example Create Quote request that might help you take a further step forward:

- **POST** [https://api.hubapi.com/crm/v3/objects/QUOTE](https://api.hubapi.com/crm/v3/objects/QUOTE)
- **Headers** :
  - Authorization: Bearer _{{your\_access\_token}}_
  - Content-Type: application/json

- **Request Body (JSON)**:

```lia-code-sample
{
 "properties": {
 "hs_title": "CRS Quote 5",
 "hs_status": "APPROVAL_NOT_NEEDED",
 "hs_expiration_date": "2023-09-13"
 },
 "associations": [
 {
 "to": {
 "id": deal_id
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 64
 }
 ]
 },
 {
 "to": {
 "id": line_item_id
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 67
 }
 ]
 },
 {
 "to": {
 "id": quote_template_id
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 286
 }
 ]
 }
 ]
}

```

Note, you’ll need to replace _deal\_id_, _line\_item\_id_ and _quote\_template\_id_ with IDs relevant to your case.

Based on my testing, all 3 of the following association types are required when creating a Quote via API:

- **Quote to Deal**
  - name: quote\_to\_deal
  - associationTypeId: 64
  - associationCategory: HUBSPOT\_DEFINED

- **Quote to Line Item**
  - name: quote\_to\_line\_item
  - associationTypeId: 67
  - associationCategory: HUBSPOT\_DEFINED

- **Quote to Quote Template**
  - name: quote\_to\_quote\_template
  - associationTypeId: 286
  - associationCategory: HUBSPOT\_DEFINED

To find the relevant **quote\_template\_id** , you’ll want to replicate this request:

- **GET** [https://api.hubapi.com/crm/v3/objects/quote\_template?properties=hs\_name,hs\_active](https://api.hubapi.com/crm/v3/objects/quote%5C_template?properties=hs%5C_name,hs%5C_active)
- **Headers** :
  - Authorization: Bearer _{{your\_access\_token}}_

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

---

<div class="post-metadata">

**Author:** ![csuch](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@csuch](https://community.hubspot.com/u/csuch)\
**Post date:** [September 13, 2023, 6:41am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421/3 "2023-09-13T06:41:47Z")

</div>

oh, so would you create the line\_items before hand, then use the line\_item\_ids when creating the quote to associated the line items with your new quote?  
I was adding line\_items afterwards, which didnt seem to link to the quote

---

<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:** [September 13, 2023, 7:50am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421/4 "2023-09-13T07:50:49Z")

</div>

Hi @csuch 👋

Yes, that’s right. You’ll need to create your line items beforehand, then associate them to the Quote when you create it using their ID(s).

Good luck 🙂

---

<div class="post-metadata">

**Author:** ![csuch](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@csuch](https://community.hubspot.com/u/csuch)\
**Post date:** [September 13, 2023, 8:04am UTC](https://community.hubspot.com/t/post-quote-there-was-a-problem-with-the-request/89421/5 "2023-09-13T08:04:48Z")

</div>

ah ok, I see.  
The docs are somewhat sketchy arent they, its not very clear.  
I will take your advice and try that.  
Thank you very much, appreciate your assistance 👍
