-
-
Notifications
You must be signed in to change notification settings - Fork 0
Deal Pipelines
Manage deal pipelines in Teamleader Focus.
The Deal Pipelines resource manages the sales pipelines that contain deal phases. Each pipeline has a name and an optional default flag. Deleting a pipeline requires specifying where to migrate each of its phases' deals.
Access via Teamleader::dealPipelines().
dealPipelines
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β
Supported (ids, status) |
| Sorting | β Not supported |
| Sideloading | β Not supported |
| Creation | β Supported |
| Update | β Supported |
| Deletion | β Supported (requires phase migrations) |
Note: The source contains
Log::debug()calls insidelist()that log request and response details. This is existing behaviour, not something you need to account for.
use McoreServices\TeamleaderSDK\Facades\Teamleader;
$pipelines = Teamleader::dealPipelines()->list();
$pipelines = Teamleader::dealPipelines()->list(['status' => 'open']);
$pipelines = Teamleader::dealPipelines()->list([], ['page_size' => 20, 'page_number' => 1]);Status filter:
statusis coerced to an array internally. Pass'open'or['open']β both work.
$pipeline = Teamleader::dealPipelines()->info('pipeline-uuid');Required: name. Throws InvalidArgumentException if absent.
$pipeline = Teamleader::dealPipelines()->create(['name' => 'Enterprise Pipeline']);Required: name. The id is injected into the request body. Throws InvalidArgumentException if name is empty.
Teamleader::dealPipelines()->update('pipeline-uuid', ['name' => 'Enterprise Sales Pipeline']);Deletes a pipeline. $migratePhases is an array of {old_phase_id, new_phase_id} objects specifying where each phase's deals should be moved. Pass an empty array to delete without migrations (only safe if all phases are already empty).
Teamleader::dealPipelines()->delete('pipeline-uuid', [
['old_phase_id' => 'source-phase-uuid-1', 'new_phase_id' => 'target-phase-uuid-1'],
['old_phase_id' => 'source-phase-uuid-2', 'new_phase_id' => 'target-phase-uuid-2'],
]);
// No migration (only if phases are empty)
Teamleader::dealPipelines()->delete('pipeline-uuid', []);Copies a pipeline along with all its phases.
$newPipeline = Teamleader::dealPipelines()->duplicate('source-pipeline-uuid');Sets a pipeline as the default for new deals.
Teamleader::dealPipelines()->markAsDefault('pipeline-uuid');| Method | Filter applied |
|---|---|
open() |
status: open |
pendingDeletion() |
status: pending_deletion |
byIds(array $ids) |
ids |
$open = Teamleader::dealPipelines()->open();
$pending = Teamleader::dealPipelines()->pendingDeletion();| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by pipeline UUIDs |
status |
string or array |
open or pending_deletion β string coerced to array |
Valid status values: open, pending_deletion
[
'data' => [
[
'id' => 'pipeline-uuid',
'name' => 'Enterprise Sales Pipeline',
'default' => true,
],
],
'meta' => ['page' => ['size' => 20, 'number' => 1], 'matches' => 3],
]$pipeline = Teamleader::dealPipelines()->create(['name' => 'SMB Pipeline']);
Teamleader::dealPipelines()->markAsDefault($pipeline['data']['id']);$sourcePhases = Teamleader::dealPhases()->forPipeline('old-pipeline-uuid');
$targetPhases = Teamleader::dealPhases()->forPipeline('new-pipeline-uuid');
// Map by position (assumes same number of phases)
$migrations = [];
foreach ($sourcePhases['data'] as $i => $sourcePhase) {
if (isset($targetPhases['data'][$i])) {
$migrations[] = [
'old_phase_id' => $sourcePhase['id'],
'new_phase_id' => $targetPhases['data'][$i]['id'],
];
}
}
Teamleader::dealPipelines()->delete('old-pipeline-uuid', $migrations);$pipelines = Teamleader::dealPipelines()->list();
$default = null;
foreach ($pipelines['data'] as $pipeline) {
if ($pipeline['default'] === true) {
$default = $pipeline;
break;
}
}use InvalidArgumentException;
use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
// Missing name on create
try {
Teamleader::dealPipelines()->create([]);
} catch (InvalidArgumentException $e) {
// 'Pipeline name is required'
}
// Non-array migrations on delete
try {
Teamleader::dealPipelines()->delete('pipeline-uuid', 'wrong-type');
} catch (InvalidArgumentException $e) {
// 'Pipeline deletion expects an array of phase migrations as the second parameter'
}- Deal Phases β Phases belong to pipelines
- Deals β Deals are assigned to a pipeline via their phase
- Filtering β Filter and pagination reference
Last Updated: August 2026 β’ SDK Version: 2.2.2 β’ Made with β€οΈ by MCore Services
- Departments
- Users
- Teams
- Custom Fields
- Work Types
- Document Templates
- Currencies
- Notes
- Email Tracking
- Closing Days
- Day Off Types
- Days Off
- User Schedules
- Invoices
- Credit Notes
- Subscriptions
- Payment Methods
- Payment Terms
- Tax Rates
- Withholding Tax Rates
- Commercial Discounts
Next Gen Projects
Legacy Projects