Account Manager Assignments
This page describes how to get a list of account managers that can be assigned to quotes and how to assign account managers to a quote.
List of account managers that can be assigned
To get valid account manager roles for quotes (e.g. for a dropdown when creating or assigning), use the Roles endpoint with the am_only query parameter.
Endpoint
| METHOD | Endpoint | Description | Path Parameters |
|---|---|---|---|
| GET | /api/orgs/:org_id/roles/ | List roles for the org | org_id |
:org_idyour OpenSolar Organization ID
Use the supplier’s organisation ID as org_id so that the list is restricted to roles in that supplier org. With am_only=1 (or am_only=true), the response includes only roles that are account managers or org admins. Those are the roles that can be assigned to quotes for that supplier.
curl "https://api.opensolar.com/api/orgs/123/roles/?am_only=1" \
--header "Authorization: Bearer <token>"
Array of role objects (same shape as in Roles). Only roles that are account managers or admins in that org are returned.
Assigning an account manager to a quote
Account managers on a quote are set on the quote resource.
Use the Supplier Quotes API to update the quote and send the desired account manager role URLs in account_managers.
Endpoint
| METHOD | Endpoint | Description | Path Parameters |
|---|---|---|---|
| PATCH | /api/suppliers/:org_id/quotes/:quote_id/ | Partially update a quote | org_id, quote_id |
:org_idyour OpenSolar Organization ID:quote_id- ID number of the quote
curl -X PATCH "https://api.opensolar.com/api/suppliers/123/quotes/456/" \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data '{
"account_managers": [
"https://api.opensolar.com/api/orgs/123/roles/5/"
]
}'
Returns the full updated quote object. The account_managers and account_manager_data fields reflect the new assignment.
To clear account managers from a quote, send an empty array: "account_managers": [].