-
-
Notifications
You must be signed in to change notification settings - Fork 0
Deal Phases
Manage phases within deal pipelines in Teamleader Focus.
The Deal Phases resource manages the stages deals move through in a pipeline β Qualification, Proposal, Negotiation, and so on. Each phase has an attention timer and optional follow-up actions that trigger automatically when a deal enters it.
Access via Teamleader::dealPhases().
dealPhases
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β
Supported (ids, deal_pipeline_id) |
| Sorting | β Not supported |
| Sideloading | β Not supported |
| Creation | β Supported |
| Update | β Supported |
| Deletion | β Supported (requires migration target) |
use McoreServices\TeamleaderSDK\Facades\Teamleader;
$phases = Teamleader::dealPhases()->list();
$phases = Teamleader::dealPhases()->list(['deal_pipeline_id' => 'pipeline-uuid']);
$phases = Teamleader::dealPhases()->list([], ['page_size' => 50, 'page_number' => 1]);$phase = Teamleader::dealPhases()->info('phase-uuid');Required (validated before the request):
| Field | Notes |
|---|---|
name |
Phase display name |
deal_pipeline_id |
Parent pipeline UUID |
requires_attention_after |
Must include amount (int) and unit
|
requires_attention_after.unit |
Must be days or weeks
|
Optional:
| Field | Notes |
|---|---|
follow_up_actions |
Array of action strings β see valid values below |
$phase = Teamleader::dealPhases()->create([
'name' => 'Proposal Sent',
'deal_pipeline_id' => 'pipeline-uuid',
'requires_attention_after' => [
'amount' => 7,
'unit' => 'days',
],
'follow_up_actions' => ['create_task', 'create_call'],
]);Valid follow_up_actions values: create_event, create_call, create_task
Any other value throws InvalidArgumentException.
The id is injected into the request body. Validates requires_attention_after and follow_up_actions if provided.
Teamleader::dealPhases()->update('phase-uuid', [
'name' => 'Advanced Qualification',
'requires_attention_after' => ['amount' => 5, 'unit' => 'days'],
]);Requires a $newPhaseId. Existing deals in the deleted phase are migrated to this target. Throws InvalidArgumentException if $newPhaseId is empty or missing.
Teamleader::dealPhases()->delete('phase-to-delete-uuid', 'target-phase-uuid');Creates a copy of the phase in the same pipeline.
$newPhase = Teamleader::dealPhases()->duplicate('source-phase-uuid');Repositions a phase immediately after $afterPhaseId in the pipeline order.
// Place phase-C after phase-A (making it second)
Teamleader::dealPhases()->move('phase-c-uuid', 'phase-a-uuid');$phases = Teamleader::dealPhases()->forPipeline('pipeline-uuid');$phases = Teamleader::dealPhases()->byIds(['phase-uuid-1', 'phase-uuid-2']);Returns the valid follow-up action values β no API call.
$actions = Teamleader::dealPhases()->getAvailableFollowUpActions();
// ['create_event', 'create_call', 'create_task']Returns the valid unit values β no API call.
$units = Teamleader::dealPhases()->getAvailableAttentionAfterUnits();
// ['days', 'weeks']| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by phase UUIDs |
deal_pipeline_id |
string | Filter by parent pipeline UUID |
[
'data' => [
[
'id' => 'phase-uuid',
'name' => 'Proposal Sent',
'deal_pipeline_id' => 'pipeline-uuid',
'requires_attention_after' => ['amount' => 7, 'unit' => 'days'],
'follow_up_actions' => ['create_task'],
'order' => 2,
],
],
]$pipeline = Teamleader::dealPipelines()->create(['name' => 'SMB Pipeline']);
$pid = $pipeline['data']['id'];
$phases = [
['name' => 'Lead', 'amount' => 3, 'unit' => 'days'],
['name' => 'Qualification', 'amount' => 7, 'unit' => 'days'],
['name' => 'Proposal', 'amount' => 2, 'unit' => 'weeks'],
['name' => 'Closing', 'amount' => 1, 'unit' => 'weeks'],
];
foreach ($phases as $p) {
Teamleader::dealPhases()->create([
'name' => $p['name'],
'deal_pipeline_id' => $pid,
'requires_attention_after' => ['amount' => $p['amount'], 'unit' => $p['unit']],
]);
}$phases = Teamleader::dealPhases()->forPipeline('pipeline-uuid');
// Find target phase by name
$target = null;
foreach ($phases['data'] as $phase) {
if ($phase['name'] === 'Closing') {
$target = $phase['id'];
break;
}
}
if ($target) {
Teamleader::dealPhases()->delete('old-phase-uuid', $target);
}use InvalidArgumentException;
use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
// delete() without migration target
try {
Teamleader::dealPhases()->delete('phase-uuid');
} catch (InvalidArgumentException $e) {
// 'Deal phase deletion requires a target phase for deal migration.'
}
// Invalid attention unit
try {
Teamleader::dealPhases()->create([
'name' => 'Test',
'deal_pipeline_id' => 'uuid',
'requires_attention_after' => ['amount' => 5, 'unit' => 'months'],
]);
} catch (InvalidArgumentException $e) {
// 'requires_attention_after unit must be "days" or "weeks"'
}
// Invalid follow-up action
try {
Teamleader::dealPhases()->create([
...,
'follow_up_actions' => ['send_email'],
]);
} catch (InvalidArgumentException $e) {
// 'Invalid follow_up_action: send_email'
}- Deal Pipelines β Phases belong to pipelines
-
Deals β Deals move through phases via
move() - 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