-
-
Notifications
You must be signed in to change notification settings - Fork 0
Payment Terms
Read payment term definitions in Teamleader Focus.
Payment terms define when invoices are due. They are used when creating invoices and subscriptions. The response includes a meta.default key identifying the account's default term.
Access via Teamleader::payment_terms().
SDK key uses underscores:
payment_termsβ not camelCase.
paymentTerms.listtakes no request body. The specification declares no filter, page or sort parameter. Passing arguments throws since v2.2.0; before that they were silently discarded. All helper methods are client-side β they calllist()then filter in PHP.Payment terms are written by shape, not by id. When creating an invoice or subscription you pass
['type' => ..., 'days' => ...], not a term UUID. The ids in this resource are for lookup and display, not for writing. See Using a payment term.
paymentTerms
| Capability | Supported |
|---|---|
| Pagination | β Not supported |
| Filtering | β Not supported |
| Sorting | β Not supported |
| Sideloading | β Not supported |
| Creation | β Not supported |
| Update | β Not supported |
| Deletion | β Not supported |
Returns all payment terms in a single response. Takes no arguments.
use McoreServices\TeamleaderSDK\Facades\Teamleader;
$terms = Teamleader::payment_terms()->list();
// Access the default term UUID
$defaultId = $terms['meta']['default'];Any argument throws before the request is sent:
Teamleader::payment_terms()->list([], ['page_size' => 5]);
// InvalidArgumentException: paymentTerms.list does not support pagination.
// Passed: page_size. The endpoint returns every record in a single response,
// so there are no pages to request.There is no info() endpoint β use find() to resolve a single term from the list.
All helpers call list() then filter in PHP. Each one costs its own API request.
Returns the default payment term object, or null if none is set.
$default = Teamleader::payment_terms()->getDefault();
// ['id' => 'uuid', 'type' => 'after_invoice_date', 'days' => 30]Returns the UUID of the default payment term, or null.
$defaultId = Teamleader::payment_terms()->getDefaultId();Returns all terms matching the given type, as an array. Throws InvalidArgumentException for invalid types.
Valid types: cash, end_of_month, after_invoice_date
$cashTerms = Teamleader::payment_terms()->findByType('cash');
$standardTerms = Teamleader::payment_terms()->findByType('after_invoice_date');Returns the first term matching the given number of days, optionally narrowed by type. Returns null if not found.
$term30 = Teamleader::payment_terms()->findByDays(30);
$term30 = Teamleader::payment_terms()->findByDays(30, 'after_invoice_date');Note the asymmetry:
findByType()returns an array of every match,findByDays()returns a single term or null.
Each returns an array, delegating to findByType().
$cashTerms = Teamleader::payment_terms()->cash();
$endOfMonthTerms = Teamleader::payment_terms()->endOfMonth();
$afterInvoiceTerms = Teamleader::payment_terms()->afterInvoiceDate();Returns flat [id => formatted_description] map. Uses formatPaymentTermDescription() internally, because the API returns no description field β the human-readable label is built by the SDK from type and days.
$options = Teamleader::payment_terms()->asOptions();
// ['uuid-1' => 'Cash (immediate payment)',
// 'uuid-2' => '30 days after invoice date',
// 'uuid-3' => 'End of month + 15 days']Turns a term object into a readable string. Public, so you can use it on a term you already have without a second lookup.
$label = Teamleader::payment_terms()->formatPaymentTermDescription([
'type' => 'after_invoice_date',
'days' => 30,
]);
// '30 days after invoice date'$exists = Teamleader::payment_terms()->exists('term-uuid');
$term = Teamleader::payment_terms()->find('term-uuid'); // array or null
$valid = Teamleader::payment_terms()->isValidType('cash');[
'data' => [
['id' => 'uuid-1', 'type' => 'cash'],
['id' => 'uuid-2', 'type' => 'after_invoice_date', 'days' => 30],
['id' => 'uuid-3', 'type' => 'end_of_month', 'days' => 15],
],
'meta' => ['default' => 'uuid-2'],
'headers' => ['X-RateLimit-Remaining' => ['199'], /* ... */],
]There is no
descriptionfield. Earlier versions of this page showed one; the API returns onlyid,typeanddays. UseasOptions()orformatPaymentTermDescription()to build a label.
daysis absent oncashterms β the modifier only applies toend_of_monthandafter_invoice_date.
meta.defaultis always present on this endpoint. It is unrelated to theincludes=paginationmetadata other resources return, and needs no request parameter.
Payment terms are not referenced by id when writing. Both invoices.draft and subscriptions.create take a payment_term object of {type, days}:
Teamleader::invoices()->create([
'department_id' => 'dept-uuid',
'invoicee' => ['customer' => ['type' => 'company', 'id' => 'company-uuid']],
'payment_term' => ['type' => 'after_invoice_date', 'days' => 30],
'grouped_lines' => [/* ... */],
]);To follow the account's default rather than hard-coding a term, read it and pass its shape through:
$default = Teamleader::payment_terms()->getDefault();
Teamleader::invoices()->create([
'department_id' => 'dept-uuid',
'invoicee' => ['customer' => ['type' => 'company', 'id' => 'company-uuid']],
'payment_term' => array_filter([
'type' => $default['type'],
'days' => $default['days'] ?? null,
], fn ($v) => $v !== null),
'grouped_lines' => [/* ... */],
]);days is omitted for cash terms, which is why it is filtered out when absent.
$options = Cache::remember('tl_payment_terms', 86400, fn () =>
Teamleader::payment_terms()->asOptions()
);Terms rarely change, and every helper costs a request β worth caching.
$response = Teamleader::payment_terms()->list();
$terms = collect($response['data']);
$defaultId = $response['meta']['default'] ?? null;
$default = $terms->firstWhere('id', $defaultId);
$thirtyDay = $terms->first(fn ($t) => ($t['days'] ?? null) === 30);Chaining getDefault(), findByDays(30) and cash() instead would be three separate API calls.
use InvalidArgumentException;
// Arguments the endpoint cannot honour
try {
Teamleader::payment_terms()->list([], ['page_size' => 5]);
} catch (InvalidArgumentException $e) {
// 'paymentTerms.list does not support pagination. ...'
}
// Invalid type
try {
Teamleader::payment_terms()->findByType('net_30');
} catch (InvalidArgumentException $e) {
// "Invalid payment term type 'net_30'. Must be one of: cash,
// end_of_month, after_invoice_date"
}-
Invoices β
payment_termis required on invoice creation -
Subscriptions β
payment_termis required on subscription creation - Payment Methods β How invoices are paid, not when
- Units of Measure β Another endpoint that takes no arguments and returns everything
- Day Off Types β Same shape
- Webhooks β Same shape
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