solarOS Organization API

Organization API

Create a Material Request

Creates a Material Request for a project-contained Work Order (workOrderId) or for a Project (projectId), with optional line items and order details. Like a request made in solarOS, it gets a Record Number and a step on the Project so it shows in the Project's materials. A status other than PENDING moves that step as it would in solarOS. pickupLocationId must be from GET /pickup-locations, and a line's productId must be a Product in this organization's catalog. estimatedCost is computed from the line items. Requires Idempotency-Key and material_reqs:write.

/api/v1/material-reqs

Creates a Material Request for a project-contained Work Order (workOrderId) or for a Project (projectId), with optional line items and order details. Like a request made in solarOS, it gets a Record Number and a step on the Project so it shows in the Project's materials. A status other than PENDING moves that step as it would in solarOS. pickupLocationId must be from GET /pickup-locations, and a line's productId must be a Product in this organization's catalog. estimatedCost is computed from the line items. Requires Idempotency-Key and material_reqs:write.

Create a Material Request. Use an organization API key with material_reqs:write. Check the response envelope and meta.requestId before triggering dependent workflow steps.

Required scopes

material_reqs:writeIdempotency-Key required

Parameters

No path or query parameters.

Request body

objectrequired
FieldTypeDescription
workOrderIdstringA project-contained Work Order. The request also shows on its Project.
projectIdstringThe Project, for a request that isn't for one Work Order. With workOrderId it must be the Work Order's Project.
statusPENDING | ORDERED | PARTIALLY_RECEIVED | RECEIVED | READY_FOR_PICKUP | PICKED_UP | CANCELLEDA change moves the request's project step as it would in solarOS. PICKED_UP stamps pickedUpAt and marks pending and ordered line items picked up.
neededByDatestring | nullA day: YYYY-MM-DD, saved as midnight UTC the way solarOS's date pickers save it, or an ISO 8601 date-time.
vendorNamestring | nullOptional unless marked required.
vendorOrderRefstring | nullThe vendor's order or PO number.
orderedDatestring | nullA day: YYYY-MM-DD, saved as midnight UTC the way solarOS's date pickers save it, or an ISO 8601 date-time.
expectedDatestring | nullA day: YYYY-MM-DD, saved as midnight UTC the way solarOS's date pickers save it, or an ISO 8601 date-time.
receivedDatestring | nullA day: YYYY-MM-DD, saved as midnight UTC the way solarOS's date pickers save it, or an ISO 8601 date-time.
actualCostnumber | nullOptional unless marked required.
pickupLocationIdstring | nullAn id from GET /pickup-locations.
notesstring | nullOptional unless marked required.
lineItems[]array<object>Optional unless marked required.
lineItems[].namerequiredstringOptional unless marked required.
lineItems[].quantityrequiredintegerOptional unless marked required.
lineItems[].unitstringDefaults to each.
lineItems[].productIdstring | nullA Product in this organization's catalog.
lineItems[].descriptionstring | nullOptional unless marked required.
lineItems[].unitCostnumber | nullOptional unless marked required.
creatematerialreqRequest
{
  "workOrderId": "work_order_123",
  "status": "ORDERED",
  "vendorName": "CED Greentech",
  "vendorOrderRef": "SO-88123",
  "orderedDate": "2026-10-29",
  "neededByDate": "2026-11-04",
  "pickupLocationId": "location_123",
  "lineItems": [
    {
      "name": "Powerwall 3",
      "quantity": 1,
      "unitCost": 9850
    }
  ]
}

Responses

201

Created Material Request envelope

#/components/schemas/MaterialRequestEnvelope

400

Validation error: neither workOrderId nor projectId, a projectId that is not the Work Order's Project, a pickup Location that is archived or not open for pickup, or a missing Idempotency-Key

#/components/schemas/OrgApiError

401

Missing or invalid organization API key

#/components/schemas/OrgApiError

402

Organization billing access or an endpoint-specific business quota denied the request

#/components/schemas/OrgApiError

403

Missing required scope: material_reqs:write

#/components/schemas/OrgApiError

404

Work Order, Project, pickup Location, or Product not found

#/components/schemas/OrgApiError

409

Idempotency conflict

#/components/schemas/OrgApiError

429

Rate limit exceeded

#/components/schemas/OrgApiError

Errors

400 Validation error: neither workOrderId nor projectId, a projectId that is not the Work Order's Project, a pickup Location that is archived or not open for pickup, or a missing Idempotency-Key401 Missing or invalid organization API key402 Organization billing access or an endpoint-specific business quota denied the request403 Missing required scope: material_reqs:write404 Work Order, Project, pickup Location, or Product not found409 Idempotency conflict429 Rate limit exceeded

Static examples

curl -X POST "$SOLAROS_BASE_URL/api/v1/material-reqs" \
  -H "Authorization: Bearer $SOLAROS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $SOLAROS_IDEMPOTENCY_KEY" \
  --data '{"workOrderId":"work_order_123","status":"ORDERED","vendorName":"CED Greentech","vendorOrderRef":"SO-88123","orderedDate":"2026-10-29","neededByDate":"2026-11-04","pickupLocationId":"location_123","lineItems":[{"name":"Powerwall 3","quantity":1,"unitCost":9850}]}'