-
-
Notifications
You must be signed in to change notification settings - Fork 0
Lost Reasons
Read lost reason definitions for deals in Teamleader Focus.
The Lost Reasons resource provides read-only access to the reasons that can be recorded when a deal is marked as lost. Lost reasons are managed in the Teamleader interface and cannot be created or modified through the API.
Access via Teamleader::lostReasons().
info()is simulated. There is no dedicated info endpoint βinfo($id)callslist(['ids' => [$id]])internally and returns the first result.
lostReasons
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β
Supported (ids only) |
| Sorting | β
Supported (name only) |
| Sideloading | β Not supported |
| Creation | β Not supported |
| Update | β Not supported |
| Deletion | β Not supported |
use McoreServices\TeamleaderSDK\Facades\Teamleader;
// All lost reasons
$reasons = Teamleader::lostReasons()->list();
// Specific reasons by ID
$reasons = Teamleader::lostReasons()->list([
'ids' => ['reason-uuid-1', 'reason-uuid-2'],
]);
// Sorted by name, with pagination
$reasons = Teamleader::lostReasons()->list([], [
'sort' => [['field' => 'name', 'order' => 'asc']],
'page_size' => 50,
'page_number' => 1,
]);Simulated via list(['ids' => [$id]]). Returns the first result wrapped as ['data' => [...]], or an empty data key if not found.
$reason = Teamleader::lostReasons()->info('reason-uuid');Returns all lost reasons sorted alphabetically, handling pagination internally.
$reasons = Teamleader::lostReasons()->all();$reasons = Teamleader::lostReasons()->byIds(['reason-uuid-1', 'reason-uuid-2']);Returns true if a lost reason with that UUID exists. Uses list(['ids' => [$id]]) internally.
$exists = Teamleader::lostReasons()->exists('reason-uuid');Returns the name of a lost reason, or null if not found. Uses list(['ids' => [$id]]) internally.
$name = Teamleader::lostReasons()->getName('reason-uuid');
// 'Price too high' or nullReturns a flat [id => name] map for form dropdowns.
$options = Teamleader::lostReasons()->getSelectOptions();
// ['uuid-1' => 'Price too high', 'uuid-2' => 'Went with competitor', ...]| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by reason UUIDs |
Only name is a supported sort field.
$reasons = Teamleader::lostReasons()->list([], [
'sort' => [['field' => 'name', 'order' => 'asc']],
]);[
'data' => [
['id' => 'reason-uuid', 'name' => 'Price too high'],
['id' => 'reason-uuid', 'name' => 'Went with competitor'],
['id' => 'reason-uuid', 'name' => 'No budget'],
],
'meta' => ['page' => ['size' => 20, 'number' => 1], 'matches' => 8],
]$options = Teamleader::lostReasons()->getSelectOptions();
// ['uuid' => 'Price too high', 'uuid' => 'Went with competitor', ...]$options = Teamleader::lostReasons()->getSelectOptions();
$priceReasonId = array_search('Price too high', $options);
if ($priceReasonId) {
Teamleader::deals()->lose('deal-uuid', $priceReasonId, 'Budget was 40% below minimum');
}$reasons = Cache::remember('tl_lost_reasons', 3600, function () {
return Teamleader::lostReasons()->all();
});use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
try {
$reasons = Teamleader::lostReasons()->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