Approving a quote via API

Hi,

I’m working with the HubSpot API to programmatically create quotes. I’m able to successfully create a quote in DRAFT status, including all relevant details: line items, template, contact, company, sender, and comments.

Once created, the quote remains in DRAFT status and needs to be approved manually through the HubSpot web interface.

I would like to automate this final step via the API. To that end, I’ve tried updating the quote’s status using the following payload:

const payload = { properties: { hs_status: “APPROVAL_NOT_NEEDED”, // also tried “APPROVED” hs_template: “MODERN” // included as requested by the request } };

And the PATCH request:

UrlFetchApp.fetch(`https://api.hubapi.com/crm/v3/objects/quotes/${quoteId}\`, { method: “patch”, contentType: “application/json”, headers: { Authorization: `Bearer ${token}` }, payload: JSON.stringify(payload), muteHttpExceptions: true });

After this call, the quote status changes to “Publishing Quote”, which displays as yellow in the UI. However:

  • The quote remains locked and uneditable.
  • No public link is generated, even after waiting more than 8 hours.
  • The quote cannot be accessed—only deleted.
  • The UI mentions a public link will be generated within 15 minutes, but it never appears.

My goal is to move the quote beyond DRAFT and obtain a public quote URL and PDF download link via the API.

Question:
How can I programmatically move a quote from DRAFT to a fully published state and retrieve the public link and PDF?

Thank you very much for your support.

Hi Antonio,

I recommend that instead of creating the quote in DRAFT status (which is part of the approval flow), create it with the starting status of “APPROVAL_NOT_NEEDED”

best, Pete.

Hello Pete, thanks for the suggestion.

I tried but it doesn’t work. For creating the quote I’m using the payload as follows:

const quotePayload = {

properties: {

hs_title: `Title`,

hs_expiration_date: expiration_date,

hs_comments: comments,

hs_status: “APPROVAL_NOT_NEEDED”,

hs_template_type: “QUOTE”,

hs_proposal_template_path: “@hubspot/cms-quotes-theme/templates/modern.html”,

hs_template: ‘MODERN’,

hs_language: “es”,

hs_sender_firstname: ‘XXXXXXX’,

hs_sender_lastname: ‘xxxxxxxx’,

hs_sender_jobtitle: ‘Account Manager’,

hs_currency : ‘EUR’

}

};

and the quote is not created. It works with hs_status = ‘DRAFT’

Moreover, after creating the quote:

1. I associate the quote to the deal

2. I associate receiver contact to the quote

3. I associate receiver company to the quote

4. I associate template to the quote.

All these steps are possible with ‘DRAFT’ status. Are these possible setting ‘APPROVAL_NOT_NEEDED’?

Thank you very much.