diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ea95d34..b2202706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [15.3.0](https://github.com/pipedrive/client-php/compare/15.2.0...15.3.0) (2026-02-06) + +### Added +- Added `custom_fields` property to the Person entity request schema in v2 endpoints that will fix types in endpoints: + - `POST /api/v2/persons` + - `PATCH /api/v2/persons/{id}` +- Added `custom_fields` property to the Product entity request schema in v2 endpoints that will fix types in endpoints: + - `POST /api/v2/products` + - `PATCH /api/v2/products/{id}` + ## [15.2.0](https://github.com/pipedrive/client-php/compare/15.1.1...15.2.0) (2026-02-06) ### Fixed diff --git a/docs/versions/v2/Model/AddProductRequestBody.md b/docs/versions/v2/Model/AddProductRequestBody.md index 8a014a4a..ffa422b1 100644 --- a/docs/versions/v2/Model/AddProductRequestBody.md +++ b/docs/versions/v2/Model/AddProductRequestBody.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **is_linkable** | **bool** | Whether this product can be added to a deal or not | [optional] [default to true] **visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Light / Growth and Professional plans</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Premium / Ultimate plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] **prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `direct_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and the user's default currency will be assigned. | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes | [optional] **billing_frequency** | [**\Pipedrive\versions\v2\Model\BillingFrequency1**](BillingFrequency1.md) | | [optional] **billing_frequency_cycles** | **int** | Only available in Growth and above plans The number of times the billing frequency repeats for a product in a deal When `billing_frequency` is set to `one-time`, this field must be `null` When `billing_frequency` is set to `weekly`, this field cannot be `null` For all the other values of `billing_frequency`, `null` represents a product billed indefinitely Must be a positive integer less or equal to 208 | [optional] diff --git a/docs/versions/v2/Model/PersonRequestBody.md b/docs/versions/v2/Model/PersonRequestBody.md index ad29975b..c420824e 100644 --- a/docs/versions/v2/Model/PersonRequestBody.md +++ b/docs/versions/v2/Model/PersonRequestBody.md @@ -14,5 +14,6 @@ Name | Type | Description | Notes **visible_to** | **int** | The visibility of the person | [optional] **label_ids** | **int[]** | The IDs of labels assigned to the person | [optional] **marketing_status** | **string** | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/ProductRequest.md b/docs/versions/v2/Model/ProductRequest.md index 9f91952c..c1e4541c 100644 --- a/docs/versions/v2/Model/ProductRequest.md +++ b/docs/versions/v2/Model/ProductRequest.md @@ -13,5 +13,6 @@ Name | Type | Description | Notes **is_linkable** | **bool** | Whether this product can be added to a deal or not | [optional] [default to true] **visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Light / Growth and Professional plans</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Premium / Ultimate plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] **prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `direct_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and the user's default currency will be assigned. | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/UpdateProductRequestBody.md b/docs/versions/v2/Model/UpdateProductRequestBody.md index 2a1b904c..a7ae010f 100644 --- a/docs/versions/v2/Model/UpdateProductRequestBody.md +++ b/docs/versions/v2/Model/UpdateProductRequestBody.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **is_linkable** | **bool** | Whether this product can be added to a deal or not | [optional] [default to true] **visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Light / Growth and Professional plans</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Premium / Ultimate plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] **prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `direct_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and the user's default currency will be assigned. | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes | [optional] **billing_frequency** | [**\Pipedrive\versions\v2\Model\BillingFrequency1**](BillingFrequency1.md) | | [optional] **billing_frequency_cycles** | **int** | Only available in Growth and above plans The number of times the billing frequency repeats for a product in a deal When `billing_frequency` is set to `one-time`, this field must be `null` When `billing_frequency` is set to `weekly`, this field cannot be `null` For all the other values of `billing_frequency`, `null` represents a product billed indefinitely Must be a positive integer less or equal to 208 | [optional] diff --git a/lib/versions/v1/Configuration.php b/lib/versions/v1/Configuration.php index 682c41a1..86e83cbd 100644 --- a/lib/versions/v1/Configuration.php +++ b/lib/versions/v1/Configuration.php @@ -111,11 +111,11 @@ class Configuration */ protected string $host = 'https://api.pipedrive.com/v1'; /** - * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-14.x" by default + * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-15.x" by default * * @var string */ - protected string $userAgent = 'Pipedrive-SDK-PHP-14.x'; + protected string $userAgent = 'Pipedrive-SDK-PHP-15.x'; /** * Debug switch (default set to false) diff --git a/lib/versions/v2/Configuration.php b/lib/versions/v2/Configuration.php index 90cca17f..5b016eef 100644 --- a/lib/versions/v2/Configuration.php +++ b/lib/versions/v2/Configuration.php @@ -111,11 +111,11 @@ class Configuration */ protected string $host = 'https://api.pipedrive.com/api/v2'; /** - * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-14.x" by default + * User agent of the HTTP request, set to "Pipedrive-SDK-PHP-15.x" by default * * @var string */ - protected string $userAgent = 'Pipedrive-SDK-PHP-14.x'; + protected string $userAgent = 'Pipedrive-SDK-PHP-15.x'; /** * Debug switch (default set to false) diff --git a/lib/versions/v2/Model/AddProductRequestBody.php b/lib/versions/v2/Model/AddProductRequestBody.php index d6339b35..810e09d7 100644 --- a/lib/versions/v2/Model/AddProductRequestBody.php +++ b/lib/versions/v2/Model/AddProductRequestBody.php @@ -76,6 +76,7 @@ class AddProductRequestBody implements ModelInterface, ArrayAccess, JsonSerializ 'is_linkable' => 'bool', 'visible_to' => '\Pipedrive\versions\v2\Model\VisibleTo', 'prices' => 'object[]', + 'custom_fields' => 'array', 'billing_frequency' => '\Pipedrive\versions\v2\Model\BillingFrequency1', 'billing_frequency_cycles' => 'int' ]; @@ -98,6 +99,7 @@ class AddProductRequestBody implements ModelInterface, ArrayAccess, JsonSerializ 'is_linkable' => null, 'visible_to' => null, 'prices' => null, + 'custom_fields' => null, 'billing_frequency' => null, 'billing_frequency_cycles' => null ]; @@ -143,6 +145,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'is_linkable', 'visible_to' => 'visible_to', 'prices' => 'prices', + 'custom_fields' => 'custom_fields', 'billing_frequency' => 'billing_frequency', 'billing_frequency_cycles' => 'billing_frequency_cycles' ]; @@ -163,6 +166,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'setIsLinkable', 'visible_to' => 'setVisibleTo', 'prices' => 'setPrices', + 'custom_fields' => 'setCustomFields', 'billing_frequency' => 'setBillingFrequency', 'billing_frequency_cycles' => 'setBillingFrequencyCycles' ]; @@ -183,6 +187,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'getIsLinkable', 'visible_to' => 'getVisibleTo', 'prices' => 'getPrices', + 'custom_fields' => 'getCustomFields', 'billing_frequency' => 'getBillingFrequency', 'billing_frequency_cycles' => 'getBillingFrequencyCycles' ]; @@ -264,6 +269,7 @@ public function __construct(array $data = null) $this->container['is_linkable'] = $data['is_linkable'] ?? true; $this->container['visible_to'] = $data['visible_to'] ?? null; $this->container['prices'] = $data['prices'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; $this->container['billing_frequency'] = $data['billing_frequency'] ?? null; $this->container['billing_frequency_cycles'] = $data['billing_frequency_cycles'] ?? null; } @@ -534,6 +540,30 @@ public function setPrices($prices): self return $this; } + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** * Gets billing_frequency * diff --git a/lib/versions/v2/Model/PersonRequestBody.php b/lib/versions/v2/Model/PersonRequestBody.php index f53de7d8..172c8643 100644 --- a/lib/versions/v2/Model/PersonRequestBody.php +++ b/lib/versions/v2/Model/PersonRequestBody.php @@ -75,7 +75,8 @@ class PersonRequestBody implements ModelInterface, ArrayAccess, JsonSerializable 'phones' => '\Pipedrive\versions\v2\Model\PersonItemPhones[]', 'visible_to' => 'int', 'label_ids' => 'int[]', - 'marketing_status' => 'string' + 'marketing_status' => 'string', + 'custom_fields' => 'array' ]; /** @@ -95,7 +96,8 @@ class PersonRequestBody implements ModelInterface, ArrayAccess, JsonSerializable 'phones' => null, 'visible_to' => null, 'label_ids' => null, - 'marketing_status' => null + 'marketing_status' => null, + 'custom_fields' => null ]; /** @@ -138,7 +140,8 @@ public static function openAPIFormats(): array 'phones' => 'phones', 'visible_to' => 'visible_to', 'label_ids' => 'label_ids', - 'marketing_status' => 'marketing_status' + 'marketing_status' => 'marketing_status', + 'custom_fields' => 'custom_fields' ]; /** @@ -156,7 +159,8 @@ public static function openAPIFormats(): array 'phones' => 'setPhones', 'visible_to' => 'setVisibleTo', 'label_ids' => 'setLabelIds', - 'marketing_status' => 'setMarketingStatus' + 'marketing_status' => 'setMarketingStatus', + 'custom_fields' => 'setCustomFields' ]; /** @@ -174,7 +178,8 @@ public static function openAPIFormats(): array 'phones' => 'getPhones', 'visible_to' => 'getVisibleTo', 'label_ids' => 'getLabelIds', - 'marketing_status' => 'getMarketingStatus' + 'marketing_status' => 'getMarketingStatus', + 'custom_fields' => 'getCustomFields' ]; /** @@ -275,6 +280,7 @@ public function __construct(array $data = null) $this->container['visible_to'] = $data['visible_to'] ?? null; $this->container['label_ids'] = $data['label_ids'] ?? null; $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; } /** @@ -561,6 +567,30 @@ public function setMarketingStatus($marketing_status): self return $this; } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v2/Model/ProductRequest.php b/lib/versions/v2/Model/ProductRequest.php index 9717fe45..36064960 100644 --- a/lib/versions/v2/Model/ProductRequest.php +++ b/lib/versions/v2/Model/ProductRequest.php @@ -74,7 +74,8 @@ class ProductRequest implements ModelInterface, ArrayAccess, JsonSerializable 'owner_id' => 'int', 'is_linkable' => 'bool', 'visible_to' => '\Pipedrive\versions\v2\Model\VisibleTo', - 'prices' => 'object[]' + 'prices' => 'object[]', + 'custom_fields' => 'array' ]; /** @@ -93,7 +94,8 @@ class ProductRequest implements ModelInterface, ArrayAccess, JsonSerializable 'owner_id' => null, 'is_linkable' => null, 'visible_to' => null, - 'prices' => null + 'prices' => null, + 'custom_fields' => null ]; /** @@ -135,7 +137,8 @@ public static function openAPIFormats(): array 'owner_id' => 'owner_id', 'is_linkable' => 'is_linkable', 'visible_to' => 'visible_to', - 'prices' => 'prices' + 'prices' => 'prices', + 'custom_fields' => 'custom_fields' ]; /** @@ -152,7 +155,8 @@ public static function openAPIFormats(): array 'owner_id' => 'setOwnerId', 'is_linkable' => 'setIsLinkable', 'visible_to' => 'setVisibleTo', - 'prices' => 'setPrices' + 'prices' => 'setPrices', + 'custom_fields' => 'setCustomFields' ]; /** @@ -169,7 +173,8 @@ public static function openAPIFormats(): array 'owner_id' => 'getOwnerId', 'is_linkable' => 'getIsLinkable', 'visible_to' => 'getVisibleTo', - 'prices' => 'getPrices' + 'prices' => 'getPrices', + 'custom_fields' => 'getCustomFields' ]; /** @@ -248,6 +253,7 @@ public function __construct(array $data = null) $this->container['is_linkable'] = $data['is_linkable'] ?? true; $this->container['visible_to'] = $data['visible_to'] ?? null; $this->container['prices'] = $data['prices'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; } /** @@ -491,6 +497,30 @@ public function setPrices($prices): self return $this; } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/versions/v2/Model/UpdateProductRequestBody.php b/lib/versions/v2/Model/UpdateProductRequestBody.php index 64c052c3..b2a81851 100644 --- a/lib/versions/v2/Model/UpdateProductRequestBody.php +++ b/lib/versions/v2/Model/UpdateProductRequestBody.php @@ -76,6 +76,7 @@ class UpdateProductRequestBody implements ModelInterface, ArrayAccess, JsonSeria 'is_linkable' => 'bool', 'visible_to' => '\Pipedrive\versions\v2\Model\VisibleTo', 'prices' => 'object[]', + 'custom_fields' => 'array', 'billing_frequency' => '\Pipedrive\versions\v2\Model\BillingFrequency1', 'billing_frequency_cycles' => 'int' ]; @@ -98,6 +99,7 @@ class UpdateProductRequestBody implements ModelInterface, ArrayAccess, JsonSeria 'is_linkable' => null, 'visible_to' => null, 'prices' => null, + 'custom_fields' => null, 'billing_frequency' => null, 'billing_frequency_cycles' => null ]; @@ -143,6 +145,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'is_linkable', 'visible_to' => 'visible_to', 'prices' => 'prices', + 'custom_fields' => 'custom_fields', 'billing_frequency' => 'billing_frequency', 'billing_frequency_cycles' => 'billing_frequency_cycles' ]; @@ -163,6 +166,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'setIsLinkable', 'visible_to' => 'setVisibleTo', 'prices' => 'setPrices', + 'custom_fields' => 'setCustomFields', 'billing_frequency' => 'setBillingFrequency', 'billing_frequency_cycles' => 'setBillingFrequencyCycles' ]; @@ -183,6 +187,7 @@ public static function openAPIFormats(): array 'is_linkable' => 'getIsLinkable', 'visible_to' => 'getVisibleTo', 'prices' => 'getPrices', + 'custom_fields' => 'getCustomFields', 'billing_frequency' => 'getBillingFrequency', 'billing_frequency_cycles' => 'getBillingFrequencyCycles' ]; @@ -264,6 +269,7 @@ public function __construct(array $data = null) $this->container['is_linkable'] = $data['is_linkable'] ?? true; $this->container['visible_to'] = $data['visible_to'] ?? null; $this->container['prices'] = $data['prices'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; $this->container['billing_frequency'] = $data['billing_frequency'] ?? null; $this->container['billing_frequency_cycles'] = $data['billing_frequency_cycles'] ?? null; } @@ -534,6 +540,30 @@ public function setPrices($prices): self return $this; } + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** * Gets billing_frequency *