APIs & Integrations

Not applicable

Problems creating a deal property group

When I use the example body for the Create Deal Property Group endpoint (http://developers.hubspot.com/docs/methods/deals/create_deal_property_group) to create a new Deal Group, the properties I specify don’t seem to attach to the Deal Group object correctly. Here’s what I use to create the object:
> {
> “name”: “invoicing”,
> “displayName”: “Invoicing”,
> “displayOrder”: 6,
> “properties”: [
> {
> “description”: “A company’s shipping address”,
> “label”: “Shipping Address”,
> “fieldType”: “text”,
> “formField”: True,
> “type”: “string”,
> “options”: [],
> “displayOrder”: 0,
> “name”: “shippingaddress”
> }
> ]
> }

But when I get that group back from the server, with the “show options” option enabled (http://api.hubapi.com/deals/v1/groups/named/invoicing2?hapikey=demo&includeProperties=true), the properties I specified are nowhere to be found:

{
  "name": "invoicing2",
  "displayName": "Invoicing2",
  "displayOrder": 6,
  "hubspotDefined": false,
  "properties": []
}

What happened to the properties?

0 Upvotes
5 Replies 5
seb_fairchild
Member

Problems creating a deal property group

Thanks @Adam, I’ll make a note to have those docs updated.

Sebastian

0 Upvotes
seb_fairchild
Member

Problems creating a deal property group

@Adam,

That endpoint also doesn’t take a properties parameter so I’ll have to get the docs updated.

You’ll need to use the create/update deal properties endpoints to insert new properties. If you want to insert them into a specific group just reference it in the groupName param in your payload.

Here is an example POST to deals/v1/properties to create a brand new property

{
            "name": "invoice_number",
            "label": "Invoice Number",
            "description": "",
            "groupName": "invoicing",
            "type": "string",
            "fieldType": "text",
            "options": [],
            "formField": true,
            "displayOrder": 10,
            "readOnlyValue": false,
            "readOnlyDefinition": false,
            "hidden": false,
            "mutableDefinitionNotDeletable": false,
            "calculated": false,
            "externalOptions": false,
            "displayMode": "current_value"
        }
0 Upvotes
Not applicable

Problems creating a deal property group

@seb_fairchild

The companies and contact groups also seem to have this problem

0 Upvotes
seb_fairchild
Member

Problems creating a deal property group

@Adam,

Looks like the docs are incorrect, you cannot create properties at the same time you create the group. You’ll need to make two separate requests. I’ll get the docs updated.

Sebastian

0 Upvotes
Not applicable

Problems creating a deal property group

@seb_fairchild

I’ve tried using the dedicated update endpoint and I’m still not having any luck.

PUTing to the update endpoint (http://api.hubapi.com/deals/v1/groups/named/invoicing?access_token=…)

{
“name”: “invoicing”,
“displayName”: “Updated Invoicing”,
“displayOrder”: 6,
“properties”: [
{“name”: “hs_lastmodifieddate”}
]
}

Gives me a return code of 200 OK. Is the properties array correct? Its structure isn’t mentioned anywhere on the page.

When I GET invoicing:

{
“name”: “invoicing”,
“displayName”: “Updated Invoicing”,
“displayOrder”: 6,
“hubspotDefined”: false,
“properties”: []
}

0 Upvotes