APIs & Integrations

ansar
Member

How to add deal?

How to add deal via api with products. Please share one complete example using curl.

0 Upvotes
13 Replies 13
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

You can associate line items to deals using the CRM Associations API. Here's an example:

{
  "fromObjectId": 496346, // This is the line item id
  "toObjectId": 176602, // This is the deal id
  "category": "HUBSPOT_DEFINED",
  "definitionId": 20 // This is the definitionId for a line item -> deal association
}
0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

I was able to create a product (here) with the following url & request body:

https://api.hubapi.com/crm-objects/v1/objects/products?hapikey=((YOUR API KEY))

Body:

[
  {
    "name": "name",
    "value": "Test Product - Derek Gervaist"
  },
  {
    "name": "description",
    "value": "This is a test product created by Derek Gervais, HubSpot Developer Advocate"
  },
  {
    "name": "price",
    "value": "100.00"
  },
  {
    "name": "recurringbillingfrequency",
    "value": "quarterly"
  }
]
0 Upvotes
ansar
Member

How to add deal?

Hello,

We are now able to create product and line items. We have associated contact with deal but we are not able to associate line item/product to deal. So please send one example that how to associate line item/product to deal.

Thanks!

ansar
Member

How to add deal?

Can we get any response?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

Apologies for the delay in resolution here. This topic didn't get properly updated, but the issue here is that since products is a Sales pro feature, test portals aren't currently auto-provisioned. I've given that portal temporary access for the next 60 days, which should give you time to fully test the Products API. In the future, test portals will eventually automatically have appropriate access.

0 Upvotes
ansar
Member

How to add deal?

We are unable to get the product api work. So can you please share one example of product creation.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

No not the client ID; the Hub ID is a unique 5-6 digit number that appears in the URL bar when you visit the test portal:

0 Upvotes
ansar
Member

How to add deal?

Here is the hub id: 4746115 . Please check it soon.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

There is a separate Products API; I'll include a link to the docs below. I'm not entirely clear on the other part of your question, though; are you in a test portal without access to products? If you give me your Hub ID, I can investigate.

0 Upvotes
ansar
Member

How to add deal?

Yes, we have test portal without access to products and we need access of products. Are you asking the client id?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to add deal?

Hi @ansar,

To create a deal, you'll want to make a request to the 'Create a deal' endpoint of the Deals API. To associate the deal with a product, you'll want to create a line item and associated it with the deal via the Line Items API and CRM Associations API:

0 Upvotes
ansar
Member

How to add deal?

Thanks for your reply.
Hubspot is not allowing to add the products and asking for update to enterprise plan. So how use it with trial version.
Is there any api for creting products separately?

0 Upvotes
ansar
Member

How to add deal?

We are waiting for response.

0 Upvotes