-
-
Notifications
You must be signed in to change notification settings - Fork 0
Deal Sources
Read deal source definitions in Teamleader Focus.
The Deal Sources resource provides read-only access to the sources that can be assigned to deals β Web, Referral, Cold Call, and so on. Sources are defined in Teamleader and cannot be created or modified through the API.
Access via Teamleader::dealSources().
dealSources
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β
Supported (ids only) |
| Sorting | β
Supported (name only β always forced to asc) |
| Sideloading | β Not supported |
| Creation | β Not supported |
| Update | β Not supported |
| Deletion | β Not supported |
Sort behaviour: Every
list()call appliessort: [{field: name, order: asc}]β even when no sort is requested. Any other sort field or order is silently replaced withname/asc.
use McoreServices\TeamleaderSDK\Facades\Teamleader;
// All sources β always sorted by name asc
$sources = Teamleader::dealSources()->list();
// Specific sources by ID
$sources = Teamleader::dealSources()->list(['ids' => ['source-uuid-1', 'source-uuid-2']]);
// With pagination
$sources = Teamleader::dealSources()->list([], ['page_size' => 50, 'page_number' => 1]);Fetches all sources without pagination constraints. Returns the raw API response.
$sources = Teamleader::dealSources()->all();Returns a flat [id => name] map β useful for form dropdowns. Calls all() internally.
$options = Teamleader::dealSources()->selectOptions();
// ['uuid-1' => 'Cold Call', 'uuid-2' => 'Referral', 'uuid-3' => 'Web']Client-side filtering β calls all() then filters by name in PHP. Case-insensitive partial match.
$sources = Teamleader::dealSources()->search('ref');
// Matches sources whose name contains 'ref', e.g. 'Referral'| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by source UUIDs |
[
'data' => [
['id' => 'source-uuid', 'name' => 'Cold Call'],
['id' => 'source-uuid', 'name' => 'Referral'],
['id' => 'source-uuid', 'name' => 'Web'],
],
'meta' => ['page' => ['size' => 20, 'number' => 1], 'matches' => 6],
]$options = Teamleader::dealSources()->selectOptions();
// Use directly in a select: ['uuid' => 'Source Name', ...]$matches = Teamleader::dealSources()->search('referral');
$source = $matches['data'][0] ?? null;$sources = Cache::remember('tl_deal_sources', 3600, function () {
return Teamleader::dealSources()->all();
});use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
try {
$sources = Teamleader::dealSources()->list();
} catch (TeamleaderException $e) {
Log::error('Teamleader error', ['message' => $e->getMessage()]);
}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