Skip to content

Commit 4681365

Browse files
author
pipedrive-bot
committed
Build 168 - version-minor
1 parent f047544 commit 4681365

20 files changed

+8623
-2659
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88
### Added
9+
- Added `GET /v2/deals/installments` endpoint to fetch all installments added to a list of deals with cursor pagination
10+
- Added `POST /v2/deals/{id}/installments` endpoint to add an installment to a deal
11+
- Added `PATCH /v2/deals/{id}/installments/{installment_id}` endpoint to edit an installment
12+
- Added `DELETE /v2/deals/{id}/installments/{installment_id}` endpoint to delete an installment
13+
### Added
914
- Added deal_id, person_id, org_id and lead_id quick filters for GET /api/v2/activities endpoint.
1015
- Added AdditionalData to the v2 schemas:
1116
- deal

docs/versions/v2/Api/BetaApi.md

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Method | HTTP request | Description
1313
[**deleteAdditionalDiscount()**](BetaApi.md#deleteAdditionalDiscount) | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal
1414
[**deleteDeal()**](BetaApi.md#deleteDeal) | **DELETE** /deals/{id} | Delete a deal
1515
[**deleteDealProduct()**](BetaApi.md#deleteDealProduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal
16+
[**deleteInstallment()**](BetaApi.md#deleteInstallment) | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal
1617
[**deleteOrganization()**](BetaApi.md#deleteOrganization) | **DELETE** /organizations/{id} | Delete a organization
1718
[**deletePerson()**](BetaApi.md#deletePerson) | **DELETE** /persons/{id} | Delete a person
1819
[**getActivities()**](BetaApi.md#getActivities) | **GET** /activities | Get all activities
@@ -22,11 +23,13 @@ Method | HTTP request | Description
2223
[**getDealProducts()**](BetaApi.md#getDealProducts) | **GET** /deals/{id}/products | List products attached to a deal
2324
[**getDeals()**](BetaApi.md#getDeals) | **GET** /deals | Get all deals
2425
[**getDealsProducts()**](BetaApi.md#getDealsProducts) | **GET** /deals/products | Get deal products of several deals
26+
[**getInstallments()**](BetaApi.md#getInstallments) | **GET** /deals/installments | List installments added to a list of deals
2527
[**getOrganization()**](BetaApi.md#getOrganization) | **GET** /organizations/{id} | Get details of a organization
2628
[**getOrganizations()**](BetaApi.md#getOrganizations) | **GET** /organizations | Get all organizations
2729
[**getPerson()**](BetaApi.md#getPerson) | **GET** /persons/{id} | Get details of a person
2830
[**getPersons()**](BetaApi.md#getPersons) | **GET** /persons | Get all persons
2931
[**postAdditionalDiscount()**](BetaApi.md#postAdditionalDiscount) | **POST** /deals/{id}/discounts | Add a discount to a deal
32+
[**postInstallment()**](BetaApi.md#postInstallment) | **POST** /deals/{id}/installments | Add an installment to a deal
3033
[**searchDeals()**](BetaApi.md#searchDeals) | **GET** /deals/search | Search deals
3134
[**searchItem()**](BetaApi.md#searchItem) | **GET** /itemSearch | Perform a search from multiple item types
3235
[**searchItemByField()**](BetaApi.md#searchItemByField) | **GET** /itemSearch/field | Perform a search using a specific field from an item type
@@ -37,6 +40,7 @@ Method | HTTP request | Description
3740
[**updateAdditionalDiscount()**](BetaApi.md#updateAdditionalDiscount) | **PATCH** /deals/{id}/discounts/{discount_id} | Update a discount added to a deal
3841
[**updateDeal()**](BetaApi.md#updateDeal) | **PATCH** /deals/{id} | Update a deal
3942
[**updateDealProduct()**](BetaApi.md#updateDealProduct) | **PATCH** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal
43+
[**updateInstallment()**](BetaApi.md#updateInstallment) | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal
4044
[**updateOrganization()**](BetaApi.md#updateOrganization) | **PATCH** /organizations/{id} | Update a organization
4145
[**updatePerson()**](BetaApi.md#updatePerson) | **PATCH** /persons/{id} | Update a person
4246

@@ -632,6 +636,73 @@ Name | Type | Description | Notes
632636
[[Back to Model list]](../README.md#documentation-for-models)
633637
[[Back to README]](../README.md)
634638

639+
## `deleteInstallment()`
640+
641+
```php
642+
deleteInstallment($id, $installment_id): \Pipedrive\versions\v2\Model\DeleteInstallmentResponse
643+
```
644+
645+
Delete an installment from a deal
646+
647+
Removes an installment from a deal. Only available in Advanced and above plans.
648+
649+
### Example
650+
651+
```php
652+
653+
require_once(__DIR__ . '/vendor/autoload.php');
654+
655+
656+
// Configure API key authorization: api_key
657+
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
658+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
659+
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('api_token', 'Bearer');
660+
661+
// Configure OAuth2 access token for authorization: oauth2
662+
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
663+
664+
665+
$apiInstance = new Pipedrive\versions\v2\Api\BetaApi(
666+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
667+
// This is optional, `GuzzleHttp\Client` will be used as default.
668+
new GuzzleHttp\Client(),
669+
$config
670+
);
671+
$id = 56; // int | The ID of the deal
672+
$installment_id = 56; // int | The ID of the installment
673+
674+
try {
675+
$result = $apiInstance->deleteInstallment($id, $installment_id);
676+
print_r($result);
677+
} catch (Exception $e) {
678+
echo 'Exception when calling BetaApi->deleteInstallment: ', $e->getMessage(), PHP_EOL;
679+
}
680+
```
681+
682+
### Parameters
683+
684+
Name | Type | Description | Notes
685+
------------- | ------------- | ------------- | -------------
686+
**id** | **int**| The ID of the deal |
687+
**installment_id** | **int**| The ID of the installment |
688+
689+
### Return type
690+
691+
[**\Pipedrive\versions\v2\Model\DeleteInstallmentResponse**](../Model/DeleteInstallmentResponse.md)
692+
693+
### Authorization
694+
695+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
696+
697+
### HTTP request headers
698+
699+
- **Content-Type**: Not defined
700+
- **Accept**: `application/json`
701+
702+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
703+
[[Back to Model list]](../README.md#documentation-for-models)
704+
[[Back to README]](../README.md)
705+
635706
## `deleteOrganization()`
636707

637708
```php
@@ -1295,6 +1366,79 @@ Name | Type | Description | Notes
12951366
[[Back to Model list]](../README.md#documentation-for-models)
12961367
[[Back to README]](../README.md)
12971368

1369+
## `getInstallments()`
1370+
1371+
```php
1372+
getInstallments($deal_ids, $cursor, $limit, $sort_by, $sort_direction): \Pipedrive\versions\v2\Model\InstallmentsResponse
1373+
```
1374+
1375+
List installments added to a list of deals
1376+
1377+
Lists installments attached to a list of deals. Only available in Advanced and above plans.
1378+
1379+
### Example
1380+
1381+
```php
1382+
1383+
require_once(__DIR__ . '/vendor/autoload.php');
1384+
1385+
1386+
// Configure API key authorization: api_key
1387+
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
1388+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
1389+
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('api_token', 'Bearer');
1390+
1391+
// Configure OAuth2 access token for authorization: oauth2
1392+
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
1393+
1394+
1395+
$apiInstance = new Pipedrive\versions\v2\Api\BetaApi(
1396+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
1397+
// This is optional, `GuzzleHttp\Client` will be used as default.
1398+
new GuzzleHttp\Client(),
1399+
$config
1400+
);
1401+
$deal_ids = array(56); // int[] | An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
1402+
$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page
1403+
$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1404+
$sort_by = 'id'; // string | The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`.
1405+
$sort_direction = 'asc'; // string | The sorting direction. Supported values: `asc`, `desc`.
1406+
1407+
try {
1408+
$result = $apiInstance->getInstallments($deal_ids, $cursor, $limit, $sort_by, $sort_direction);
1409+
print_r($result);
1410+
} catch (Exception $e) {
1411+
echo 'Exception when calling BetaApi->getInstallments: ', $e->getMessage(), PHP_EOL;
1412+
}
1413+
```
1414+
1415+
### Parameters
1416+
1417+
Name | Type | Description | Notes
1418+
------------- | ------------- | ------------- | -------------
1419+
**deal_ids** | [**int[]**](../Model/int.md)| An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. |
1420+
**cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional]
1421+
**limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional]
1422+
**sort_by** | **string**| The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. | [optional] [default to 'id']
1423+
**sort_direction** | **string**| The sorting direction. Supported values: `asc`, `desc`. | [optional] [default to 'asc']
1424+
1425+
### Return type
1426+
1427+
[**\Pipedrive\versions\v2\Model\InstallmentsResponse**](../Model/InstallmentsResponse.md)
1428+
1429+
### Authorization
1430+
1431+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
1432+
1433+
### HTTP request headers
1434+
1435+
- **Content-Type**: Not defined
1436+
- **Accept**: `application/json`
1437+
1438+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
1439+
[[Back to Model list]](../README.md#documentation-for-models)
1440+
[[Back to README]](../README.md)
1441+
12981442
## `getOrganization()`
12991443

13001444
```php
@@ -1672,6 +1816,73 @@ Name | Type | Description | Notes
16721816
[[Back to Model list]](../README.md#documentation-for-models)
16731817
[[Back to README]](../README.md)
16741818

1819+
## `postInstallment()`
1820+
1821+
```php
1822+
postInstallment($id, $body): \Pipedrive\versions\v2\Model\AddInstallmentResponse
1823+
```
1824+
1825+
Add an installment to a deal
1826+
1827+
Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
1828+
1829+
### Example
1830+
1831+
```php
1832+
1833+
require_once(__DIR__ . '/vendor/autoload.php');
1834+
1835+
1836+
// Configure API key authorization: api_key
1837+
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
1838+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
1839+
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('api_token', 'Bearer');
1840+
1841+
// Configure OAuth2 access token for authorization: oauth2
1842+
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
1843+
1844+
1845+
$apiInstance = new Pipedrive\versions\v2\Api\BetaApi(
1846+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
1847+
// This is optional, `GuzzleHttp\Client` will be used as default.
1848+
new GuzzleHttp\Client(),
1849+
$config
1850+
);
1851+
$id = 56; // int | The ID of the deal
1852+
$body = new \stdClass; // object
1853+
1854+
try {
1855+
$result = $apiInstance->postInstallment($id, $body);
1856+
print_r($result);
1857+
} catch (Exception $e) {
1858+
echo 'Exception when calling BetaApi->postInstallment: ', $e->getMessage(), PHP_EOL;
1859+
}
1860+
```
1861+
1862+
### Parameters
1863+
1864+
Name | Type | Description | Notes
1865+
------------- | ------------- | ------------- | -------------
1866+
**id** | **int**| The ID of the deal |
1867+
**body** | **object**| | [optional]
1868+
1869+
### Return type
1870+
1871+
[**\Pipedrive\versions\v2\Model\AddInstallmentResponse**](../Model/AddInstallmentResponse.md)
1872+
1873+
### Authorization
1874+
1875+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
1876+
1877+
### HTTP request headers
1878+
1879+
- **Content-Type**: `application/json`
1880+
- **Accept**: `application/json`
1881+
1882+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
1883+
[[Back to Model list]](../README.md#documentation-for-models)
1884+
[[Back to README]](../README.md)
1885+
16751886
## `searchDeals()`
16761887

16771888
```php
@@ -2408,6 +2619,75 @@ Name | Type | Description | Notes
24082619
[[Back to Model list]](../README.md#documentation-for-models)
24092620
[[Back to README]](../README.md)
24102621

2622+
## `updateInstallment()`
2623+
2624+
```php
2625+
updateInstallment($id, $installment_id, $body): \Pipedrive\versions\v2\Model\UpdateInstallmentResponse
2626+
```
2627+
2628+
Update an installment added to a deal
2629+
2630+
Edits an installment added to a deal. Only available in Advanced and above plans.
2631+
2632+
### Example
2633+
2634+
```php
2635+
2636+
require_once(__DIR__ . '/vendor/autoload.php');
2637+
2638+
2639+
// Configure API key authorization: api_key
2640+
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
2641+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
2642+
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('api_token', 'Bearer');
2643+
2644+
// Configure OAuth2 access token for authorization: oauth2
2645+
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
2646+
2647+
2648+
$apiInstance = new Pipedrive\versions\v2\Api\BetaApi(
2649+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
2650+
// This is optional, `GuzzleHttp\Client` will be used as default.
2651+
new GuzzleHttp\Client(),
2652+
$config
2653+
);
2654+
$id = 56; // int | The ID of the deal
2655+
$installment_id = 56; // int | The ID of the installment
2656+
$body = new \stdClass; // object
2657+
2658+
try {
2659+
$result = $apiInstance->updateInstallment($id, $installment_id, $body);
2660+
print_r($result);
2661+
} catch (Exception $e) {
2662+
echo 'Exception when calling BetaApi->updateInstallment: ', $e->getMessage(), PHP_EOL;
2663+
}
2664+
```
2665+
2666+
### Parameters
2667+
2668+
Name | Type | Description | Notes
2669+
------------- | ------------- | ------------- | -------------
2670+
**id** | **int**| The ID of the deal |
2671+
**installment_id** | **int**| The ID of the installment |
2672+
**body** | **object**| | [optional]
2673+
2674+
### Return type
2675+
2676+
[**\Pipedrive\versions\v2\Model\UpdateInstallmentResponse**](../Model/UpdateInstallmentResponse.md)
2677+
2678+
### Authorization
2679+
2680+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
2681+
2682+
### HTTP request headers
2683+
2684+
- **Content-Type**: `application/json`
2685+
- **Accept**: `application/json`
2686+
2687+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
2688+
[[Back to Model list]](../README.md#documentation-for-models)
2689+
[[Back to README]](../README.md)
2690+
24112691
## `updateOrganization()`
24122692

24132693
```php

0 commit comments

Comments
 (0)