Skip to content

Materials

MC0RE edited this page Jul 20, 2026 · 2 revisions

Materials

Manage materials in Teamleader Focus projects.

Overview

The Materials resource manages materials on new-projects (projects-v2) projects β€” line items with billing, budget, quantity, and optional product linkage.

Access via Teamleader::materials().

Endpoint prefix: projects-v2/materials.

No deletion: there is no delete endpoint for materials.

Endpoint

projects-v2/materials

Capabilities

Capability Supported
Pagination ❌ Not supported
Filtering βœ… Supported (ids only)
Sorting ❌ Not supported
Sideloading ❌ Not supported
Creation βœ… Supported
Update βœ… Supported
Deletion ❌ Not supported

Methods

list(array $filters = [], array $options = [])

Only the ids filter is supported.

use McoreServices\TeamleaderSDK\Facades\Teamleader;

$materials = Teamleader::materials()->list(['ids' => ['material-uuid-1', 'material-uuid-2']]);

info(mixed $id, mixed $includes = null)

$material = Teamleader::materials()->info('material-uuid');

create(array $data)

Returns HTTP 201 with data.{id, type}.

Required: project_id, title.

Optional: group_id, after_id, description, billing_method, quantity, quantity_estimated, unit_price, unit_cost, unit_id, fixed_price, external_budget, internal_budget, start_date, end_date, product_id, assignees.

$material = Teamleader::materials()->create([
    'project_id'         => 'project-uuid',
    'title'              => 'WD-40 Multi-Use Product',
    'billing_method'     => 'unit_price',
    'quantity_estimated' => 12,
    'unit_price'         => ['amount' => 25.50, 'currency' => 'EUR'],
]);

update(mixed $id, array $data)

Only id is required; all other fields are optional. Passing null for a nullable field clears it. Returns HTTP 204 (no body).

Teamleader::materials()->update('material-uuid', [
    'quantity' => 8,
    'status'   => 'done',
]);

Helper Methods

byIds(array $ids)

$materials = Teamleader::materials()->byIds(['uuid-1', 'uuid-2']);

Enumerated Values

billing_method

Validated on create()/update(); also the possible response values on info()/list().

Value Description
fixed_price Fixed price for the material
unit_price Priced per unit
non_billable Not billed
parent_fixed_price Billed as part of a fixed-price parent (added v1.2.8) β€” only accepted when the parent is fixed-price

status

to_do, in_progress, on_hold, done

assignee types

user, team


Error Handling

use InvalidArgumentException;

// Missing required field
try {
    Teamleader::materials()->create(['project_id' => 'uuid']); // missing title
} catch (InvalidArgumentException $e) {
    // 'title is required for creating a material'
}

// Invalid billing method
try {
    Teamleader::materials()->create([
        'project_id'     => 'uuid',
        'title'          => 'Test',
        'billing_method' => 'hourly',
    ]);
} catch (InvalidArgumentException $e) {
    // 'Invalid billing_method. Must be one of: fixed_price, unit_price, non_billable, parent_fixed_price'
}

Related Resources

  • Projects β€” Parent project
  • Groups β€” Materials can be assigned to project groups
  • Project-Lines β€” Unified listing including materials
  • Products β€” product_id links a material to the product catalogue

Clone this wiki locally