{"openapi":"3.1.0","info":{"title":"Fergus API","description":"### Overview\nWelcome to the **Fergus API** documentation.\n\nThis API provides endpoints for managing favourites, quotes, jobs, and more.\n\nSome endpoints support text search query parameters, like `filterSearchText` and `filterSectionName`, for free-text filtering. Unless specified otherwise, they support substring matching, i.e. they match when the search term appears anywhere within searchable fields.\n\nCheck each endpoints' parameters to see if text search is supported and which fields are searchable.\n\n#### Rate Limit\nThis API enforces a rate limit of:\n\n- 100 requests per minute per company\n\nRate limits are applied regardless of which authentication token is used, and the count is shared across all endpoints within the API.\n\nIf the limit is exceeded, further requests may be temporarily rejected with a 429 Too Many Requests response.\n\nEach response includes the following headers to help clients track and manage their usage:\n\n| Header                  | Description |\n|-------------------------|-------------|\n| x-ratelimit-limit     | The maximum number of requests allowed in the current time window (e.g. `100`) |\n| x-ratelimit-remaining | The number of requests remaining in the current time window |\n| x-ratelimit-reset     | The number of seconds until the current rate limit window resets |\n| retry-after           | (Only present in `429` responses) The number of seconds the client must wait before retrying |\n\n### Terms of Service\n\nBy using the Fergus API you agree to our [API Terms of Service](/docs/terms.pdf). Please review the document before getting started.\n ","version":"v1","contact":{"name":"Fergus Developer Platform","url":"https://info.fergus.com/developers","email":"integrations@fergus.com"}},"components":{"securitySchemes":{"PersonalAccessToken":{"type":"http","scheme":"bearer"},"oauth2":{"type":"oauth2","description":"OAuth2 Authorization Code Flow - the authorization server uses these credentials, along with the user's consent, to issue an authorization code and eventually an access token. <br> A registration process with the authorization server assigns the application a unique client_id and client_secret. <br> - **client_id**: this identifies the application. <br>- **client_secret**: verifies authenticity in the authorization server.","flows":{"authorizationCode":{"authorizationUrl":"https://auth.fergus.com/oauth2/authorize","scopes":{},"tokenUrl":"https://auth.fergus.com/oauth2/token","refreshUrl":"https://auth.fergus.com/oauth2/token"}}}},"schemas":{"Links":{"type":"object","required":["href","rel","type"],"properties":{"href":{"type":"string"},"rel":{"type":"string"},"type":{"enum":["GET","POST","PUT","PATCH"],"type":"string"}}},"Pagination":{"type":"object","required":["perPage","pageCount","links"],"properties":{"perPage":{"type":"number"},"pageCount":{"type":"number"},"links":{"type":"object","required":["self","previous","next"],"properties":{"self":{"type":"string"},"previous":{"anyOf":[{"type":"string"},{"type":"null"}]},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"ErrorResponse":{"type":"object","required":["error","message","statusCode"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"number"}}},"RedirectResponse":{"type":"object","required":["result","message","location"],"properties":{"result":{"type":"string"},"message":{"type":"string"},"location":{"type":"string"}}},"FavouritesSectionPath":{"type":"array","items":{"type":"object","required":["id","name","position","href"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"position":{"type":"number"},"href":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"FavouritesFolder":{"type":"object","required":["id","name","parentId","createdAt","children","sortOrder","sections"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"parentId":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string"},"children":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FavouritesFolder"}},{"type":"null"}]},"sortOrder":{"type":"number"},"sections":{"anyOf":[{"type":"array","items":{"type":"object","required":["id","name","description","createdAt","links"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"links":{"$ref":"#/components/schemas/Links"}}}},{"type":"null"}]}}},"FavouritesResponseData":{"anyOf":[{"type":"object","required":["id","name","parentId","createdAt","children","sortOrder","sections"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"parentId":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string"},"children":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FavouritesFolder"}},{"type":"null"}]},"sortOrder":{"type":"number"},"sections":{"anyOf":[{"type":"array","items":{"type":"object","required":["id","name","description","createdAt","links"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"links":{"$ref":"#/components/schemas/Links"}}}},{"type":"null"}]}}},{"type":"object","required":["id","name","description","folderId","createdAt","fixturePrice","totalItemCost","totalItemPrice","path"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"folderId":{"type":"number"},"createdAt":{"type":"string"},"fixturePrice":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalItemCost":{"type":"number"},"totalItemPrice":{"type":"number"},"path":{"$ref":"#/components/schemas/FavouritesSectionPath"}}}]},"FavouritesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/FavouritesResponseData"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"FavouritesQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"filterSectionName":{"description":"Searchable fields:\n- representation: tree\n  - `section.name`\n- representation: flat\n  - `section.name`","type":"string"},"sortField":{"default":"sortOrder","enum":["name","createdAt","sortOrder"],"errorMessage":"The sortField must be either `name`, `sortOrder` or `createdAt`, defaults to `sortOrder`","anyOf":[{"type":"string","enum":["name"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["sortOrder"]}]},"representation":{"default":"flat","enum":["flat","tree"],"errorMessage":"The representation must be either `flat` or `tree`, defaults to `flat`","anyOf":[{"type":"string","enum":["flat"]},{"type":"string","enum":["tree"]}]}}},{"type":"object","properties":{"filterSearchText":{"description":"Searchable fields:\n- representation: tree\n  - `section.name`\n  - `lineItem.itemName`,\n- representation: flat\n  - `section.name`\n  - `section.description`,\n  - `lineItem.itemName`","type":"string"}}}]},"FavouritesSection":{"type":"object","required":["id","name","description","createdAt","folderId","path","lineItems"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"folderId":{"type":"number"},"path":{"$ref":"#/components/schemas/FavouritesSectionPath"},"lineItems":{"type":"array","items":{"type":"object","required":["id","itemName","itemQuantity","itemCost","sortOrder","salesAccountId","priceBookLineItemId"],"properties":{"id":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"type":"number"},"itemCost":{"type":"number"},"sortOrder":{"type":"number"},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}},"Job":{"type":"object","required":["id","jobNo","jobNumber","description","longDescription","createdAt","lastModified","jobType","status","assignedGroups","customer","siteAddress","mainContact","activeQuote","onHold","archived","customerReference","parentJobId","jobVariants","links"],"properties":{"id":{"type":"number"},"jobNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"longDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"lastModified":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"jobType":{"type":"string"},"status":{"type":"string"},"assignedGroups":{"description":"Default group assigned to a job for easy tracking. This gets assigned automatically by default on new job phases.","type":"array","items":{"type":"string"}},"customer":{"anyOf":[{"$ref":"#/components/schemas/JobCustomer"},{"type":"null"}]},"siteAddress":{"anyOf":[{"$ref":"#/components/schemas/JobSiteAddress"},{"type":"null"}]},"mainContact":{"anyOf":[{"type":"object","required":["id","firstName","lastName","contactItems"],"properties":{"id":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactItems":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ContactItem"}},{"type":"null"}]}}},{"type":"null"}]},"activeQuote":{"anyOf":[{"type":"object","allOf":[{"type":"object","required":["id","versionNumber","guid","title","description","quoteDate","isSent","isAccepted","isSuperseded","isLocked","voidedAt","declinedAt","createdAt","lastModified","publishedAt","dueDate","dueDays"],"properties":{"id":{"type":"number"},"versionNumber":{"type":"number"},"guid":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"quoteDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"isSent":{"type":"boolean"},"isAccepted":{"type":"boolean"},"isSuperseded":{"type":"boolean"},"isLocked":{"type":"boolean"},"voidedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"declinedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"lastModified":{"format":"date-time","type":"string"},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDays":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["isDraft"],"properties":{"isDraft":{"type":"boolean"},"total":{"anyOf":[{"type":"number"},{"type":"null"}]}}}]},{"type":"null"}]},"onHold":{"type":"boolean"},"archived":{"type":"boolean"},"customerReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentJobId":{"anyOf":[{"description":"The id of the parent job when this job is a variant, otherwise null.","type":"number"},{"type":"null"}]},"jobVariants":{"anyOf":[{"description":"The ids of the variant (child) jobs when this job is a parent job, otherwise null.","type":"array","items":{"type":"number"}},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"JobCustomer":{"type":"object","required":["id","customerFullName"],"properties":{"id":{"type":"number"},"customerFullName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"JobSiteAddress":{"type":"object","required":["id","name","firstName","lastName","address1","address2","addressSuburb","addressCity","addressRegion","addressCountry","addressPostcode"],"properties":{"id":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"JobsQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"filterJobNo":{"type":"string"},"filterJobStatus":{"enum":["Active","Completed","Estimate Rejected","Estimate Sent","Inactive","Quote Sent","Quote Rejected","To Price"],"errorMessage":"The filterJobType must be one of Active, Completed, Estimate Rejected, Estimate Sent, Inactive, Quote Sent, Quote Rejected, To Price","anyOf":[{"type":"string","enum":["Active"]},{"type":"string","enum":["Completed"]},{"type":"string","enum":["Estimate Rejected"]},{"type":"string","enum":["Estimate Sent"]},{"type":"string","enum":["Inactive"]},{"type":"string","enum":["Quote Sent"]},{"type":"string","enum":["Quote Rejected"]},{"type":"string","enum":["To Price"]}]},"filterJobType":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The filterJobType must be one of `Quote`, `Estimate`, or `Charge Up`","anyOf":[{"type":"string","enum":["Quote"]},{"type":"string","enum":["Estimate"]},{"type":"string","enum":["Charge Up"]}]},"filterCustomerId":{"type":"number"},"filterSiteId":{"type":"number"},"sortField":{"default":"createdAt","enum":["jobNo","createdAt","lastModified"],"errorMessage":"The sortField must be either `jobNo` or `createdAt`, defaults to `jobNo`","anyOf":[{"type":"string","enum":["jobNo"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["lastModified"]}]},"filterShowOnHold":{"errorMessage":"The filterShowOnHold must be a boolean","type":"boolean"},"filterShowArchived":{"errorMessage":"The filterShowArchived must be a boolean","type":"boolean"}}},{"type":"object","properties":{"filterSearchText":{"description":"Searchable fields:\n- `description`\n- `longDescription`\n- `jobNo`\n- `customer.customerFullName`\n- `siteAddress.name`\n- `siteAddress.firstName`\n- `siteAddress.lastName`\n- `mainContact.firstName`\n- `mainContact.lastName`","type":"string"}}}]},"JobsResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"JobResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Job"}}},"JobParameter":{"type":"object","required":["jobId"],"properties":{"jobId":{"type":"number"}}},"JobPhaseParameter":{"type":"object","required":["jobId","jobPhaseId"],"properties":{"jobId":{"type":"number"},"jobPhaseId":{"type":"number"}}},"CreateNonDraftJob":{"errorMessage":"For non-Draft jobs, title, description, customerId, and siteId are required","type":"object","required":["jobType","title","description","customerId","siteId"],"properties":{"jobType":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The jobType must be one of `Quote`, `Estimate`, or `Charge Up`","type":"string"},"title":{"type":"string"},"description":{"type":"string"},"customerId":{"type":"number"},"customerReference":{"type":"string"},"siteId":{"type":"number"}}},"CreateDraftJob":{"errorMessage":"For draft jobs 'jobType' and 'title' are required","type":"object","required":["jobType","isDraft","title"],"properties":{"jobType":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The jobType must be one of `Quote`, `Estimate`, or `Charge Up`","type":"string"},"isDraft":{"type":"boolean","enum":[true]},"title":{"type":"string"},"description":{"type":"string"},"customerId":{"type":"number"},"customerReference":{"type":"string"},"siteId":{"type":"number"}}},"CreateJobVariation":{"errorMessage":"For job variations, 'parentJobId' and 'jobType' are required; 'title', 'description' and 'customerReference' are optional","type":"object","required":["parentJobId","jobType"],"properties":{"parentJobId":{"errorMessage":"The parentJobId must be a number","type":"number"},"jobType":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The jobType must be one of `Quote`, `Estimate`, or `Charge Up`","type":"string"},"title":{"type":"string"},"description":{"type":"string"},"customerReference":{"type":"string"}}},"HoldJobPayload":{"type":"object","required":["holdUntil","notes"],"properties":{"holdUntil":{"format":"date","errorMessage":"The holdUntil must be a valid date in 'YYYY-MM-DD' format","type":"string","example":"2021-01-01"},"notes":{"type":"string"}}},"QuoteJobFinancialSummary":{"type":"object","required":["quotedHours","quotedAmount","labour","materials","quoteStatus"],"properties":{"quotedHours":{"type":"number"},"quotedAmount":{"type":"number"},"labour":{"type":"number"},"materials":{"type":"number"},"quoteStatus":{"type":"string"}}},"JobFinancialSummaryResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/JobFinancialSummary"}}},"ChargeUpJobFinancialSummary":{"type":"object","required":["jobId","jobNo","lastUpdated","currency","costsIncurred","chargeableAmount","totalBilled","labourHours"],"properties":{"jobId":{"type":"number"},"jobNo":{"type":"string"},"lastUpdated":{"format":"date-time","type":"string"},"currency":{"type":"string"},"costsIncurred":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"chargeableAmount":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"totalBilled":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"labourHours":{"type":"object","required":["billable","unbillable","total"],"properties":{"billable":{"type":"number"},"unbillable":{"type":"number"},"total":{"type":"number"}}}}},"JobFinancialSummary":{"anyOf":[{"type":"object","required":["jobType","jobId","jobNo","lastUpdated","currency","costsIncurred","chargeableAmount","totalBilled","labourHours","quoteSummary","links"],"properties":{"jobType":{"anyOf":[{"type":"string","enum":["Quote"]},{"type":"string","enum":["Estimate"]}]},"jobId":{"type":"number"},"jobNo":{"type":"string"},"lastUpdated":{"format":"date-time","type":"string"},"currency":{"type":"string"},"costsIncurred":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"chargeableAmount":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"totalBilled":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"labourHours":{"type":"object","required":["billable","unbillable","total"],"properties":{"billable":{"type":"number"},"unbillable":{"type":"number"},"total":{"type":"number"}}},"quoteSummary":{"type":"object","required":["quotedHours","quotedAmount","labour","materials","quoteStatus"],"properties":{"quotedHours":{"type":"number"},"quotedAmount":{"type":"number"},"labour":{"type":"number"},"materials":{"type":"number"},"quoteStatus":{"type":"string"}}},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},{"type":"object","required":["jobType","jobId","jobNo","lastUpdated","currency","costsIncurred","chargeableAmount","totalBilled","labourHours","links"],"properties":{"jobType":{"type":"string","enum":["Charge Up"]},"jobId":{"type":"number"},"jobNo":{"type":"string"},"lastUpdated":{"format":"date-time","type":"string"},"currency":{"type":"string"},"costsIncurred":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"chargeableAmount":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"totalBilled":{"type":"object","required":["labour","materials","total"],"properties":{"labour":{"type":"number"},"materials":{"type":"number"},"total":{"type":"number"}}},"labourHours":{"type":"object","required":["billable","unbillable","total"],"properties":{"billable":{"type":"number"},"unbillable":{"type":"number"},"total":{"type":"number"}}},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}}]},"JobPhase":{"type":"object","required":["id","jobId","description","createdAt","title","status","assignedGroups","links"],"properties":{"id":{"type":"number"},"jobId":{"type":"number"},"description":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"title":{"type":"string"},"status":{"type":"string"},"assignedGroups":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"JobPhasesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/JobPhase"}}}},"JobPhaseResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/JobPhase"}}},"CreateJobPhase":{"type":"object","required":["title","description"],"properties":{"title":{"type":"string"},"description":{"type":"string"}}},"QuoteTotal":{"type":"object","required":["subTotal","discount","discountedSubTotal","gst","total"],"properties":{"subTotal":{"type":"number"},"discount":{"type":"number"},"discountedSubTotal":{"type":"number"},"gst":{"type":"number"},"total":{"type":"number"}}},"QuoteConfig":{"type":"object","required":["showDocumentTotals","showLineItemPrices","showLineItemTotals","showLineItemQuantities","showSectionTotals","showLabourPrices","showMaterialPrices","showLabourSummary","showMaterialSummary","showAllLineItems","mainColour","accentColour","fontColour","orientation","fontSizeOverride","indentCustomerAddress"],"properties":{"showDocumentTotals":{"type":"boolean"},"showLineItemPrices":{"type":"boolean"},"showLineItemTotals":{"type":"boolean"},"showLineItemQuantities":{"type":"boolean"},"showSectionTotals":{"type":"boolean"},"showLabourPrices":{"type":"boolean"},"showMaterialPrices":{"type":"boolean"},"showLabourSummary":{"type":"boolean"},"showMaterialSummary":{"type":"boolean"},"showAllLineItems":{"type":"boolean"},"mainColour":{"anyOf":[{"type":"string"},{"type":"null"}]},"accentColour":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontColour":{"anyOf":[{"type":"string"},{"type":"null"}]},"orientation":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontSizeOverride":{"anyOf":[{"type":"string"},{"type":"null"}]},"indentCustomerAddress":{"type":"boolean"}}},"SectionConfig":{"type":"object","required":["showAllLineItems","showPrices","showTotals","showSummary","showQuantities"],"properties":{"showAllLineItems":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showPrices":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showTotals":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showSummary":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showQuantities":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"QuoteSection":{"type":"object","required":["sectionId","name","sortOrder","parentSectionId","description","selectionMode"],"properties":{"sectionId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"parentSectionId":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectionMode":{"enum":["Fixed","Optional","Multiple Choice"],"anyOf":[{"type":"string","enum":["Fixed"]},{"type":"string","enum":["Optional"]},{"type":"string","enum":["Multiple Choice"]}]},"sectionConfig":{"type":"object","required":["showAllLineItems","showPrices","showTotals","showSummary","showQuantities"],"properties":{"showAllLineItems":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showPrices":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showTotals":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showSummary":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showQuantities":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"lineItems":{"type":"array","items":{"type":"object","required":["quoteLineItemId","priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","itemRrp","itemCost","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","combinedItemName"],"properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemRrp":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemCost":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"combinedItemName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/QuoteSection"}}}},"Quote":{"type":"object","required":["id","versionNumber","jobId","guid","title","description","quoteDate","isSent","isAccepted","isSuperseded","isLocked","isDraft","createdAt","lastModified","publishedAt","dueDate","declinedAt","voidedAt","acceptedAt","dueDays","acceptedBy","attn","receiverPostalAddress","receiverFullName"],"properties":{"id":{"type":"number"},"versionNumber":{"type":"number"},"jobId":{"type":"number"},"guid":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"quoteDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"isSent":{"type":"boolean"},"isAccepted":{"type":"boolean"},"isSuperseded":{"type":"boolean"},"isLocked":{"type":"boolean"},"isDraft":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastModified":{"format":"date-time","type":"string"},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"declinedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"voidedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"acceptedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDays":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"attn":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPostalAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobNo":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totals":{"anyOf":[{"$ref":"#/components/schemas/QuoteTotal"},{"type":"null"}]},"quoteConfig":{"$ref":"#/components/schemas/QuoteConfig"},"sections":{"type":"array","items":{"type":"object","required":["sectionId","name","sortOrder","parentSectionId","description","selectionMode"],"properties":{"sectionId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"parentSectionId":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectionMode":{"enum":["Fixed","Optional","Multiple Choice"],"anyOf":[{"type":"string","enum":["Fixed"]},{"type":"string","enum":["Optional"]},{"type":"string","enum":["Multiple Choice"]}]},"sectionConfig":{"type":"object","required":["showAllLineItems","showPrices","showTotals","showSummary","showQuantities"],"properties":{"showAllLineItems":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showPrices":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showTotals":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showSummary":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showQuantities":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"lineItems":{"type":"array","items":{"type":"object","required":["quoteLineItemId","priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","itemRrp","itemCost","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","combinedItemName"],"properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemRrp":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemCost":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"combinedItemName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/QuoteSection"}}}}},"deposit":{"type":"object","required":["optionType","optionValue","isPaid","invoiceGuid","invoiceUrl"],"properties":{"optionType":{"anyOf":[{"anyOf":[{"type":"string","enum":["PERCENT"]},{"type":"string","enum":["FIXED"]}]},{"type":"null"}]},"optionValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"isPaid":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"invoiceGuid":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"links":{"type":"array","items":{"type":"object","required":["href","rel","type"],"properties":{"href":{"type":"string"},"rel":{"type":"string"},"type":{"enum":["GET","POST","PUT","PATCH"],"type":"string"}}}}}},"QuoteDeposit":{"type":"object","required":["optionType","optionValue","isPaid","invoiceGuid","invoiceUrl"],"properties":{"optionType":{"anyOf":[{"anyOf":[{"type":"string","enum":["PERCENT"]},{"type":"string","enum":["FIXED"]}]},{"type":"null"}]},"optionValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"isPaid":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"invoiceGuid":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"GetQuotesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Quote"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"GetQuoteByIdQuoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Quote"}}},"GetStandaloneQuotesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Quote"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"AddQuotePayload":{"type":"object","required":["title","dueDays","sections"],"properties":{"title":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The title must be at least 1 character long","pattern":"The title must not be empty"},"type":"string"},"description":{"type":"string"},"dueDays":{"minimum":7,"maximum":180,"type":"number"},"versionNumber":{"default":null,"type":"number"},"sections":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}}}}},"UpsertQuoteSection":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}},"AddQuoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Quote"}}},"UpdateQuotePayload":{"type":"object","required":["sections"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"sections":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}}}}},"UpdateQuoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"object","allOf":[{"type":"object","required":["id","versionNumber","jobId","guid","title","description","quoteDate","isSent","isAccepted","isSuperseded","isLocked","isDraft","createdAt","lastModified","publishedAt","dueDate","declinedAt","voidedAt","acceptedAt","dueDays","acceptedBy","attn","receiverPostalAddress","receiverFullName"],"properties":{"id":{"type":"number"},"versionNumber":{"type":"number"},"jobId":{"type":"number"},"guid":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"quoteDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"isSent":{"type":"boolean"},"isAccepted":{"type":"boolean"},"isSuperseded":{"type":"boolean"},"isLocked":{"type":"boolean"},"isDraft":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastModified":{"format":"date-time","type":"string"},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"declinedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"voidedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"acceptedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDays":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"attn":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPostalAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobNo":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totals":{"anyOf":[{"$ref":"#/components/schemas/QuoteTotal"},{"type":"null"}]},"quoteConfig":{"$ref":"#/components/schemas/QuoteConfig"},"sections":{"type":"array","items":{"type":"object","required":["sectionId","name","sortOrder","parentSectionId","description","selectionMode"],"properties":{"sectionId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"parentSectionId":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectionMode":{"enum":["Fixed","Optional","Multiple Choice"],"anyOf":[{"type":"string","enum":["Fixed"]},{"type":"string","enum":["Optional"]},{"type":"string","enum":["Multiple Choice"]}]},"sectionConfig":{"type":"object","required":["showAllLineItems","showPrices","showTotals","showSummary","showQuantities"],"properties":{"showAllLineItems":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showPrices":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showTotals":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showSummary":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"showQuantities":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"lineItems":{"type":"array","items":{"type":"object","required":["quoteLineItemId","priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","itemRrp","itemCost","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","combinedItemName"],"properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemRrp":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemCost":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"combinedItemName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/QuoteSection"}}}}},"deposit":{"type":"object","required":["optionType","optionValue","isPaid","invoiceGuid","invoiceUrl"],"properties":{"optionType":{"anyOf":[{"anyOf":[{"type":"string","enum":["PERCENT"]},{"type":"string","enum":["FIXED"]}]},{"type":"null"}]},"optionValue":{"anyOf":[{"type":"number"},{"type":"null"}]},"isPaid":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"invoiceGuid":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"links":{"type":"array","items":{"type":"object","required":["href","rel","type"],"properties":{"href":{"type":"string"},"rel":{"type":"string"},"type":{"enum":["GET","POST","PUT","PATCH"],"type":"string"}}}}}},{"type":"object","properties":{"lineItems":{"type":"array","items":{"type":"object","required":["quoteLineItemId","priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","itemRrp","itemCost","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","combinedItemName"],"properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemRrp":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"itemCost":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"combinedItemName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}]}}},"QuoteParameters":{"type":"object","required":["quoteId"],"properties":{"quoteId":{"minimum":1,"type":"number"}}},"StandaloneQuotesSpecificQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"filterStatus":{"enum":["draft","accepted","voided","superseded","declined","published","emailSent","emailNotSent"],"errorMessage":"The filterStatus must be either 'draft', 'accepted', 'voided', 'superseded', 'declined', 'published', 'emailSent', or 'emailNotSent'","anyOf":[{"type":"string","enum":["draft"]},{"type":"string","enum":["accepted"]},{"type":"string","enum":["voided"]},{"type":"string","enum":["superseded"]},{"type":"string","enum":["declined"]},{"type":"string","enum":["published"]},{"type":"string","enum":["emailSent"]},{"type":"string","enum":["emailNotSent"]}]},"sortField":{"default":"createdAt","enum":["id","createdAt","lastModified"],"errorMessage":"The sortField must be either 'id', 'createdAt', or 'lastModified', defaults to 'createdAt'","anyOf":[{"type":"string","enum":["id"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["lastModified"]}]}}},{"if":{"type":"object","required":["createdAfter"],"properties":{"createdAfter":{"type":"string"}}},"then":{"errorMessage":"createdAfter and modifiedAfter cannot be used together","type":"object","properties":{"modifiedAfter":{"type":"null"}}},"type":"object","properties":{"createdAfter":{"format":"date-time","description":"Get quote created after certain time. Overrides sortField and sortOrder","errorMessage":"createdAfter must be a valid ISO 8601 date-time","type":"string"},"modifiedAfter":{"format":"date-time","description":"Get quote modified after certain time. Overrides sortField and sortOrder","errorMessage":"modifiedAfter must be a valid ISO 8601 date-time","type":"string"}}}]},"QuoteTotals":{"type":"object","required":["sectionTotals","quoteTotal"],"properties":{"sectionTotals":{"type":"array","items":{"type":"object","required":["sectionId","subTotal","discount","discountedSubTotal","gst","total"],"properties":{"sectionId":{"type":"integer"},"subTotal":{"type":"number"},"discount":{"type":"number"},"discountedSubTotal":{"type":"number"},"gst":{"type":"number"},"total":{"type":"number"}}}},"quoteTotal":{"$ref":"#/components/schemas/QuoteTotal"}}},"QuoteTotalsResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/QuoteTotals"}}},"AcceptQuoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/AcceptQuoteData"}}},"AcceptQuoteData":{"type":"object","required":["id","versionNumber","jobId","guid"],"properties":{"depositPaymentUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"number"},"versionNumber":{"type":"number"},"jobId":{"type":"number"},"guid":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"PersonContact":{"type":"object","required":["id","firstName","lastName","position","company","contactItems"],"properties":{"id":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactItems":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ContactItem"}},{"type":"null"}]}}},"AddressContact":{"type":"object","required":["id","address1","address2","addressSuburb","addressCity","addressRegion","addressPostcode","addressCountry"],"properties":{"id":{"type":"number"},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"PersonPayload":{"type":"object","required":["firstName"],"properties":{"firstName":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The firstName must be at least 1 character long","pattern":"The firstName must not be empty"},"type":"string"},"lastName":{"pattern":"\\S","errorMessage":{"pattern":"The lastName must not be empty"},"type":"string"},"position":{"type":"string"},"company":{"type":"string"},"contactItems":{"type":"array","items":{"$ref":"#/components/schemas/ContactItemPayload"}}}},"AddressPayload":{"type":"object","required":["address1"],"properties":{"address1":{"pattern":"\\S","errorMessage":{"pattern":"The address1 must not be empty"},"type":"string"},"address2":{"pattern":"\\S","errorMessage":{"pattern":"The address2 must not be empty"},"type":"string"},"addressSuburb":{"pattern":"\\S","errorMessage":{"pattern":"The addressSuburb must not be empty"},"type":"string"},"addressCity":{"pattern":"\\S","errorMessage":{"pattern":"The addressCity must not be empty"},"type":"string"},"addressRegion":{"pattern":"\\S","errorMessage":{"pattern":"The addressRegion must not be empty"},"type":"string"},"addressPostcode":{"pattern":"\\S","errorMessage":{"pattern":"The addressPostcode must not be empty"},"type":"string"},"addressCountry":{"pattern":"\\S","errorMessage":{"pattern":"The addressCountry must not be empty"},"type":"string"}}},"ContactItem":{"type":"object","required":["id","contactType","contactValue"],"properties":{"id":{"type":"number"},"contactType":{"description":"The type of this contact item. It can be one of the following: email, phone, mobile, other, fax, website","enum":["email","phone","mobile","other","fax","website"],"type":"string"},"contactValue":{"description":"The value of this contact item.","type":"string"}}},"ContactItemPayload":{"contactItemEmailValidation":true,"type":"object","required":["contactType","contactValue"],"properties":{"id":{"type":"number"},"contactType":{"description":"The type of this contact item. It can be one of the following: email, phone, mobile, other, fax, website","enum":["email","phone","mobile","other","fax","website"],"errorMessage":{"enum":"The contactType must be one of the following: email, phone, mobile, other, fax, website"},"type":"string"},"contactValue":{"description":"The value of this contact item.","pattern":"\\S","errorMessage":{"pattern":"The contactValue must not be empty"},"type":"string"}}},"Customer":{"type":"object","required":["id","companyId","customerFullName","createdAt","mainContact","physicalAddress","postalAddress","billingContact","pricingTier","customerSource","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"customerFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"mainContact":{"anyOf":[{"$ref":"#/components/schemas/PersonContact"},{"type":"null"}]},"physicalAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressContact"},{"type":"null"}]},"postalAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressContact"},{"type":"null"}]},"billingContact":{"anyOf":[{"$ref":"#/components/schemas/PersonContact"},{"type":"null"}]},"pricingTier":{"anyOf":[{"$ref":"#/components/schemas/PricingTier"},{"type":"null"}]},"customerSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"GetCustomersResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"GetCustomerByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Customer"}}},"Site":{"type":"object","required":["id","companyId","name","createdAt","defaultContact","billingContact","physicalAddress","postalAddress","isArchived","deletedAt","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"defaultContact":{"$ref":"#/components/schemas/PersonContact"},"billingContact":{"anyOf":[{"$ref":"#/components/schemas/PersonContact"},{"type":"null"}]},"physicalAddress":{"$ref":"#/components/schemas/AddressContact"},"postalAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressContact"},{"type":"null"}]},"isArchived":{"type":"boolean"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"SitesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"SiteByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Site"}}},"Enquiry":{"type":"object","required":["id","name","contactName","address1","address2","addressSuburb","addressRegion","addressPostcode","addressCity","addressCountry","description","createdAt","source","status","links"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"contactName":{"type":"string"},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"CreateEnquiryPayload":{"type":"object","allOf":[{"type":"object","required":["name","email","phoneNumber","description","source"],"properties":{"name":{"type":"string"},"email":{"format":"email","type":"string"},"phoneNumber":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"}}},{"type":"object","required":["address1"],"properties":{"address1":{"pattern":"\\S","errorMessage":{"pattern":"The address1 must not be empty"},"type":"string"},"address2":{"pattern":"\\S","errorMessage":{"pattern":"The address2 must not be empty"},"type":"string"},"addressSuburb":{"pattern":"\\S","errorMessage":{"pattern":"The addressSuburb must not be empty"},"type":"string"},"addressCity":{"pattern":"\\S","errorMessage":{"pattern":"The addressCity must not be empty"},"type":"string"},"addressRegion":{"pattern":"\\S","errorMessage":{"pattern":"The addressRegion must not be empty"},"type":"string"},"addressPostcode":{"pattern":"\\S","errorMessage":{"pattern":"The addressPostcode must not be empty"},"type":"string"},"addressCountry":{"pattern":"\\S","errorMessage":{"pattern":"The addressCountry must not be empty"},"type":"string"}}},{"type":"object","required":["addressCity"],"properties":{"addressCity":{"pattern":"\\S","errorMessage":{"pattern":"The addressCity must not be empty"},"type":"string"}}}]},"EnquiriesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/EnquiryWithJobIds"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"EnquiryByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/EnquiryWithJobIds"}}},"EnquiryCreatedResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Enquiry"}}},"EnquiryWithJobIds":{"type":"object","allOf":[{"type":"object","required":["id","name","contactName","address1","address2","addressSuburb","addressRegion","addressPostcode","addressCity","addressCountry","description","createdAt","source","status","links"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"contactName":{"type":"string"},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},{"type":"object","required":["jobIds"],"properties":{"jobIds":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}]},"User":{"type":"object","required":["id","companyId","firstName","lastName","email","userType","createdAt","modifiedAt","address","payRate","chargeOutRate","status","isOwner","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"userType":{"enum":["contractor","time_sheet_only","field_worker","apprentice","tradesman","advisor","full_user"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"modifiedAt":{"format":"date-time","type":"string"},"address":{"$ref":"#/components/schemas/AddressContact"},"contactItems":{"type":"array","items":{"$ref":"#/components/schemas/ContactItem"}},"payRate":{"minimum":0,"type":"number"},"chargeOutRate":{"multipleOf":0.01,"minimum":0,"type":"number"},"status":{"enum":["active","disabled","invited"],"type":"string"},"isOwner":{"description":"Whether this user has owner-level access for the company","type":"boolean"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"UsersResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"type":"object","required":["id","companyId","firstName","lastName","email","userType","createdAt","modifiedAt","address","payRate","chargeOutRate","status","isOwner","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"userType":{"enum":["contractor","time_sheet_only","field_worker","apprentice","tradesman","advisor","full_user"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"modifiedAt":{"format":"date-time","type":"string"},"address":{"$ref":"#/components/schemas/AddressContact"},"payRate":{"minimum":0,"type":"number"},"chargeOutRate":{"multipleOf":0.01,"minimum":0,"type":"number"},"status":{"enum":["active","disabled","invited"],"type":"string"},"isOwner":{"description":"Whether this user has owner-level access for the company","type":"boolean"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"UserByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/User"}}},"TimeEntry":{"type":"object","required":["timeEntryId","companyId","userId","user","dateEntered","startTime","endTime","isLocked","payRate","chargeOutRate","paidDuration","unchargedTimeDuration","unchargedTimeStart","unchargedTimeType","isUnchargedTimeUnpaid","workDescription","jobId","jobNo","jobPhaseId","jobPhaseTitle","jobPhaseDetails","links"],"properties":{"timeEntryId":{"type":"number"},"companyId":{"type":"number"},"userId":{"type":"number"},"user":{"type":"string"},"dateEntered":{"format":"date-time","type":"string"},"startTime":{"description":"The start time of the time entry in the format of YYYY-MM-DD HH:MM at 15 minute intervals","type":"string","example":"2021-01-01 07:00"},"endTime":{"description":"The end time of the time entry in the format of YYYY-MM-DD HH:MM at 15 minute intervals","type":"string","example":"2021-01-01 17:00"},"isLocked":{"type":"boolean"},"payRate":{"minimum":0,"description":"The pay rate per hour for the time entry","type":"number","example":10},"chargeOutRate":{"minimum":0,"description":"The charge out rate per hour for the time entry","type":"number","example":10},"paidDuration":{"minimum":0,"description":"The paid duration in hours for the time entry","type":"number","example":10},"unchargedTimeDuration":{"anyOf":[{"minimum":0,"description":"The uncharged duration in hours for the time entry","examples":[10,0.5],"type":"number"},{"type":"null"}]},"unchargedTimeStart":{"anyOf":[{"description":"The start time of the uncharged duration in the format of YYYY-MM-DD HH:MM at 15 minute intervals","examples":["2021-01-01 07:00"],"type":"string"},{"type":"null"}]},"unchargedTimeType":{"anyOf":[{"type":"string"},{"type":"null"}]},"isUnchargedTimeUnpaid":{"type":"boolean"},"workDescription":{"type":"string"},"jobId":{"anyOf":[{"description":"The id of the job that the time entry is associated with","type":"number"},{"type":"null"}]},"jobNo":{"anyOf":[{"description":"The sequential job no that the time entry is associated with","type":"number"},{"type":"null"}]},"jobPhaseId":{"anyOf":[{"description":"The id of the job phase that the time entry is associated with","type":"number"},{"type":"null"}]},"jobPhaseTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobPhaseDetails":{"anyOf":[{"type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"TimeEntriesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TimeEntry"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"GetPricingTiersResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PricingTier"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"PricingTier":{"type":"object","required":["id","name","isDefault","tierType","markupRate","createdAt","links"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"tierType":{"type":"string"},"markupRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"GetPricingTierByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/PricingTier"}}},"GetPricebooksResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Pricebook"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"Pricebook":{"type":"object","required":["id","supplierName","supplierId","type","itemCount","createdAt","lastUpdatedAt","supplierContact","links"],"properties":{"id":{"type":"number"},"supplierName":{"type":"string"},"supplierId":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":{"anyOf":[{"type":"string","enum":["Standard"]},{"type":"string","enum":["Non-Standard"]},{"type":"string","enum":["Custom"]}]},"itemCount":{"type":"number"},"createdAt":{"type":"string"},"lastUpdatedAt":{"type":"string"},"supplierContact":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ContactItem"}},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"GetPriceBookByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Pricebook"}}},"PricebookItemPricingTier":{"type":"object","required":["id","price","markup","discountRate","links"],"properties":{"id":{"type":"number"},"price":{"type":"number"},"markup":{"type":"number"},"discountRate":{"type":"number"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"PricebookItem":{"type":"object","required":["id","name","productCode","priceBookId","unitType","costPrice","retailPrice","searchValues","updatedAt","supplierSku","pricingTier","links"],"properties":{"id":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceBookId":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"costPrice":{"type":"number"},"retailPrice":{"type":"number"},"searchValues":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"pricingTier":{"type":"array","items":{"$ref":"#/components/schemas/PricebookItemPricingTier"}},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"GetPricebookItemsResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PricebookItem"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"GetPricebookItemByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/PricebookItem"}}},"SearchPricebooksResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PricebookSearchItem"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"PriceBookSearch":{"type":"object","required":["search"],"properties":{"search":{"description":"Search term for pricebook items (minimum 3 characters). Searches across:\n- `name` - Product or item name\n- `productCode` - Product identification code\n- `supplierSku` - Supplier SKU/part number","minLength":3,"type":"string","example":"hammer"},"pricingTierId":{"description":"Filter results to show prices for a specific pricing tier ID. If not provided, the default pricing tier will be used","type":"number","example":123},"allSuppliers":{"description":"When true (default), searches across all supplier pricebooks. When false, only searches pricebooks specified in supplierIds","default":true,"type":"boolean"},"supplierIds":{"description":"Array of supplier/pricebook IDs to limit the search scope. Only used when allSuppliers is false","type":"array","items":{"type":"number"},"example":[101,102,103]}}},"PricebookSearchItem":{"type":"object","required":["id","name","productCode","priceBookId","salesAccountId","unitType","costPrice","retailPrice","searchValues","updatedAt","supplierSku","links"],"properties":{"id":{"description":"Unique identifier for the pricebook item","type":"number"},"name":{"anyOf":[{"description":"Product or item name","type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"description":"Product identification code","type":"string"},{"type":"null"}]},"priceBookId":{"anyOf":[{"description":"ID of the pricebook this item belongs to","type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"description":"Sales account ID associated with this item","type":"number"},{"type":"null"}]},"unitType":{"anyOf":[{"description":"Unit of measure (e.g., 'each', 'm', 'kg')","examples":["each","m","kg","m2"],"type":"string"},{"type":"null"}]},"costPrice":{"description":"Cost price of the item (price paid to supplier). Price shown is for the selected pricing tier or default tier","type":"number"},"retailPrice":{"description":"Retail/selling price of the item. Price shown is for the selected pricing tier or default tier","type":"number"},"searchValues":{"anyOf":[{"description":"Concatenated searchable values used for search ranking","type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"description":"Timestamp of when the item was last updated","format":"date-time","type":"string"},{"type":"null"}]},"supplierSku":{"anyOf":[{"description":"Supplier's SKU or part number","type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"CalendarEvent":{"type":"object","required":["id","companyId","userId","userName","groupId","title","description","eventType","jobPhaseId","jobId","startTime","endTime","isActive","isAllDay","isRecurring","recurringEventDetails","createdAt","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"userId":{"anyOf":[{"type":"number"},{"type":"null"}]},"userName":{"anyOf":[{"type":"string"},{"type":"null"}]},"groupId":{"anyOf":[{"type":"number"},{"type":"null"}]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventType":{"enum":["JOB_PHASE","QUOTE","ESTIMATE","OTHER"],"type":"string"},"jobPhaseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"jobId":{"anyOf":[{"type":"number"},{"type":"null"}]},"startTime":{"format":"date-time","description":"The start time of the calendar event in ISO string format in 15 minute intervals","type":"string","example":"2021-01-01T07:00:00.000Z"},"endTime":{"format":"date-time","description":"The end time of the calendar event in ISO string format in 15 minute intervals","type":"string","example":"2021-01-01T17:00:00.000Z"},"isActive":{"type":"boolean"},"isAllDay":{"type":"boolean"},"isRecurring":{"type":"boolean"},"recurringEventDetails":{"anyOf":[{"$ref":"#/components/schemas/RecurringEventDetails"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"CalendarEventsResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEvent"}}}},"CalendarEventByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/CalendarEvent"}}},"RecurringEventDetails":{"type":"object","required":["startDate","endDate","rRule","text"],"properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rRule":{"type":"string"},"text":{"type":"string"}}},"CustomerInvoice":{"type":"object","required":["id","jobId","customerId","attn","title","description","invoiceNumber","receiverEmail","receiverFullName","receiverPostalAddress","dueDate","dueDays","invoiceDate","paidAt","subtotal","taxValue","totalPaid","taxRate","type","status","isSent","isFinal","createdAt","fergusPayEnabled","directDebitStatus","links"],"properties":{"id":{"type":"number"},"jobId":{"type":"number"},"customerId":{"type":"number"},"attn":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPostalAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDays":{"anyOf":[{"description":"Number of days or one of '20th_of_next_month', '20th_of_current_month', 'last_day_of_current_month', 'last_day_of_next_month', 'use_default'","anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"invoiceDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"subtotal":{"type":"number"},"taxValue":{"type":"number"},"totalPaid":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"type":"number"},"type":{"anyOf":[{"type":"string","enum":["approved"]},{"type":"string","enum":["toBeApproved"]},{"type":"string","enum":["draft"]}]},"status":{"anyOf":[{"type":"string","enum":["unpaid"]},{"type":"string","enum":["draft"]},{"type":"string","enum":["voided"]},{"type":"string","enum":["paidDisputed"]},{"type":"string","enum":["unpaidDisputed"]},{"type":"string","enum":["paid"]}]},"isSent":{"type":"boolean"},"isFinal":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"fergusPayEnabled":{"type":"boolean"},"directDebitStatus":{"anyOf":[{"anyOf":[{"type":"string","enum":["processing"]},{"type":"string","enum":["succeeded"]},{"type":"string","enum":["failed"]}]},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"InvoicesQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"sortField":{"default":"createdAt","enum":["id","createdAt","dueDate"],"errorMessage":"sortField must be `id`, `createdAt`, or `dueDate`, defaults to `createdAt`","anyOf":[{"type":"string","enum":["id"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["dueDate"]}]},"customerId":{"description":"Filter by customer ID","errorMessage":"customerId must be a number","type":"number"},"jobId":{"description":"Filter by job ID","errorMessage":"jobId must be a number","type":"number"},"invoiceNumber":{"description":"Search by invoiceNumber","errorMessage":"invoiceNumber must be a string","type":"string"},"dueBefore":{"format":"date-time","description":"Filter invoices due before this datetime","errorMessage":"dueBefore must be a valid ISO 8601 date-time","type":"string"},"dueAfter":{"format":"date-time","description":"Filter invoices due after this datetime","errorMessage":"dueAfter must be a valid ISO 8601 date-time","type":"string"},"filterDirectDebitStatus":{"enum":["processing","succeeded","failed"],"description":"Filter by direct debit status","errorMessage":"filterDirectDebitStatus must be `processing`, `succeeded`, or `failed`","anyOf":[{"type":"string","enum":["processing"]},{"type":"string","enum":["succeeded"]},{"type":"string","enum":["failed"]}]}}}]},"ListCustomerInvoicesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerInvoice"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"InvoiceSection":{"type":"object","required":["sectionId","name","sortOrder","parentSectionId","description"],"properties":{"sectionId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"parentSectionId":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","required":["priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","customerInvoiceLineItemId","itemDescription","isCardPaymentFee"],"properties":{"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"customerInvoiceLineItemId":{"type":"number"},"itemDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCardPaymentFee":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceSection"}}}},"DetailedCustomerInvoice":{"type":"object","required":["id","jobId","customerId","attn","title","description","invoiceNumber","receiverEmail","receiverFullName","receiverPostalAddress","dueDate","dueDays","invoiceDate","paidAt","subtotal","taxValue","totalPaid","taxRate","type","status","isSent","isFinal","createdAt","fergusPayEnabled","directDebitStatus","links","customer","sections"],"properties":{"id":{"type":"number"},"jobId":{"type":"number"},"customerId":{"type":"number"},"attn":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPostalAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"dueDays":{"anyOf":[{"description":"Number of days or one of '20th_of_next_month', '20th_of_current_month', 'last_day_of_current_month', 'last_day_of_next_month', 'use_default'","anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"invoiceDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"subtotal":{"type":"number"},"taxValue":{"type":"number"},"totalPaid":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"type":"number"},"type":{"anyOf":[{"type":"string","enum":["approved"]},{"type":"string","enum":["toBeApproved"]},{"type":"string","enum":["draft"]}]},"status":{"anyOf":[{"type":"string","enum":["unpaid"]},{"type":"string","enum":["draft"]},{"type":"string","enum":["voided"]},{"type":"string","enum":["paidDisputed"]},{"type":"string","enum":["unpaidDisputed"]},{"type":"string","enum":["paid"]}]},"isSent":{"type":"boolean"},"isFinal":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"fergusPayEnabled":{"type":"boolean"},"directDebitStatus":{"anyOf":[{"anyOf":[{"type":"string","enum":["processing"]},{"type":"string","enum":["succeeded"]},{"type":"string","enum":["failed"]}]},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}},"customer":{"type":"object","required":["id","customerFullName","links"],"properties":{"id":{"type":"number"},"customerFullName":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"sections":{"type":"array","items":{"type":"object","required":["sectionId","name","sortOrder","parentSectionId","description"],"properties":{"sectionId":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"parentSectionId":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","required":["priceBookLineItemId","itemName","itemQuantity","unitOfMeasureSell","itemPrice","salesAccountId","isLabour","sortOrder","discountRate","isCombined","combinedItemId","customerInvoiceLineItemId","itemDescription","isCardPaymentFee"],"properties":{"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"itemName":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemQuantity":{"anyOf":[{"default":1,"type":"number"},{"type":"null"}]},"unitOfMeasureSell":{"anyOf":[{"anyOf":[{"type":"string","enum":["each"]},{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["kilogram"]},{"type":"string","enum":["tonne"]},{"type":"string","enum":["litre"]},{"type":"string","enum":["bag"]},{"type":"string","enum":["sheet"]},{"type":"string","enum":["length"]},{"type":"string","enum":["box"]},{"type":"string","enum":["millimetre"]},{"type":"string","enum":["centimetre"]},{"type":"string","enum":["metre"]},{"type":"string","enum":["square_metre"]},{"type":"string","enum":["cubic_metre"]}]},{"type":"null"}]},"itemPrice":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"salesAccountId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isLabour":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sortOrder":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountRate":{"anyOf":[{"default":0,"type":"number"},{"type":"null"}]},"isCombined":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"combinedItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"customerInvoiceLineItemId":{"type":"number"},"itemDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCardPaymentFee":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceSection"}}}}}}},"GetCustomerInvoiceByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/DetailedCustomerInvoice"}}},"Contact":{"allOf":[{"$ref":"#/components/schemas/PersonContact"},{"type":"object","required":["contactType","isMain","isBilling","customerId","siteId","createdAt","modifiedAt","links"],"properties":{"contactType":{"enum":["CUSTOMER","SITE"],"type":"string"},"isMain":{"type":"boolean"},"isBilling":{"type":"boolean"},"customerId":{"anyOf":[{"type":"number"},{"type":"null"}]},"siteId":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"modifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}}]},"ContactsResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"ContactsQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"sortField":{"default":"createdAt","enum":["firstName","lastName","createdAt"],"errorMessage":"The sortField must be either `firstName`, `lastName` or `createdAt`, defaults to `createdAt`","type":"string"},"filterContactType":{"enum":["CUSTOMER","SITE"],"errorMessage":"The filterContactType must be a valid contact type and must be one of the following: CUSTOMER, SITE","type":"string"},"filterCustomerId":{"errorMessage":"The filterCustomerId must be a valid customer ID","type":"number"},"filterSiteId":{"errorMessage":"The filterSiteId must be a valid site ID","type":"number"}}},{"type":"object","properties":{"filterSearchText":{"description":"Searchable fields:\n- `firstName`\n- `lastName`\n- `email`\n- `phoneNumber`\n","type":"string"}}}]},"ContactByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Contact"}}},"CreateContactPayload":{"customerIdValidation":true,"siteIdValidation":true,"customerIsMainValidation":true,"type":"object","allOf":[{"type":"object","required":["firstName"],"properties":{"firstName":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The firstName must be at least 1 character long","pattern":"The firstName must not be empty"},"type":"string"},"lastName":{"pattern":"\\S","errorMessage":{"pattern":"The lastName must not be empty"},"type":"string"},"position":{"type":"string"},"company":{"type":"string"},"contactItems":{"type":"array","items":{"$ref":"#/components/schemas/ContactItemPayload"}}}},{"type":"object","required":["email","contactType"],"properties":{"email":{"format":"email","type":"string"},"isMain":{"default":false,"type":"boolean"},"isBilling":{"default":false,"type":"boolean"},"siteId":{"type":"number"},"customerId":{"type":"number"},"contactType":{"enum":["CUSTOMER","SITE"],"errorMessage":"The contactType is required and must be one of the following: CUSTOMER, SITE","type":"string"}}}]},"UpdateContactPayload":{"contactItemsEmailValidation":true,"allOf":[{"type":"object","allOf":[{"type":"object","required":["firstName"],"properties":{"firstName":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The firstName must be at least 1 character long","pattern":"The firstName must not be empty"},"type":"string"},"lastName":{"pattern":"\\S","errorMessage":{"pattern":"The lastName must not be empty"},"type":"string"},"position":{"type":"string"},"company":{"type":"string"}}},{"type":"object","properties":{"isMain":{"default":false,"type":"boolean"},"isBilling":{"default":false,"type":"boolean"}}}]},{"type":"object","required":["contactItems"],"properties":{"contactItems":{"type":"array","items":{"$ref":"#/components/schemas/ContactItemPayload"}}}}]},"NoteReply":{"type":"object","required":["id","companyId","entityId","entityName","text","createdById","createdAt","isPinned","parentId","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"entityId":{"type":"number"},"entityName":{"enum":["JOB","CUSTOMER","CUSTOMER_INVOICE","QUOTE","SITE","TASK","ENQUIRY","JOB_PHASE"],"type":"string"},"text":{"type":"string"},"createdById":{"type":"number"},"createdAt":{"type":"string"},"isPinned":{"type":"boolean"},"parentId":{"anyOf":[{"type":"number"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"Note":{"$description":"Schema for Note including optional replies and links","type":"object","allOf":[{"type":"object","required":["id","companyId","entityId","entityName","text","createdById","createdAt","isPinned","parentId","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"entityId":{"type":"number"},"entityName":{"enum":["JOB","CUSTOMER","CUSTOMER_INVOICE","QUOTE","SITE","TASK","ENQUIRY","JOB_PHASE"],"type":"string"},"text":{"type":"string"},"createdById":{"type":"number"},"createdAt":{"type":"string"},"isPinned":{"type":"boolean"},"parentId":{"anyOf":[{"type":"number"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},{"type":"object","properties":{"replies":{"type":"array","items":{"$ref":"#/components/schemas/NoteReply"}}}}]},"GetNotesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Note"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"CreateNotePayload":{"type":"object","required":["text","entityName","entityId"],"properties":{"text":{"description":"The body text of the note","minLength":1,"type":"string"},"entityName":{"description":"The type of entity this note belongs to","anyOf":[{"type":"string","enum":["job"]},{"type":"string","enum":["customer"]},{"type":"string","enum":["customer_invoice"]},{"type":"string","enum":["quote"]},{"type":"string","enum":["site"]},{"type":"string","enum":["task"]},{"type":"string","enum":["enquiry"]},{"type":"string","enum":["works_order"]}]},"entityId":{"description":"The ID of the entity this note belongs to","type":"number","example":123},"parentId":{"anyOf":[{"description":"Parent note ID for a reply. Omit or set null for top-level notes.","examples":[456],"type":"number"},{"type":"null"}]},"isPinned":{"description":"Pin the note on creation. Defaults to false.","type":"boolean"}}},"CreateNoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/NoteReply"}}},"UpdateNotePayload":{"minProperties":1,"description":"At least one of `text` or `isPinned` must be provided.","type":"object","properties":{"text":{"description":"Updated body text for the note","minLength":1,"type":"string"},"isPinned":{"description":"Pin or unpin the note","type":"boolean"}}},"UpdateNoteResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/NoteReply"}}},"StockOnHandItem":{"type":"object","required":["id","itemDescription","jobId","jobPhaseId","itemCost","itemCostQuantity","itemCostTotal","itemPrice","itemQuantity","itemTotal","priceBookLineItemId","priceBookId","createdBy","dateEntered","lastModified","links"],"properties":{"id":{"type":"number"},"itemDescription":{"type":"string"},"jobId":{"type":"number"},"jobPhaseId":{"type":"number"},"itemCost":{"type":"number"},"itemCostQuantity":{"type":"number"},"itemCostTotal":{"type":"number"},"itemPrice":{"type":"number"},"itemQuantity":{"type":"number"},"itemTotal":{"type":"number"},"priceBookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"priceBookId":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"number"},{"type":"null"}]},"dateEntered":{"format":"date-time","type":"string"},"lastModified":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"StockOnHandQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"sortField":{"default":"dateEntered","enum":["dateEntered","lastModified"],"errorMessage":"The sortField must be `dateEntered` (default) or `lastModified`","anyOf":[{"type":"string","enum":["dateEntered"]},{"type":"string","enum":["lastModified"]}]},"filterSearchText":{"description":"Searchable fields:\n- `itemDescription`","type":"string"},"lastModified":{"format":"date-time","type":"string"},"dateEntered":{"format":"date-time","type":"string"}}}]},"StockOnHandListResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StockOnHandItem"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"CreateStockOnHandItem":{"anyOf":[{"type":"object","required":["itemQuantity","priceBookLineItemId"],"properties":{"itemQuantity":{"type":"number"},"priceBookLineItemId":{"type":"number"},"salesAccountId":{"type":"number"}}},{"type":"object","required":["itemDescription","itemPrice","itemCost","itemQuantity"],"properties":{"itemDescription":{"type":"string"},"itemPrice":{"type":"number"},"itemCost":{"type":"number"},"itemQuantity":{"type":"number"},"salesAccountId":{"type":"number"}}}]},"UpdateStockOnHandItem":{"minProperties":1,"errorMessage":{"minProperties":"At least one field must be provided to update stock on hand"},"type":"object","properties":{"itemDescription":{"type":"string"},"itemPrice":{"type":"number"},"itemCost":{"type":"number"},"itemQuantity":{"type":"number"},"salesAccountId":{"type":"number"},"isLabour":{"type":"boolean"}}},"StockOnHandResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/StockOnHandItem"}}},"StockUsedQueryParameters":{"dateFromMaxDays":180,"type":"object","properties":{"filterDateFrom":{"format":"date","description":"Filter stock used on or after this date (yyyy-mm-dd) default is 90 days ago and max up to 180 days ago","type":"string"},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},"StockUsedListResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StockUsedItem"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"StockUsedItem":{"type":"object","required":["productCode","productName","pricebookLineItemId","pricebookId","totalQty"],"properties":{"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"type":"string"},"pricebookLineItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"pricebookId":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalQty":{"type":"number"}}},"Company":{"type":"object","required":["guid","prefix","name","dateCreated","active","hasTermsOfTrade","hasLogo","contact","settings","tax"],"properties":{"guid":{"type":"string"},"prefix":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateCreated":{"format":"date-time","type":"string"},"active":{"type":"boolean"},"hasTermsOfTrade":{"type":"boolean"},"hasLogo":{"type":"boolean"},"contact":{"anyOf":[{"type":"object","required":["firstName","lastName","position","companyName","address1","address2","addressSuburb","addressCity","addressRegion","addressPostcode","addressCountry","contactItems"],"properties":{"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactItems":{"type":"array","items":{"type":"object","required":["contactType","contactValue"],"properties":{"contactType":{"type":"string"},"contactValue":{"type":"string"}}}}}},{"type":"null"}]},"settings":{"type":"array","items":{"type":"object","required":["settingKey","settingValue"],"properties":{"settingKey":{"type":"string"},"settingValue":{"type":"string"}}}},"tax":{"anyOf":[{"type":"object","required":["rate","type"],"properties":{"rate":{"type":"number"},"type":{"type":"string"}}},{"type":"null"}]}}},"CompanyContact":{"type":"object","required":["firstName","lastName","position","companyName","address1","address2","addressSuburb","addressCity","addressRegion","addressPostcode","addressCountry","contactItems"],"properties":{"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"address1":{"anyOf":[{"type":"string"},{"type":"null"}]},"address2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressSuburb":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressRegion":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressPostcode":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactItems":{"type":"array","items":{"type":"object","required":["contactType","contactValue"],"properties":{"contactType":{"type":"string"},"contactValue":{"type":"string"}}}}}},"CompanyContactItem":{"type":"object","required":["contactType","contactValue"],"properties":{"contactType":{"type":"string"},"contactValue":{"type":"string"}}},"CompanySetting":{"type":"object","required":["settingKey","settingValue"],"properties":{"settingKey":{"type":"string"},"settingValue":{"type":"string"}}},"CompanyTax":{"type":"object","required":["rate","type"],"properties":{"rate":{"type":"number"},"type":{"type":"string"}}},"GetCompanyResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Company"}}},"Task":{"type":"object","required":["id","description","dueDate","jobId","status","createdById","createdAt","completedAt","completedById","assignedEmployeeIds","links"],"properties":{"id":{"type":"number"},"description":{"type":"string"},"dueDate":{"anyOf":[{"format":"date","type":"string"},{"type":"null"}]},"jobId":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["completed"]}]},"createdById":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"completedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"completedById":{"anyOf":[{"type":"number"},{"type":"null"}]},"assignedEmployeeIds":{"type":"array","items":{"type":"number"}},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"TasksQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","properties":{"sortField":{"default":"createdAt","enum":["createdAt","dueDate"],"anyOf":[{"type":"string","enum":["createdAt"]},{"type":"string","enum":["dueDate"]}]},"filterStatus":{"enum":["pending","completed"],"description":"Filter by task status","anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["completed"]}]},"filterEmployeeId":{"description":"Filter tasks assigned to this employee ID","examples":[20],"type":"number"},"filterJobId":{"description":"Filter tasks linked to this job ID","examples":[123],"type":"number"},"filterDueDateFrom":{"format":"date","description":"Filter tasks with due date on or after this date (yyyy-mm-dd)","examples":["2025-01-01"],"errorMessage":"filterDueDateFrom must be a valid date in 'yyyy-mm-dd' format","type":"string"},"filterDueDateTo":{"format":"date","description":"Filter tasks with due date on or before this date (yyyy-mm-dd)","examples":["2025-12-31"],"errorMessage":"filterDueDateTo must be a valid date in 'yyyy-mm-dd' format","type":"string"},"filterOverdue":{"description":"Filter to tasks that are past their due date and not completed","type":"boolean"}}}]},"GetTasksResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"paging":{"$ref":"#/components/schemas/Pagination"}}},"GetTaskByIdResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Task"}}},"CreateTaskPayload":{"type":"object","required":["description"],"properties":{"description":{"description":"The task description","minLength":1,"type":"string"},"dueDate":{"anyOf":[{"format":"date","description":"The due date in yyyy-mm-dd format","examples":["2025-06-30"],"type":"string"},{"type":"null"}]},"jobId":{"anyOf":[{"description":"Link this task to a job. Cannot be changed after creation.","examples":[123],"type":"number"},{"type":"null"}]},"assignedEmployeeIds":{"description":"Employee IDs to assign to this task","type":"array","items":{"minimum":1,"type":"number"},"example":[20,23]}}},"CreateTaskResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Task"}}},"UpdateTaskPayload":{"minProperties":1,"description":"At least one of `description`, `dueDate`, or `assignedEmployeeIds` must be provided.","type":"object","properties":{"description":{"description":"Updated task description","minLength":1,"type":"string"},"dueDate":{"anyOf":[{"format":"date","description":"Updated due date (yyyy-mm-dd). Pass null to clear.","examples":["2025-06-30"],"type":"string"},{"type":"null"}]},"assignedEmployeeIds":{"description":"Replace all assigned employees with this list. Pass empty array to remove all.","type":"array","items":{"minimum":1,"type":"number"}}}},"UpdateTaskResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Task"}}},"CompleteTaskResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Task"}}},"ReopenTaskResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/Task"}}},"File":{"type":"object","required":["id","companyId","entityType","entityId","fileGuid","fileName","fileSize","mimeType","createdBy","createdAt","links"],"properties":{"id":{"type":"number"},"companyId":{"type":"number"},"entityType":{"enum":["customer","job","site","enquiry","job_phase"],"type":"string"},"entityId":{"type":"number"},"fileGuid":{"description":"Unique file identifier (sys_file.guid)","type":"string"},"fileName":{"type":"string"},"fileSize":{"description":"File size in bytes","type":"number"},"mimeType":{"type":"string"},"createdBy":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/Links"}}}},"ListFilesQueryParameters":{"type":"object","allOf":[{"type":"object","properties":{"pageSize":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"sortOrder":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"pageCursor":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"}}},{"type":"object","required":["entityType","entityId"],"properties":{"entityType":{"enum":["customer","job","site","enquiry","job_phase"],"description":"Entity type to list attachments for","type":"string"},"entityId":{"description":"Entity ID to list attachments for","type":"number"},"search":{"description":"Search by file name (partial match)","examples":["invoice"],"type":"string"},"filterMimeType":{"description":"Filter by exact MIME type","examples":["application/pdf"],"type":"string"},"filterCreatedAfter":{"format":"date-time","description":"Filter files created after this date-time (ISO 8601)","errorMessage":"filterCreatedAfter must be a valid ISO 8601 date-time","type":"string"},"filterCreatedBefore":{"format":"date-time","description":"Filter files created before this date-time (ISO 8601)","errorMessage":"filterCreatedBefore must be a valid ISO 8601 date-time","type":"string"},"filterCreatedById":{"description":"Filter by the user ID who uploaded the file","examples":[42],"type":"number"}}}]},"ListFilesResponse":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"paging":{"$ref":"#/components/schemas/Pagination"}}}}},"paths":{"/version":{"get":{"tags":["Server"],"description":"Returns the current version of the API.","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/disconnect":{"post":{"tags":["Server"],"description":"Disconnects the application from the Fergus API and revokes all tokens.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["refreshToken","clientId","clientSecret"],"properties":{"refreshToken":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/favourites":{"get":{"tags":["Favourites"],"description":"Get all favourite sections, in flat or tree view","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSectionName","required":false,"description":"Searchable fields:\n- representation: tree\n  - `section.name`\n- representation: flat\n  - `section.name`"},{"schema":{"default":"sortOrder","enum":["name","createdAt","sortOrder"],"errorMessage":"The sortField must be either `name`, `sortOrder` or `createdAt`, defaults to `sortOrder`","anyOf":[{"type":"string","enum":["name"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["sortOrder"]}]},"in":"query","name":"sortField","required":false},{"schema":{"default":"flat","enum":["flat","tree"],"errorMessage":"The representation must be either `flat` or `tree`, defaults to `flat`","anyOf":[{"type":"string","enum":["flat"]},{"type":"string","enum":["tree"]}]},"in":"query","name":"representation","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- representation: tree\n  - `section.name`\n  - `lineItem.itemName`,\n- representation: flat\n  - `section.name`\n  - `section.description`,\n  - `lineItem.itemName`"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavouritesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/favourites/{sectionId}":{"get":{"tags":["Favourites"],"description":"Get a specific favourite section","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"sectionId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavouritesSection"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs":{"get":{"tags":["Jobs"],"description":"Returns a list of jobs. The list can be filtered by job type.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"type":"string"},"in":"query","name":"filterJobNo","required":false},{"schema":{"enum":["Active","Completed","Estimate Rejected","Estimate Sent","Inactive","Quote Sent","Quote Rejected","To Price"],"errorMessage":"The filterJobType must be one of Active, Completed, Estimate Rejected, Estimate Sent, Inactive, Quote Sent, Quote Rejected, To Price","anyOf":[{"type":"string","enum":["Active"]},{"type":"string","enum":["Completed"]},{"type":"string","enum":["Estimate Rejected"]},{"type":"string","enum":["Estimate Sent"]},{"type":"string","enum":["Inactive"]},{"type":"string","enum":["Quote Sent"]},{"type":"string","enum":["Quote Rejected"]},{"type":"string","enum":["To Price"]}]},"in":"query","name":"filterJobStatus","required":false},{"schema":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The filterJobType must be one of `Quote`, `Estimate`, or `Charge Up`","anyOf":[{"type":"string","enum":["Quote"]},{"type":"string","enum":["Estimate"]},{"type":"string","enum":["Charge Up"]}]},"in":"query","name":"filterJobType","required":false},{"schema":{"type":"number"},"in":"query","name":"filterCustomerId","required":false},{"schema":{"type":"number"},"in":"query","name":"filterSiteId","required":false},{"schema":{"default":"createdAt","enum":["jobNo","createdAt","lastModified"],"errorMessage":"The sortField must be either `jobNo` or `createdAt`, defaults to `jobNo`","anyOf":[{"type":"string","enum":["jobNo"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["lastModified"]}]},"in":"query","name":"sortField","required":false},{"schema":{"errorMessage":"The filterShowOnHold must be a boolean","type":"boolean"},"in":"query","name":"filterShowOnHold","required":false},{"schema":{"errorMessage":"The filterShowArchived must be a boolean","type":"boolean"},"in":"query","name":"filterShowArchived","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `description`\n- `longDescription`\n- `jobNo`\n- `customer.customerFullName`\n- `siteAddress.name`\n- `siteAddress.firstName`\n- `siteAddress.lastName`\n- `mainContact.firstName`\n- `mainContact.lastName`"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Jobs"],"description":"Create a new job.\n\nProvide `parentJobId` to instead create a variation of an existing job:\n- requires `jobType`\n- inherits customer, site, contacts and budget from the parent\n- `title`, `description` and `customerReference` are optional overrides\n- always created finalised (non-draft)","requestBody":{"content":{"application/json":{"schema":{"if":{"type":"object","required":["parentJobId"],"properties":{"parentJobId":{"type":"number"}}},"then":{"$ref":"#/components/schemas/CreateJobVariation"},"else":{"if":{"type":"object","required":["isDraft"],"properties":{"isDraft":{"type":"boolean","enum":[true]}}},"then":{"$ref":"#/components/schemas/CreateDraftJob"},"else":{"$ref":"#/components/schemas/CreateNonDraftJob"}},"type":"object","required":["jobType"],"properties":{"isDraft":{"type":"boolean"},"jobType":{"enum":["Quote","Estimate","Charge Up"],"errorMessage":"The jobType must be one of `Quote`, `Estimate`, or `Charge Up`","type":"string"},"title":{"type":"string"},"description":{"type":"string"},"customerId":{"type":"number"},"customerReference":{"type":"string"},"siteId":{"type":"number"},"parentJobId":{"description":"When provided, creates a variation of the job with this id as its parent. Only `jobType` is required; `title`, `description` and `customerReference` are optional and inherited from the parent when omitted.","type":"number"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}":{"get":{"tags":["Jobs"],"description":"Returns a job by id","parameters":[{"schema":{"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Jobs"],"description":"Updates a draft job","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["title"],"properties":{"title":{"type":"string"}}},{"type":"object","required":["description"],"properties":{"description":{"type":"string"}}},{"type":"object","required":["customerId"],"properties":{"customerId":{"type":"number"}}},{"type":"object","required":["customerReference"],"properties":{"customerReference":{"type":"string"}}},{"type":"object","required":["siteId"],"properties":{"siteId":{"type":"number"}}}]}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/finalise":{"put":{"tags":["Jobs"],"description":"Finalise a draft job.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/phases":{"get":{"tags":["Jobs"],"description":"Returns a list of job phases","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPhasesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Jobs"],"description":"Creates a job phase","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","description"],"properties":{"title":{"type":"string"},"description":{"type":"string"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPhaseResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/phases/{jobPhaseId}":{"get":{"tags":["Jobs"],"description":"Returns a job phase","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true},{"schema":{"type":"string"},"in":"path","name":"jobPhaseId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPhaseResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Jobs"],"description":"Creates a job phase","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","description"],"properties":{"title":{"type":"string"},"description":{"type":"string"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true},{"schema":{"type":"string"},"in":"path","name":"jobPhaseId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPhaseResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/phases/{jobPhaseId}/void":{"post":{"tags":["Jobs"],"description":"Void a job phase by JobId and Job PhaseId","parameters":[{"schema":{"type":"number"},"in":"path","name":"jobId","required":true},{"schema":{"type":"number"},"in":"path","name":"jobPhaseId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Job Phase voided successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/financialSummary":{"get":{"tags":["Jobs"],"description":"Get a job financial summary","parameters":[{"schema":{"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobFinancialSummaryResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/phases/{jobPhaseId}/financialSummary":{"get":{"tags":["Jobs"],"description":"Get a job phase financial summary","parameters":[{"schema":{"type":"number"},"in":"path","name":"jobId","required":true},{"schema":{"type":"number"},"in":"path","name":"jobPhaseId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobFinancialSummaryResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/hold":{"post":{"tags":["Jobs"],"description":"Puts a job on hold","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["holdUntil","notes"],"properties":{"holdUntil":{"format":"date","errorMessage":"The holdUntil must be a valid date in 'YYYY-MM-DD' format","type":"string","example":"2021-01-01"},"notes":{"type":"string"}}}}},"required":true},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Job put on hold successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/resume":{"post":{"tags":["Jobs"],"description":"Resumes a job that was on hold","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Job resumed successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/quotes":{"get":{"tags":["Jobs"],"description":"Get all quotes for a job","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"type":"boolean"},"in":"query","name":"includeCombinedItemParents","required":false},{"schema":{"enum":["draft","accepted","voided","superseded","declined","published","emailSent","emailNotSent"],"errorMessage":"The filterStatus must be either 'draft', 'accepted', 'voided', 'superseded', 'declined', 'published', 'emailSent', or 'emailNotSent'","anyOf":[{"type":"string","enum":["draft"]},{"type":"string","enum":["accepted"]},{"type":"string","enum":["voided"]},{"type":"string","enum":["superseded"]},{"type":"string","enum":["declined"]},{"type":"string","enum":["published"]},{"type":"string","enum":["emailSent"]},{"type":"string","enum":["emailNotSent"]}]},"in":"query","name":"filterStatus","required":false},{"schema":{"default":"versionNumber","enum":["id","versionNumber"],"errorMessage":"The sortField must be either 'id', 'versionNumber', defaults to 'versionNumber'","anyOf":[{"type":"string","enum":["id"]},{"type":"string","enum":["versionNumber"]}]},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQuotesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Jobs"],"description":"Create a new quote. Supported for jobs with jobType Quote or Estimate.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["title","dueDays","sections"],"properties":{"title":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The title must be at least 1 character long","pattern":"The title must not be empty"},"type":"string"},"description":{"type":"string"},"dueDays":{"minimum":7,"maximum":180,"type":"number"},"versionNumber":{"default":null,"type":"number"},"sections":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}}}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/quotes/{quoteId}":{"get":{"tags":["Jobs"],"description":"Get a quote","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"quoteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQuoteByIdQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Jobs"],"description":"Update a quote by ID. Supported for jobs with jobType Quote or Estimate. The quote must be a draft.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["sections"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"sections":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}}}}}}},"required":true},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"quoteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{jobId}/quotes/version/{versionNumber}":{"put":{"tags":["Jobs"],"description":"Update a quote by version number. Supported for jobs with jobType Quote or Estimate. The quote must be a draft.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["sections"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"sections":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"favouriteSectionId":{"anyOf":[{"type":"number"},{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}]},"favouriteSectionIds":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"number"},"combined":{"type":"boolean"},"lineItemMultiplier":{"type":"number"}}}}]},"sectionLineItemMultiplier":{"default":1,"type":"number"},"parentSectionId":{"default":0,"type":"number"},"description":{"type":"string"},"sortOrder":{"type":"number"},"lineItems":{"type":"array","items":{"combinedItemNameValidation":true,"type":"object","properties":{"quoteLineItemId":{"type":"number"},"priceBookLineItemId":{"type":"number"},"itemName":{"type":"string"},"itemQuantity":{"default":1,"type":"number"},"itemPrice":{"default":0,"type":"number"},"itemCost":{"default":0,"type":"number"},"salesAccountId":{"type":"number"},"discountRate":{"type":"number"},"isLabour":{"type":"boolean"},"sortOrder":{"type":"number"},"isCombined":{"type":"boolean"},"combinedItemName":{"type":"string"}}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpsertQuoteSection"}}}}}}}}},"required":true},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobId","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"versionNumber","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes":{"get":{"tags":["Jobs - Quotes"],"description":"Returns a list of all quotes from across all jobs, sorted by created date and last modified date.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"enum":["draft","accepted","voided","superseded","declined","published","emailSent","emailNotSent"],"errorMessage":"The filterStatus must be either 'draft', 'accepted', 'voided', 'superseded', 'declined', 'published', 'emailSent', or 'emailNotSent'","anyOf":[{"type":"string","enum":["draft"]},{"type":"string","enum":["accepted"]},{"type":"string","enum":["voided"]},{"type":"string","enum":["superseded"]},{"type":"string","enum":["declined"]},{"type":"string","enum":["published"]},{"type":"string","enum":["emailSent"]},{"type":"string","enum":["emailNotSent"]}]},"in":"query","name":"filterStatus","required":false},{"schema":{"default":"createdAt","enum":["id","createdAt","lastModified"],"errorMessage":"The sortField must be either 'id', 'createdAt', or 'lastModified', defaults to 'createdAt'","anyOf":[{"type":"string","enum":["id"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["lastModified"]}]},"in":"query","name":"sortField","required":false},{"schema":{"format":"date-time","errorMessage":"createdAfter must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"createdAfter","required":false,"description":"Get quote created after certain time. Overrides sortField and sortOrder"},{"schema":{"format":"date-time","errorMessage":"modifiedAfter must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"modifiedAfter","required":false,"description":"Get quote modified after certain time. Overrides sortField and sortOrder"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStandaloneQuotesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}":{"get":{"tags":["Jobs - Quotes"],"description":"Returns a specific quote by ID from across all jobs.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"quoteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQuoteByIdQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/guid/{guid}":{"get":{"tags":["Jobs - Quotes"],"description":"Returns a specific quote by GUID with full details.","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"includeCombinedItemParents","required":false,"description":"Include the parents of combined line item in the `lineItems` list (default: false)"},{"schema":{"type":"string"},"in":"path","name":"guid","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQuoteByIdQuoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/publish":{"post":{"tags":["Jobs - Quotes"],"description":"Publishes a quote.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"publishedAt":{"format":"date-time","type":"string"},"publishedBy":{"type":"string"}}}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"quoteId","required":true}],"responses":{"204":{"description":"Quote published successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/markAsSent":{"post":{"tags":["Jobs - Quotes"],"description":"Marks a quote as sent.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"isSent":{"type":"boolean"}}}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"quoteId","required":true}],"responses":{"204":{"description":"Quote marked as sent successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/accept":{"post":{"tags":["Jobs - Quotes"],"description":"Accepts a quote.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["acceptedBy"],"properties":{"acceptedBy":{"description":"The name or employee GUID of the person accepting the quote","type":"string"},"acceptedAt":{"format":"date-time","type":"string"},"selectedSectionIds":{"description":"The IDs of the sections that the customer has accepted. Required if the quote has optional or multi-select sections.","type":"array","items":{"type":"integer"}},"source":{"description":"The source application that initiated the accept (e.g. 'c2-portal').","type":"string"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"quoteId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptQuoteResponse"}}}},"204":{"description":"Quote accepted successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/decline":{"post":{"tags":["Jobs - Quotes"],"description":"Declines a quote.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"declinedAt":{"format":"date-time","type":"string"},"reasonNotes":{"type":"string"},"rejectedBy":{"type":"string"},"source":{"description":"The source application that initiated the decline (e.g. 'c2-portal').","type":"string"}}}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"quoteId","required":true}],"responses":{"204":{"description":"Quote declined successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/void":{"post":{"tags":["Jobs - Quotes"],"description":"Voids a quote.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"voidedAt":{"format":"date-time","type":"string"}}}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"quoteId","required":true}],"responses":{"204":{"description":"Quote voided successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/quotes/{quoteId}/totals":{"post":{"tags":["Jobs - Quotes"],"description":"Get totals for a quote. Fixed sections are always included. Optionally provide optional/multiselect section IDs to include in the totals.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selectedSectionIds":{"description":"[] — returns totals for fixed sections only. [1, 2, 3] — returns totals for fixed sections + the provided optional/multiselect section IDs.","type":"array","items":{"type":"integer"}}}}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"quoteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteTotalsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customerInvoices":{"get":{"tags":["Customer Invoices"],"description":"Returns a list of invoices. The list can be filtered by customer, job, invoice number, and due dates.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["id","createdAt","dueDate"],"errorMessage":"sortField must be `id`, `createdAt`, or `dueDate`, defaults to `createdAt`","anyOf":[{"type":"string","enum":["id"]},{"type":"string","enum":["createdAt"]},{"type":"string","enum":["dueDate"]}]},"in":"query","name":"sortField","required":false},{"schema":{"errorMessage":"customerId must be a number","type":"number"},"in":"query","name":"customerId","required":false,"description":"Filter by customer ID"},{"schema":{"errorMessage":"jobId must be a number","type":"number"},"in":"query","name":"jobId","required":false,"description":"Filter by job ID"},{"schema":{"errorMessage":"invoiceNumber must be a string","type":"string"},"in":"query","name":"invoiceNumber","required":false,"description":"Search by invoiceNumber"},{"schema":{"format":"date-time","errorMessage":"dueBefore must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"dueBefore","required":false,"description":"Filter invoices due before this datetime"},{"schema":{"format":"date-time","errorMessage":"dueAfter must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"dueAfter","required":false,"description":"Filter invoices due after this datetime"},{"schema":{"enum":["processing","succeeded","failed"],"errorMessage":"filterDirectDebitStatus must be `processing`, `succeeded`, or `failed`","anyOf":[{"type":"string","enum":["processing"]},{"type":"string","enum":["succeeded"]},{"type":"string","enum":["failed"]}]},"in":"query","name":"filterDirectDebitStatus","required":false,"description":"Filter by direct debit status"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCustomerInvoicesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customerInvoices/{invoiceId}":{"get":{"tags":["Customer Invoices"],"description":"Returns a single invoice by ID with customer details and sections","parameters":[{"schema":{"type":"number"},"in":"path","name":"invoiceId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomerInvoiceByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customers":{"get":{"tags":["Customers"],"description":"Returns a list of customers. The list can be filtered by customer name.<br/><br/>\n    A note about contact items on each person:<br>\n    <ul>\n      <li>The contact items are an array of objects. Each object has a `contactType` and a `contactValue`.\n      <li>The `contactType` can be one of the following: email, phone, mobile, or fax.\n      <li>The `contactValue` can be an email address or phone number.\n    </ul>\n    ","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["name","createdAt"],"errorMessage":"The sortField must be either `name` or `createdAt`, defaults to `createdAt`","anyOf":[{"type":"string","enum":["name"]},{"type":"string","enum":["createdAt"]}]},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `customerFullName`\n- `mainContact.firstName`\n- `mainContact.lastName`\n- `mainContact.contactItems[].contactValue`\n- `billingContact.firstName`\n- `billingContact.lastName`,\n- `billingContact.contactItems[].contactValue`"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomersResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Customers"],"description":"Creates a new customer.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["customerFullName","mainContact"],"properties":{"customerFullName":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The customerFullName must be at least 1 character long","pattern":"The customerFullName must not be empty"},"type":"string"},"mainContact":{"$ref":"#/components/schemas/PersonPayload"},"physicalAddress":{"$ref":"#/components/schemas/AddressPayload"},"postalAddress":{"$ref":"#/components/schemas/AddressPayload"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomerByIdResponse"}}}},"303":{"description":"Customer already exists, redirect to the existing customer","headers":{"Location":{"schema":{"type":"string"},"description":"Redirect location of existing customer"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedirectResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customers/{customerId}":{"get":{"tags":["Customers"],"description":"Returns a customer by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"customerId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomerByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Customers"],"description":"Update a customer.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["customerFullName","mainContact"],"properties":{"customerFullName":{"minLength":1,"pattern":"\\S","errorMessage":{"minLength":"The customerFullName must be at least 1 character long","pattern":"The customerFullName must not be empty"},"type":"string"},"mainContact":{"$ref":"#/components/schemas/PersonPayload"},"physicalAddress":{"$ref":"#/components/schemas/AddressPayload"},"postalAddress":{"$ref":"#/components/schemas/AddressPayload"}}}}},"required":true},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"customerId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCustomerByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Customers"],"description":"Deletes a customer by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"customerId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Customer deleted successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sites":{"get":{"tags":["Sites"],"description":"Returns a list of sites. The list can be filtered by site name, address city, and address postal code.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSiteName","required":false},{"schema":{"type":"string"},"in":"query","name":"filterAddressCity","required":false},{"schema":{"type":"string"},"in":"query","name":"filterAddressPostalCode","required":false},{"schema":{"default":"createdAt","enum":["name","createdAt"],"errorMessage":"The sortField must be either `name` or `createdAt`, defaults to `name`","anyOf":[{"type":"string","enum":["name"]},{"type":"string","enum":["createdAt"]}]},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `name`\n- `defaultContact.firstName`\n- `defaultContact.lastName`\n- `customer.customerFullName`\n- `billingContact.firstName`\n- `billingContact.lastName`\n- `physicalAddress.address1`\n- `physicalAddress.address2`\n"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Sites"],"description":"Create a new site","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["defaultContact","siteAddress"],"properties":{"name":{"type":"string"},"defaultContact":{"$ref":"#/components/schemas/PersonPayload"},"billingContact":{"$ref":"#/components/schemas/PersonPayload"},"siteAddress":{"$ref":"#/components/schemas/AddressPayload"},"postalAddress":{"$ref":"#/components/schemas/AddressPayload"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteByIdResponse"}}}},"303":{"description":"Site already exists, redirect to the existing site","headers":{"Location":{"schema":{"type":"string"},"description":"Redirect location of existing site"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedirectResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sites/{siteId}":{"get":{"tags":["Sites"],"description":"Returns a site by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"siteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Sites"],"description":"Update site","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["siteAddress"],"properties":{"name":{"type":"string"},"siteAddress":{"$ref":"#/components/schemas/AddressPayload"},"postalAddress":{"$ref":"#/components/schemas/AddressPayload"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteByIdResponse"}}}},"303":{"description":"Site already exists, redirect to the existing site","headers":{"Location":{"schema":{"type":"string"},"description":"Redirect location of existing site"}},"content":{"application/json":{"schema":{"type":"object","required":["result","message","location"],"properties":{"result":{"type":"string","enum":["Redirect"]},"message":{"type":"string"},"location":{"type":"string"}}}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sites/{siteId}/archive":{"post":{"tags":["Sites"],"description":"Archive Site.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string","default":"text/plain","pattern":"text/plain","errorMessage":"The Content-Type must be 'text/plain'"},"in":"header","name":"Content-Type","required":true}],"responses":{"204":{"description":"Site archived successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sites/{siteId}/restore":{"post":{"tags":["Sites"],"description":"Restore Site.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string","default":"text/plain","pattern":"text/plain","errorMessage":"The Content-Type must be 'text/plain'"},"in":"header","name":"Content-Type","required":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/contacts":{"get":{"tags":["Contacts"],"description":"Returns a list of contacts. The list can be filtered by contact type.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["firstName","lastName","createdAt"],"errorMessage":"The sortField must be either `firstName`, `lastName` or `createdAt`, defaults to `createdAt`","type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"enum":["CUSTOMER","SITE"],"errorMessage":"The filterContactType must be a valid contact type and must be one of the following: CUSTOMER, SITE","type":"string"},"in":"query","name":"filterContactType","required":false},{"schema":{"errorMessage":"The filterCustomerId must be a valid customer ID","type":"number"},"in":"query","name":"filterCustomerId","required":false},{"schema":{"errorMessage":"The filterSiteId must be a valid site ID","type":"number"},"in":"query","name":"filterSiteId","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `firstName`\n- `lastName`\n- `email`\n- `phoneNumber`\n"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Contacts"],"description":"Creates a new contact for a customer or site.\n\n  - **firstName** is required\n  - **email** is required and must be a valid email address. This will be added as a contact item.\n  - **contactType** is required and must be one of the following: `CUSTOMER`, `SITE`.\n    - When **contactType** is `CUSTOMER`:\n      - **customerId** is required\n      - **isMain** cannot be set to true and is optional. To update the main contact, use the '/customers' endpoint.\n      - **isBilling** is optional and defaults to false.\n    - When **contactType** is `SITE`:\n      - **siteId** is required\n      - **isMain** is optional and defaults to false.\n      - **isBilling** is optional and defaults to false.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactPayload"}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/contacts/{contactId}":{"get":{"tags":["Contacts"],"description":"Returns a contact by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"contactId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Contacts"],"description":"Updates a customer contact or site contact.\n\n  - **firstName** is required\n  - NOTE: To update the main contact of a `CUSTOMER`, please use the /customers endpoint.\n    - When the contact to update is of type `CUSTOMER`:\n      - **isMain** cannot be set to true and is optional. To update the main contact, use the '/customers' endpoint.\n      - **isBilling** is optional and defaults to false.\n  - NOTE: To unset the main contact of a `SITE` as non-main is not allowed, either use the create endpoint or update another contact of this site and set it as the main contact.\n    - When the contact to update is of type `SITE`:\n      - **isMain** is optional and defaults to false.\n      - **isBilling** is optional and defaults to false.\n      - If the contact to update is the main and billing contact of the `SITE`, the **isBilling** flag will have no impact and the contact details will be updated. If you want to change the contact that is assigned as the billing contact, please use the create method or update another contact of this site and set it as a billing contact.\n  - **contactItems** at least one contact item of type email is required. \n    - It will replace the existing contact items.\n    - To update a specific contact item, you have to provide the id of the contact item to update. Otherwise, new contact items will be added.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactPayload"}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"contactId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/enquiries":{"post":{"tags":["Enquiries"],"description":"Create Enquiry","requestBody":{"content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["name","email","phoneNumber","description","source"],"properties":{"name":{"type":"string"},"email":{"format":"email","type":"string"},"phoneNumber":{"type":"string"},"description":{"type":"string"},"source":{"type":"string"}}},{"type":"object","required":["address1"],"properties":{"address1":{"pattern":"\\S","errorMessage":{"pattern":"The address1 must not be empty"},"type":"string"},"address2":{"pattern":"\\S","errorMessage":{"pattern":"The address2 must not be empty"},"type":"string"},"addressSuburb":{"pattern":"\\S","errorMessage":{"pattern":"The addressSuburb must not be empty"},"type":"string"},"addressCity":{"pattern":"\\S","errorMessage":{"pattern":"The addressCity must not be empty"},"type":"string"},"addressRegion":{"pattern":"\\S","errorMessage":{"pattern":"The addressRegion must not be empty"},"type":"string"},"addressPostcode":{"pattern":"\\S","errorMessage":{"pattern":"The addressPostcode must not be empty"},"type":"string"},"addressCountry":{"pattern":"\\S","errorMessage":{"pattern":"The addressCountry must not be empty"},"type":"string"}}},{"type":"object","required":["addressCity"],"properties":{"addressCity":{"pattern":"\\S","errorMessage":{"pattern":"The addressCity must not be empty"},"type":"string"}}}]}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnquiryCreatedResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Enquiries"],"description":"Get all enquiries","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["createdAt"],"errorMessage":"The sortField must be `createdAt` (default value)","type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"enum":["TODO","CONTACTED","JOBCREATED","REJECTED"],"errorMessage":"The filterStatus must be either `TODO` (default value) or `CONTACTED` or `JOBCREATED` or `REJECTED`","type":"string"},"in":"query","name":"filterStatus","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSource","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `name`\n- `description`\n- `phone`\n- `email`"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnquiriesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/enquiries/{enquiryId}":{"get":{"tags":["Enquiries"],"description":"Returns enquiry by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"enquiryId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnquiryByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/phases/{jobPhaseId}/stockOnHand":{"get":{"tags":["Jobs - Phases"],"description":"Job Phase stock on hand","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"dateEntered","enum":["dateEntered","lastModified"],"errorMessage":"The sortField must be `dateEntered` (default) or `lastModified`","anyOf":[{"type":"string","enum":["dateEntered"]},{"type":"string","enum":["lastModified"]}]},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `itemDescription`"},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"lastModified","required":false},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"dateEntered","required":false},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobPhaseId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockOnHandListResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Jobs - Phases"],"description":"Add stock on hand to job phase. Two scenarios are supported:\n\n**With `priceBookLineItemId`:** Only `itemQuantity` is required. `itemDescription`, `itemPrice`, and `itemCost` will be populated from the price book item. No other fields may be passed.\n\n**Without `priceBookLineItemId`:** `itemDescription`, `itemPrice`, `itemCost`, and `itemQuantity` are all required.","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["itemQuantity","priceBookLineItemId"],"properties":{"itemQuantity":{"type":"number"},"priceBookLineItemId":{"type":"number"},"salesAccountId":{"type":"number"}}},{"type":"object","required":["itemDescription","itemPrice","itemCost","itemQuantity"],"properties":{"itemDescription":{"type":"string"},"itemPrice":{"type":"number"},"itemCost":{"type":"number"},"itemQuantity":{"type":"number"},"salesAccountId":{"type":"number"}}}]}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobPhaseId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockOnHandResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/phases/stockOnHand":{"get":{"tags":["Jobs - Phases"],"description":"Stock on hand across all Job Phases","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"dateEntered","enum":["dateEntered","lastModified"],"errorMessage":"The sortField must be `dateEntered` (default) or `lastModified`","anyOf":[{"type":"string","enum":["dateEntered"]},{"type":"string","enum":["lastModified"]}]},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `itemDescription`"},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"lastModified","required":false},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"dateEntered","required":false}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockOnHandListResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/phases/{jobPhaseId}/stockOnHand/{stockOnHandId}":{"patch":{"tags":["Jobs - Phases"],"description":"Update stock on hand on job phase","requestBody":{"content":{"application/json":{"schema":{"minProperties":1,"errorMessage":{"minProperties":"At least one field must be provided to update stock on hand"},"type":"object","properties":{"itemDescription":{"type":"string"},"itemPrice":{"type":"number"},"itemCost":{"type":"number"},"itemQuantity":{"type":"number"},"salesAccountId":{"type":"number"},"isLabour":{"type":"boolean"}}}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobPhaseId","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"stockOnHandId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockOnHandResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Jobs - Phases"],"description":"Delete stock on hand on job phase","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"jobPhaseId","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"stockOnHandId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Stock on hand deleted successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/stockUsed":{"get":{"tags":["Stock Used"],"description":"\n  Returns historical stock used across all jobs, optionally filtered by filterDateFrom.\n  \n  Stock used is defined as material line items that:\n  - Have been invoiced to the customer (sent or paid).\n  - And are assigned as materials sales account.\n  - And are not from purchase orders.\n  - And are not invoiced from suppliers.\n  ","parameters":[{"schema":{"format":"date","type":"string"},"in":"query","name":"filterDateFrom","required":false,"description":"Filter stock used on or after this date (yyyy-mm-dd) default is 90 days ago and max up to 180 days ago"},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockUsedListResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/users":{"get":{"tags":["Users"],"description":"Returns a list of users. The list can be filtered by first name, last name or email.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["firstName","lastName","createdAt"],"errorMessage":"The sortField must be either `firstName`, `lastName` or `createdAt`, defaults to `createdAt`","type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"enum":["contractor","time_sheet_only","field_worker","apprentice","tradesman","advisor","full_user"],"errorMessage":"The filterUserType must be a valid user type and must be one of the following: contractor, time_sheet_only, field_worker, apprentice, tradesman, advisor, full_user","type":"string"},"in":"query","name":"filterUserType","required":false},{"schema":{"enum":["active","disabled","invited"],"errorMessage":"The filterStatus must be a valid status and must be one of the following: active, disabled, invited","type":"string"},"in":"query","name":"filterStatus","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `firstName`\n- `lastName`\n- `employee's username`\n- `email`\n- `address.address1`\n- `address.address2`\n"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/users/me":{"get":{"tags":["Users"],"description":"Returns the current authenticated user.","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/users/{userId}":{"get":{"tags":["Users"],"description":"Returns a user by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"userId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Users"],"description":"Update user","requestBody":{"content":{"application/json":{"schema":{"minProperties":1,"errorMessage":{"minProperties":"At least one field must be provided for the update"},"type":"object","properties":{"firstName":{"pattern":"\\S","errorMessage":{"pattern":"The firstName must not be empty"},"type":"string"},"lastName":{"pattern":"\\S","errorMessage":{"pattern":"The lastName must not be empty"},"type":"string"},"address":{"$ref":"#/components/schemas/AddressPayload"},"payRate":{"minimum":0,"errorMessage":{"multipleOf":"The payRate must be number","minimum":"The payRate must be greater than 0"},"type":"number"},"chargeOutRate":{"minimum":0,"errorMessage":{"multipleOf":"The chargeOutRate must be number","minimum":"The chargeOutRate must be greater than 0"},"type":"number"},"contactItems":{"type":"array","items":{"type":"object","required":["contactType","contactValue"],"properties":{"id":{"type":"number"},"contactType":{"description":"The type of this contact item. It can be one of the following: phone, mobile, fax, other, website","enum":["phone","mobile","other","fax","website"],"errorMessage":{"enum":"The contactType must be a valid contact type and must be one of the following: phone, mobile, other, fax, website"},"type":"string"},"contactValue":{"description":"The value of this contact item.","pattern":"\\S","errorMessage":{"pattern":"The contactValue must not be empty"},"type":"string"}}}}}}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"userId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/timeEntries":{"get":{"tags":["Time Entries"],"description":"Get all time entries","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"timeEntryDate","enum":["timeEntryDate","jobNo","user"],"errorMessage":"The sortField must be either user, jobNo or timeEntryDate, defaults to 'createdAt'","type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"examples":{"John":{"value":"John"},"Smith":{"value":"Smith"},"John Smith":{"value":"John Smith"},"Installation":{"value":"Installation"},"Electrical work":{"value":"Electrical work"}},"in":"query","name":"filterSearchText","required":false,"description":"Searchable fields:\n- `user`\n- `employee's username`\n- `jobPhaseTitle`,\n- `jobPhaseDetails`"},{"schema":{"errorMessage":"The filterLockedOnly must be a boolean","type":"boolean"},"in":"query","name":"filterLockedOnly","required":false},{"schema":{"type":"number"},"example":123,"in":"query","name":"filterUserId","required":false,"description":"The user id to filter time entries by"},{"schema":{"type":"number"},"example":123,"in":"query","name":"filterJobNo","required":false,"description":"The job no to filter time entries by"},{"schema":{"type":"number"},"example":123,"in":"query","name":"filterJobPhaseId","required":false,"description":"The job phase id to filter time entries by"},{"schema":{"format":"date","errorMessage":"The filterDateFrom must be a valid date in 'yyyy-mm-dd' format","type":"string"},"example":"2023-01-21","in":"query","name":"filterDateFrom","required":false,"description":"The start date in yyyy-mm-dd format"},{"schema":{"format":"date","errorMessage":"The filterDateTo must be a valid date in 'yyyy-mm-dd' format","type":"string"},"example":"2023-01-21","in":"query","name":"filterDateTo","required":false,"description":"The end date in yyyy-mm-dd format"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntriesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/calendarEvents":{"get":{"tags":["Calendar Events"],"description":"Returns a list of CalendarEvents. The list can be filtered by user name, event type or active events only.","parameters":[{"schema":{"enum":["JOB_PHASE","QUOTE","ESTIMATE","OTHER"],"errorMessage":"The filterCalendarEventType must be a valid CalendarEvent type and must be one of the following: JOB_PHASE, QUOTE, ESTIMATE, OTHER","type":"string"},"in":"query","name":"filterCalendarEventType","required":false},{"schema":{"type":"number"},"in":"query","name":"filterUserId","required":false},{"schema":{"type":"number"},"in":"query","name":"filterJobId","required":false},{"schema":{"type":"number"},"in":"query","name":"filterJobPhaseId","required":false},{"schema":{"errorMessage":"The filterJobEventsOnly must be a boolean","type":"boolean"},"in":"query","name":"filterJobEventsOnly","required":false},{"schema":{"errorMessage":"The filterNonJobEventsOnly must be a boolean","type":"boolean"},"in":"query","name":"filterNonJobEventsOnly","required":false},{"schema":{"errorMessage":"The filterUnassignedEventsOnly must be a boolean","type":"boolean"},"in":"query","name":"filterUnassignedEventsOnly","required":false},{"schema":{"errorMessage":"The filterActiveOnly must be a boolean","type":"boolean"},"in":"query","name":"filterActiveOnly","required":false},{"schema":{"format":"date-time","default":"2026-07-03T00:00:00.000+12:00","errorMessage":"The filterDateFrom must be a valid date in ISO 8601 format","type":"string"},"examples":{"2025-12-02T00:00:00+13:00":{"value":"2025-12-02T00:00:00+13:00"},"2026-02-02T00:00:00Z":{"value":"2026-02-02T00:00:00Z"},"2026-02-02T00:00:00":{"value":"2026-02-02T00:00:00"}},"in":"query","name":"filterDateFrom","required":false,"description":"The start date for filtering calendar events, in ISO 8601 format. \n\n- The time portion is discarded only the date is used. \n\n- A timezone offset (+/-HH:MM or +/-HHMM) is expected to ensure accurate timezone interpretation. \n\n- If none is provided, the value will be treated as UTC."},{"schema":{"enum":["DAY","THREE_DAY","WEEK","FORTNIGHT","MONTH"],"errorMessage":"The filterCalendarRange must be a valid calendar range and must be one of the following: DAY, THREE_DAY, WEEK, FORTNIGHT, MONTH","type":"string"},"in":"query","name":"filterCalendarRange","required":false,"description":"The filterDateFrom (or currentDate if not provided) sets the start of the period.\n\n- For DAY and THREE_DAY options, it's that exact date.\n\n- For WEEK and MONTH options, it's the week or month that includes that date (weeks run Monday to Sunday).\n\n- For FORTNIGHT option, it starts at the Monday of the week that contains that date. \n\nThis defaults to WEEK if not provided."}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Calendar Events"],"description":"Creates a new calendar event.\n  - **eventType** must be one of : `JOB_PHASE`, `QUOTE`, `ESTIMATE`, `OTHER`.\n    - **JOB_PHASE**: Event type for a job phase. `jobPhaseId` must be provided.\n    - **QUOTE**: Event type for a quote. `jobId` must be provided.\n    - **ESTIMATE**: Event type for an estimate. `jobId` must be provided.\n    - **OTHER**: General event type. Default value.\n  - **frequency** must be one of : `DAILY`, `WEEKLY`, `MONTHLY`, `YEARLY`, `NEVER`.\n    - **DAILY**: Repeats every day.\n    - **WEEKLY**: Repeats every week.\n    - **MONTHLY**: Repeats every month.\n    - **YEARLY**: Repeats every year.\n    - **NEVER**: Does not repeat. Default value.\n  - If the event is recurring, **frequency** is ***not*** `NEVER`.\n    - **interval** controls how often the event repeats, \n      - Example:  `WEEKLY` with an `interval = 2`, the event repeats every 2 weeks.\n      - Default is `1`.\n    - **repeatEndType** must be one of:\n      - `NEVER`: Repeats indefinitely. Default value.\n      - `ON_DATE`: Repeats until the specified **repeatEndDate**.\n      - `AFTER`: Repeats for the specified **repeatCount** number of occurrences.\n    - If `repeatEndType = ON_DATE`, the **repeatEndDate** must be provided.\n    - If `repeatEndType = AFTER`, the **repeatCount** must be provided.\n  - If **userId** or **linkedUserIds** is provided, the event is assigned to those user(s). Otherwise, the event is unassigned. \n  ","requestBody":{"content":{"application/json":{"schema":{"calendarEventTypeValidation":true,"repeatEndTypeValidation":true,"type":"object","required":["startTime","endTime","eventTitle","eventType"],"properties":{"userId":{"type":"number"},"linkedUserIds":{"type":"array","items":{"type":"number"}},"startTime":{"format":"date-time","errorMessage":"The startTime must be a valid ISO 8601 date format in UTC","type":"string","example":"2021-01-01T07:00:00.000Z"},"endTime":{"format":"date-time","errorMessage":"The endTime must be a valid ISO 8601 date format in UTC","type":"string","example":"2021-01-01T17:00:00.000Z"},"jobId":{"type":"number"},"jobPhaseId":{"type":"number"},"eventTitle":{"minLength":1,"type":"string"},"eventType":{"enum":["JOB_PHASE","QUOTE","ESTIMATE","OTHER"],"errorMessage":"The eventType must be one of: JOB_PHASE, QUOTE, ESTIMATE, OTHER","type":"string"},"description":{"minLength":1,"type":"string"},"frequency":{"default":"NEVER","enum":["DAILY","WEEKLY","MONTHLY","YEARLY","NEVER"],"errorMessage":"The frequency must be a valid frequency and must be one of the following: DAILY, WEEKLY, MONTHLY, YEARLY, NEVER","type":"string"},"interval":{"type":"number"},"repeatEndType":{"enum":["NEVER","ON_DATE","AFTER"],"default":"NEVER","errorMessage":"The repeatEndType must be a valid repeat end type and must be one of the following: NEVER, ON_DATE, AFTER","type":"string"},"repeatEndDate":{"anyOf":[{"format":"date","errorMessage":"The repeatEndDate must be a valid date in 'YYYY-MM-DD' format","examples":["2021-01-01","2021-01-02","2021-01-03"],"type":"string"},{"type":"null"}]},"repeatCount":{"type":"number"}}}}},"required":true},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/calendarEvents/{calendarEventId}":{"get":{"tags":["Calendar Events"],"description":"Returns a CalendarEvent by ID.","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"calendarEventId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Calendar Events"],"description":"Updates a calendar event.\n  - To set the event to update to recurring, **frequency** must be set to a value other than `NEVER`.\n    - **interval** controls how often the event repeats, \n      - Example:  `WEEKLY` with an `interval = 2`, the event repeats every 2 weeks.\n      - Default is `1`.\n    - **repeatEndType** must be one of:\n      - `NEVER`: Repeats indefinitely. Default value.\n      - `ON_DATE`: Repeats until the specified **repeatEndDate**.\n      - `AFTER`: Repeats for the specified **repeatCount** number of occurrences.\n    - If `repeatEndType = ON_DATE`, the **repeatEndDate** must be provided.\n    - If `repeatEndType = AFTER`, the **repeatCount** must be provided.\n  - If the event to update is recurring, **updateAllRecurring** must be specified:\n    - If **updateAllRecurring** is true, all future occurrences of the current event are updated.\n    - If **updateAllRecurring** is false, only the current event is updated and future occurrences are not updated. \n      - An optional **repeatSplitOnDate** can be provided and the event is only updated on the specified date and future occurrences are not updated.\n      - if the **repeatSplitOnDate** is not provided, this is set to the event's **startTime** value.\n  - If the event to update is assigned to a group, **updateAllGrouped** must be specified:\n    - If **updateAllGrouped** is true, all events in the group are updated otherwise only the current event is updated.\n  - To assign the event to update, **userId** or **linkedUserIds** can be provided, and the event is assigned to those user(s). Otherwise, the event is unassigned.\n    - When assigning to a group, i.e. the **linkedUserIds** is provided, the **updateAllGrouped** property must be set to true.\n  ","requestBody":{"content":{"application/json":{"schema":{"calendarEventTypeValidation":true,"repeatEndTypeValidation":true,"type":"object","required":["startTime","endTime","eventTitle"],"properties":{"startTime":{"format":"date-time","errorMessage":"The startTime must be a valid ISO 8601 date format in UTC","type":"string","example":"2021-01-01T07:00:00.000Z"},"endTime":{"format":"date-time","errorMessage":"The endTime must be a valid ISO 8601 date format in UTC","type":"string","example":"2021-01-01T17:00:00.000Z"},"eventTitle":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"userId":{"type":"number"},"linkedUserIds":{"type":"array","items":{"type":"number"}},"frequency":{"default":"NEVER","enum":["DAILY","WEEKLY","MONTHLY","YEARLY","NEVER"],"errorMessage":"The frequency must be a valid frequency and must be one of the following: DAILY, WEEKLY, MONTHLY, YEARLY, NEVER","type":"string"},"interval":{"type":"number"},"repeatEndType":{"enum":["NEVER","ON_DATE","AFTER"],"default":"NEVER","errorMessage":"The repeatEndType must be a valid repeat end type and must be one of the following: NEVER, ON_DATE, AFTER","type":"string"},"repeatEndDate":{"anyOf":[{"format":"date","errorMessage":"The repeatEndDate must be a valid date in 'YYYY-MM-DD' format","examples":["2021-01-01","2021-01-02","2021-01-03"],"type":"string"},{"type":"null"}]},"repeatCount":{"type":"number"},"repeatSplitOnDate":{"anyOf":[{"format":"date-time","errorMessage":"The splitDate must be a valid ISO 8601 date format in UTC","examples":["2021-01-01T07:00:00.000Z","2021-01-01T07:15:00.000Z","2021-01-01T07:30:00.000Z"],"type":"string"},{"type":"null"}]},"updateAllRecurring":{"anyOf":[{"enum":["TRUE","FALSE"],"errorMessage":"The updateAllRecurring must be a valid boolean and must be one of the following: TRUE, FALSE","type":"string"},{"type":"null"}]},"updateAllGrouped":{"anyOf":[{"enum":["TRUE","FALSE"],"errorMessage":"The updateAllGrouped must be a valid boolean and must be one of the following: TRUE, FALSE","type":"string"},{"type":"null"}]}}}}},"required":true},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"calendarEventId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Calendar Events"],"description":"Deletes a calendar event.\n  - If the event to delete is recurring, **deleteAllRecurring** must be specified:\n    - If **deleteAllRecurring** is true, all future occurrences of the event are deleted\n    - If **deleteAllRecurring** is false, an optional **deleteOnDate** can be provided.\n      - if **deleteOnDate** is provided, the event is split and the event is only deleted on the specified date and previous or future events are not deleted.\n      - if the **deleteOnDate** is not provided, this is set to the event's **startTime** value.\n  - If the event to delete is assigned to a group, **deleteAllGrouped** must be specified:\n    - If **deleteAllGrouped** is true, all events in the group are deleted otherwise only the current event is deleted.\n  ","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleteOnDate":{"anyOf":[{"format":"date-time","errorMessage":"The splitDate must be a valid ISO 8601 date format in UTC","examples":["2021-01-01T07:00:00.000Z","2021-01-01T07:15:00.000Z","2021-01-01T07:30:00.000Z"],"type":"string"},{"type":"null"}]},"deleteAllRecurring":{"anyOf":[{"enum":["TRUE","FALSE"],"errorMessage":"The updateAllRecurring must be a valid boolean and must be one of the following: TRUE, FALSE","type":"string"},{"type":"null"}]},"deleteAllGrouped":{"anyOf":[{"enum":["TRUE","FALSE"],"errorMessage":"The updateAllGrouped must be a valid boolean and must be one of the following: TRUE, FALSE","type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"calendarEventId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Calendar event deleted successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricingTiers":{"get":{"tags":["Pricing Tiers"],"description":"Schema for a Pricing Tier","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["createdAt"],"errorMessage":"The sortField must be `createdAt`, defaults to `createdAt`","type":"string"},"in":"query","name":"sortField","required":false}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPricingTiersResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricingTiers/{id}":{"get":{"tags":["Pricing Tiers"],"description":"Schema for a Pricing Tier by ID","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"id","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPricingTierByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricebooks/search":{"post":{"tags":["Pricebooks"],"description":"Search for pricebook items across multiple pricebooks\n\nThis endpoint allows you to search for products/items across one or more supplier pricebooks using a text-based search query. The search is performed across item names, product codes, and search values.\n\n**Search Behavior:**\n- Searches match when the search term appears anywhere within searchable fields (substring matching)\n- Results are ranked by relevance (exact matches and word-start matches ranked higher)\n- Pagination uses cursor-based navigation with encoded ranking information\n\n**allSuppliers**\n\nWhen `allSuppliers` is provided and set to `true`, it will override the list of `supplierIds` array.\n\nFor example the below payload will search across all suppliers for the term \"hammer\" and apply the pricing tier with id 123:\n\n```\n{\n  \"search\": \"hammer\",\n  \"pricingTierId\": 123,\n  \"allSuppliers\": true,\n  \"supplierIds\": [\n    101,\n    102,\n    103\n  ]\n}\n```\n\nTo narrow search by specific suppliers, set `allSuppliers` to `false` and provide a list of supplier IDs:\n\n```\n{\n  \"search\": \"hammer\",\n  \"pricingTierId\": 123,\n  \"allSuppliers\": false,\n  \"supplierIds\": [\n    101,\n    102,\n    103\n  ]\n}\n```\n\n","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceBookSearch"}}}},"parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPricebooksResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricebooks":{"get":{"tags":["Pricebooks"],"description":"Schema for Pricebooks","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["createdAt"],"errorMessage":"The sortField must be `createdAt`","type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"type":"string"},"in":"query","name":"filterSupplierName","required":false,"description":"Filter pricebooks by supplier name containing this string"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPricebooksResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricebooks/{id}":{"get":{"tags":["Pricebooks"],"description":"Schema for a Pricebook by ID","parameters":[{"schema":{"minimum":1,"type":"number"},"in":"path","name":"id","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPriceBookByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricebooks/{id}/pricebookItems":{"get":{"tags":["Pricebooks"],"description":"Schema for Pricebook Items","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"id","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPricebookItemsResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/pricebooks/{id}/pricebookItems/{pricebookItemId}":{"get":{"tags":["Pricebooks"],"description":"Schema for a Pricebook Item by ID","parameters":[{"schema":{"type":"number"},"in":"query","name":"filterPricingTierId","required":false},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"id","required":true},{"schema":{"minimum":1,"type":"number"},"in":"path","name":"pricebookItemId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPricebookItemByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/notes":{"get":{"tags":["Notes"],"description":"Schema for Notes","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"created_at","enum":["created_at"],"type":"string"},"in":"query","name":"sortField","required":false},{"schema":{"type":"number"},"example":123,"in":"query","name":"filterEntityId","required":false,"description":"The entity id to filter notes by"},{"schema":{"enum":["JOB","CUSTOMER","CUSTOMER_INVOICE","QUOTE","SITE","TASK","ENQUIRY","JOB_PHASE"],"errorMessage":"The filterEntityName must be a valid NoteEntityType and must be one of the following: JOB, CUSTOMER, CUSTOMER_INVOICE, QUOTE, SITE, TASK, ENQUIRY, JOB_PHASE","type":"string"},"in":"query","name":"filterEntityName","required":false},{"schema":{"type":"number"},"example":456,"in":"query","name":"filterCreatedById","required":false,"description":"The user id who created the notes to filter by"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetNotesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Notes"],"description":"Creates a new note on an entity (job, customer, quote, etc.).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotePayload"}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/notes/{noteId}":{"patch":{"tags":["Notes"],"description":"Updates the text and/or pinned status of an existing note.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotePayload"}}}},"parameters":[{"schema":{"type":"number"},"in":"path","name":"noteId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNoteResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/company":{"get":{"tags":["Company"],"description":"Returns company information for the authenticated company.","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCompanyResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tasks":{"get":{"tags":["Tasks"],"description":"List all tasks for the company with optional filters","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"default":"createdAt","enum":["createdAt","dueDate"],"anyOf":[{"type":"string","enum":["createdAt"]},{"type":"string","enum":["dueDate"]}]},"in":"query","name":"sortField","required":false},{"schema":{"enum":["pending","completed"],"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["completed"]}]},"in":"query","name":"filterStatus","required":false,"description":"Filter by task status"},{"schema":{"type":"number"},"example":20,"in":"query","name":"filterEmployeeId","required":false,"description":"Filter tasks assigned to this employee ID"},{"schema":{"type":"number"},"example":123,"in":"query","name":"filterJobId","required":false,"description":"Filter tasks linked to this job ID"},{"schema":{"format":"date","errorMessage":"filterDueDateFrom must be a valid date in 'yyyy-mm-dd' format","type":"string"},"example":"2025-01-01","in":"query","name":"filterDueDateFrom","required":false,"description":"Filter tasks with due date on or after this date (yyyy-mm-dd)"},{"schema":{"format":"date","errorMessage":"filterDueDateTo must be a valid date in 'yyyy-mm-dd' format","type":"string"},"example":"2025-12-31","in":"query","name":"filterDueDateTo","required":false,"description":"Filter tasks with due date on or before this date (yyyy-mm-dd)"},{"schema":{"type":"boolean"},"in":"query","name":"filterOverdue","required":false,"description":"Filter to tasks that are past their due date and not completed"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTasksResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Tasks"],"description":"Create a new task","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskPayload"}}}},"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Resource created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tasks/{taskId}":{"get":{"tags":["Tasks"],"description":"Get a single task by ID","parameters":[{"schema":{"type":"number"},"in":"path","name":"taskId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTaskByIdResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Tasks"],"description":"Update a task's description, due date, or assigned employees. Job linkage cannot be changed.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskPayload"}}}},"parameters":[{"schema":{"type":"number"},"in":"path","name":"taskId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Tasks"],"description":"Soft-delete a task","parameters":[{"schema":{"type":"number"},"in":"path","name":"taskId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"Task deleted successfully"},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tasks/{taskId}/complete":{"post":{"tags":["Tasks"],"description":"Mark a task as complete","parameters":[{"schema":{"type":"number"},"in":"path","name":"taskId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteTaskResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tasks/{taskId}/reopen":{"post":{"tags":["Tasks"],"description":"Reopen a completed task","parameters":[{"schema":{"type":"number"},"in":"path","name":"taskId","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenTaskResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/attachments":{"post":{"tags":["Files"],"description":"Upload a file and attach it to an entity in a single atomic operation. Send as multipart/form-data with `file`, `entityType`, and `entityId` fields. Maximum file size: 20 MB.","security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string"},"data":{"$ref":"#/components/schemas/File"}}}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Files"],"description":"List files associated with an entity.","parameters":[{"schema":{"default":10,"errorMessage":"The pageSize must be an integer between 1 and 100","minimum":1,"maximum":100,"type":"number"},"in":"query","name":"pageSize","required":false},{"schema":{"default":"asc","enum":["asc","desc"],"errorMessage":"The sortOrder must be either `asc` or `desc`, defaults to `asc`","anyOf":[{"type":"string","enum":["asc"]},{"type":"string","enum":["desc"]}]},"in":"query","name":"sortOrder","required":false},{"schema":{"default":"0","errorMessage":"The pageCursor must be a string","type":"string"},"in":"query","name":"pageCursor","required":false},{"schema":{"enum":["customer","job","site","enquiry","job_phase"],"type":"string"},"in":"query","name":"entityType","required":true,"description":"Entity type to list attachments for"},{"schema":{"type":"number"},"in":"query","name":"entityId","required":true,"description":"Entity ID to list attachments for"},{"schema":{"type":"string"},"example":"invoice","in":"query","name":"search","required":false,"description":"Search by file name (partial match)"},{"schema":{"type":"string"},"example":"application/pdf","in":"query","name":"filterMimeType","required":false,"description":"Filter by exact MIME type"},{"schema":{"format":"date-time","errorMessage":"filterCreatedAfter must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"filterCreatedAfter","required":false,"description":"Filter files created after this date-time (ISO 8601)"},{"schema":{"format":"date-time","errorMessage":"filterCreatedBefore must be a valid ISO 8601 date-time","type":"string"},"in":"query","name":"filterCreatedBefore","required":false,"description":"Filter files created before this date-time (ISO 8601)"},{"schema":{"type":"number"},"example":42,"in":"query","name":"filterCreatedById","required":false,"description":"Filter by the user ID who uploaded the file"}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFilesResponse"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/attachments/{id}/download":{"get":{"tags":["Files"],"description":"Redirect to a time-limited signed URL for downloading an attachment. Returns HTTP 302 with a `Location` header pointing at a short-lived S3 URL. The URL expires after a short period and must not be cached.","parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"302":{"description":"Redirect to signed download URL","content":{"application/json":{"schema":{"description":"Redirect to signed download URL"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/attachments/{id}":{"delete":{"tags":["Files"],"description":"Delete a file.","parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"security":[{"oauth2":[]},{"PersonalAccessToken":[]}],"responses":{"204":{"description":"File deleted successfully","content":{"application/json":{"schema":{"description":"File deleted successfully"}}}},"4XX":{"description":"Client Request Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"Server Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"servers":[{"url":"https://api.fergus.com"}],"tags":[{"name":"Favourites","description":"Endpoints for managing favourites"},{"name":"Jobs","description":"Endpoints for managing jobs"},{"name":"Jobs - Quotes","description":"Endpoints for accessing quotes across all jobs (standalone quote operations)"},{"name":"Jobs - Phases","description":"Endpoints for accessing phases across all jobs"},{"name":"Customer Invoices","description":"Endpoints for managing invoices"},{"name":"Customers","description":"Endpoints for managing customers"},{"name":"Sites","description":"Endpoints for managing sites"},{"name":"Contacts","description":"Endpoints for managing contacts of customers and sites"},{"name":"Users","description":"Endpoints for managing users"},{"name":"Enquiries","description":"Endpoints for managing enquiries"},{"name":"Time Entries","description":"Endpoints for managing time entries"},{"name":"Calendar Events","description":"Endpoints for managing calendar events"},{"name":"Pricebooks","description":"Endpoints for managing pricebooks"},{"name":"Pricing Tiers","description":"Endpoints for managing pricing tiers"},{"name":"Notes","description":"Endpoints for managing notes and replies. Note: Notes with replies will include their replies in the response in a nested structure."},{"name":"Company","description":"Endpoints for managing companies"},{"name":"Tasks","description":"Endpoints for managing tasks"},{"name":"Stock Used","description":"Endpoints for managing stock used"},{"name":"Server","description":"Application related endpoints"}]}