materials.list
Materials recorded on a job (or one visit), with the price and cost totals of those still counted. Prices show only with see_prices, costs only with see_costs; lines with no price or cost set are counted in unpriced_count and uncosted_count.
When to use it
Record what went into a job: materials.add from the price book (pricebook_item_id; its name, unit, price, cost and taxable are copied as they are today) or typed in, optionally on one visit. Afterwards only the quantity, visit and notes change (materials.update); for anything else remove it (materials.remove keeps it in history with who and why) and add it again.
What to tell the owner
Tell them what you found in plain words. Don't read back raw fields.
| Field | Type | Required |
|---|
job_id | string (uuid) | yes |
visit_id | string (uuid) | no |
include_removed | boolean | no |
Example
GET https://doingwork.work/v1/materials?job_id=00000000-0000-4000-8000-000000000000
Output
| Field | Type | Always there |
|---|
job_id | string (uuid) | yes |
items | array | yes |
items[].material_id | string (uuid) | yes |
items[].shop_id | string (uuid) | yes |
items[].job_id | string (uuid) | yes |
items[].visit_id | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | yes |
items[].pricebook_item_id | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | yes |
items[].name | string | yes |
items[].unit | string | yes |
items[].quantity | number | yes |
items[].unit_price_minor | ['integer', 'null'] | yes |
items[].unit_cost_minor | ['integer', 'null'] | yes |
items[].price_minor | ['integer', 'null'] | yes |
items[].cost_minor | ['integer', 'null'] | yes |
items[].taxable | boolean | yes |
items[].notes | ['string', 'null'] | yes |
items[].entered_by | string (uuid) | yes |
items[].entered_by_name | ['string', 'null'] | yes |
items[].created_at | string (date-time) | yes |
items[].updated_at | string (date-time) | yes |
items[].removed_at | ['string', 'null', ' ', '(', 'd', 'a', 't', 'e', '-', 't', 'i', 'm', 'e', ')'] | yes |
items[].removed_by | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | yes |
items[].remove_reason | ['string', 'null'] | yes |
price_total_minor | ['integer', 'null'] | yes |
cost_total_minor | ['integer', 'null'] | yes |
unpriced_count | integer | yes |
uncosted_count | integer | yes |
{
"job_id": "00000000-0000-4000-8000-000000000000",
"items": [
{
"material_id": "00000000-0000-4000-8000-000000000000",
"shop_id": "00000000-0000-4000-8000-000000000000",
"job_id": "00000000-0000-4000-8000-000000000000",
"visit_id": "00000000-0000-4000-8000-000000000000",
"pricebook_item_id": "00000000-0000-4000-8000-000000000000",
"name": "Ruiz Plumbing",
"unit": "...",
"quantity": "...",
"unit_price_minor": "...",
"unit_cost_minor": "...",
"price_minor": "...",
"cost_minor": "...",
"taxable": true,
"notes": "...",
"entered_by": "00000000-0000-4000-8000-000000000000",
"entered_by_name": "...",
"created_at": "...",
"updated_at": "...",
"removed_at": "...",
"removed_by": "00000000-0000-4000-8000-000000000000",
"remove_reason": "..."
}
],
"price_total_minor": "...",
"cost_total_minor": "...",
"unpriced_count": 1,
"uncosted_count": 1
}
Errors
| Code | Status | What to do |
|---|
invalid_input, invalid_token, rate_limited | | Can happen on any call. See errors. |