-
-
Notifications
You must be signed in to change notification settings - Fork 0
Subscriptions
Manage recurring subscriptions in Teamleader Focus.
Subscriptions automatically generate invoices on a billing cycle. Each billing run can produce a draft, book it, or book and send it via email, Peppol, or postal service. Subscriptions cannot be deleted β use deactivate() instead.
Access via Teamleader::subscriptions().
No
delete(): Subscriptions usedeactivate().update()anddeactivate()both return empty (HTTP 204).
starts_onandbilling_cyclecan only be changed before the first invoice has been generated.
subscriptions
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β Supported |
| Sorting | β
Supported (title, created_at, status) |
| Sideloading | β Not supported |
| Creation | β Supported |
| Update | β Supported |
| Deletion | β Use deactivate()
|
use McoreServices\TeamleaderSDK\Facades\Teamleader;
$subscriptions = Teamleader::subscriptions()->list();
$subscriptions = Teamleader::subscriptions()->list(
['status' => ['active'], 'department_id' => 'dept-uuid'],
['sort' => [['field' => 'title', 'order' => 'asc']], 'page_size' => 50]
);Status filter: must be an array. Values are validated:
active,deactivated.
$sub = Teamleader::subscriptions()->info('subscription-uuid');Seven fields are required and validated before the request:
| Required field | Notes |
|---|---|
invoicee |
Must include customer.type (contact or company) and customer.id
|
starts_on |
YYYY-MM-DD |
billing_cycle |
periodicity.unit validated: week, month, year
|
title |
Subscription title |
grouped_lines |
Array of line item groups |
payment_term |
type validated: cash, end_of_month, after_invoice_date
|
invoice_generation |
action validated: draft, book, book_and_send
|
When invoice_generation.action is book_and_send, sending_methods is required. Each method's method is validated: email, peppol, postal_service.
$sub = Teamleader::subscriptions()->create([
'invoicee' => ['customer' => ['type' => 'company', 'id' => 'company-uuid']],
'department_id'=> 'dept-uuid',
'starts_on' => '2025-05-01',
'ends_on' => '2026-04-30', // optional
'billing_cycle'=> [
'periodicity' => ['unit' => 'month', 'period' => 1],
'days_in_advance' => 7,
],
'title' => 'Monthly Retainer',
'grouped_lines'=> [[
'section' => ['title' => 'Services'],
'line_items' => [[
'quantity' => 1,
'description' => 'Monthly retainer fee',
'unit_price' => ['amount' => 2500.0, 'tax' => 'excluding'],
'tax_rate_id' => 'tax-rate-uuid',
]],
]],
'payment_term' => ['type' => 'after_invoice_date', 'days' => 30],
'invoice_generation' => [
'action' => 'book_and_send',
'sending_methods' => [['method' => 'email']],
],
]);The id is injected into the request body. Returns empty (HTTP 204). All fields are optional.
Teamleader::subscriptions()->update('subscription-uuid', [
'title' => 'Updated Retainer',
'ends_on' => '2025-12-31',
'invoice_generation' => ['action' => 'book'],
]);
starts_onandbilling_cyclecan only be updated if no invoices have been generated yet.
Stops the subscription from generating future invoices. Returns empty (HTTP 204).
Teamleader::subscriptions()->deactivate('subscription-uuid');| Method | Filter applied |
|---|---|
active() |
status: ['active'] |
deactivated() |
status: ['deactivated'] |
forCustomer(string $type, string $id) |
customer β validates type |
forDepartment(string $departmentId) |
department_id |
forDeal(string $dealId) |
deal_id |
forInvoice(string $invoiceId) |
invoice_id β find subscription that generated an invoice |
byIds(array $ids) |
ids β throws if empty |
$subs = Teamleader::subscriptions()->active();
$subs = Teamleader::subscriptions()->forCustomer('company', 'company-uuid');
$subs = Teamleader::subscriptions()->forInvoice('invoice-uuid'); // trace back to source subscription| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by subscription UUIDs |
invoice_id |
string | Subscriptions that generated this invoice |
deal_id |
string | Subscriptions created from this deal |
department_id |
string | Department UUID |
customer |
object | {type: contact|company, id: uuid} |
status |
array |
active, deactivated β validated |
| Field | Description |
|---|---|
title |
Subscription title |
created_at |
Creation datetime |
status |
Status value |
When invoice_generation.action is book_and_send, the sending_methods array controls delivery. Multiple methods can be combined.
Valid values: email, peppol, postal_service
'invoice_generation' => [
'action' => 'book_and_send',
'sending_methods' => [
['method' => 'email'],
['method' => 'peppol'],
],
],$sub = Teamleader::subscriptions()->create([...]);
$id = $sub['data']['id'];
// Update title
Teamleader::subscriptions()->update($id, ['title' => 'Revised Retainer']);
// Stop generating invoices
Teamleader::subscriptions()->deactivate($id);$subs = Teamleader::subscriptions()->forInvoice('invoice-uuid');
$sourceSubscription = $subs['data'][0] ?? null;use InvalidArgumentException;
use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
// Missing required field
try {
Teamleader::subscriptions()->create(['title' => 'Test']);
} catch (InvalidArgumentException $e) {
// "Field 'invoicee' is required for subscription creation"
}
// Invalid billing cycle unit
try {
Teamleader::subscriptions()->create([
...,
'billing_cycle' => ['periodicity' => ['unit' => 'quarter', 'period' => 1]],
]);
} catch (InvalidArgumentException $e) {
// 'Invalid billing cycle unit. Must be one of: week, month, year'
}
// Invalid sending method
try {
Teamleader::subscriptions()->create([
...,
'invoice_generation' => [
'action' => 'book_and_send',
'sending_methods' => [['method' => 'fax']],
],
]);
} catch (InvalidArgumentException $e) {
// 'Invalid sending method. Must be one of: email, peppol, postal_service'
}- Invoices β Subscriptions auto-generate invoices
- Payment Methods β Used on subscription payments
- Payment Terms β Used on subscription invoicee configuration
- Tax Rates β Used on subscription line items
- Companies β Subscription customers
- Contacts β Subscription customers
- 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