openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: jobs description: Customer job requests and dispatch state - name: partners description: Trade partner onboarding and availability - name: admin description: Admin dashboard summaries paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /pricing/preview: post: operationId: previewPricing tags: [jobs] summary: Preview controlled pricing from contact-free job details requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PricingPreviewInput" responses: "200": description: Controlled Melbourne pilot pricing preview content: application/json: schema: $ref: "#/components/schemas/PricingSnapshot" "400": description: Only description and trade are accepted /jobs: get: operationId: listJobs tags: [jobs] summary: List job requests (admin only) security: - bearerAuth: [] responses: "200": description: Job requests content: application/json: schema: type: array items: $ref: "#/components/schemas/Job" "401": description: Authentication required "403": description: Forbidden post: operationId: createJob tags: [jobs] summary: Create a customer job request requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JobInput" responses: "201": description: Request received content: application/json: schema: $ref: "#/components/schemas/CreateJobResponse" /jobs/{id}: get: operationId: getJob tags: [jobs] summary: Get public status for a job using access token parameters: - $ref: "#/components/parameters/Id" - $ref: "#/components/parameters/JobStatusToken" responses: "200": description: Public job status content: application/json: schema: $ref: "#/components/schemas/PublicJobStatus" "401": description: Missing or invalid token "404": description: Job not found patch: operationId: updateJob tags: [jobs] summary: Update a job status (admin only) security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JobUpdate" responses: "200": description: Updated job request content: application/json: schema: $ref: "#/components/schemas/Job" "401": description: Authentication required "403": description: Forbidden /jobs/{id}/intake: patch: operationId: correctJobIntake tags: [jobs] summary: Correct customer-confirmed job details parameters: - $ref: "#/components/parameters/Id" - $ref: "#/components/parameters/JobStatusToken" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JobIntakeCorrection" responses: "200": description: Corrected request status and current intake content: application/json: schema: $ref: "#/components/schemas/PublicJobStatus" "401": description: Missing or invalid token "404": description: Job not found /jobs/{id}/photos: post: operationId: uploadJobPhotos tags: [jobs] summary: Upload customer job photos using the issued job status token parameters: - $ref: "#/components/parameters/Id" - $ref: "#/components/parameters/JobStatusToken" requestBody: required: true content: multipart/form-data: schema: type: object required: [photos] properties: photos: type: array maxItems: 3 items: { type: string } responses: "201": description: Photos safely processed and stored content: application/json: schema: type: object required: [photos] properties: photos: type: array items: { $ref: "#/components/schemas/JobPhoto" } "400": description: Invalid photo count, size, type, signature or dimensions "401": description: Valid job status token required "404": description: Job not found /jobs/{id}/confirm-dispatch: post: operationId: confirmDispatch tags: [jobs] summary: Customer confirms the accepted tradie price and ETA parameters: - $ref: "#/components/parameters/Id" - $ref: "#/components/parameters/JobStatusToken" responses: "200": description: Customer-confirmed dispatch status content: application/json: schema: $ref: "#/components/schemas/PublicJobStatus" "401": description: Missing or invalid token "404": description: Job not found "409": description: Job is not ready for customer confirmation /jobs/{id}/serviceability: post: operationId: runServiceabilityCheck tags: [jobs] summary: >- Run the serviceability gate for a job (trade/coverage check). Must return "serviceable" before a paid checkout session can be started. Never charges anything. parameters: - $ref: "#/components/parameters/Id" responses: "200": description: Serviceability outcome content: application/json: schema: $ref: "#/components/schemas/ServiceabilityCheckResult" "404": description: Job not found /jobs/{id}/checkout: post: operationId: startCheckout tags: [jobs] summary: >- Create a Stripe Embedded Checkout session for the $29.99 sourcing fee -- returns a client_secret for the frontend to mount in-page. Only allowed once the job has been marked serviceable or manual_review. Payment is only ever confirmed by the Stripe webhook, never by this response or the return_url redirect. parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CheckoutInput" responses: "200": description: Checkout session created content: application/json: schema: $ref: "#/components/schemas/CheckoutSession" "400": description: Invalid checkout request "404": description: Job not found "409": description: Job is not serviceable or Stripe is not configured /jobs/{id}/approve-match: post: operationId: approveMatch tags: [jobs] summary: >- Customer approves the manually-sourced tradie match. Only after this call is the exact address/contact ever released to the matched provider. parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ApproveMatchInput" responses: "200": description: Match approved content: application/json: schema: $ref: "#/components/schemas/OkResponse" "404": description: Job not found or token invalid "409": description: Job is not awaiting match approval /admin/paid-jobs: get: operationId: listPaidJobs tags: [admin] summary: >- List every job that has entered the paid AI-dispatch flow (admin only) so an operator can manually source, match, or refund. security: - bearerAuth: [] responses: "200": description: Paid jobs content: application/json: schema: type: array items: $ref: "#/components/schemas/PaidJob" "401": description: Authentication required "403": description: Admin access required /admin/jobs/{id}/manual-match: post: operationId: recordManualMatch tags: [admin] summary: >- Operator manually enters a sourced tradie match (no automated outreach). Moves the job to match_ready for customer approval. security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ManualMatchInput" responses: "200": description: Match recorded content: application/json: schema: $ref: "#/components/schemas/OkResponse" "401": description: Authentication required "403": description: Admin access required "404": description: Job not found "409": description: Job is not in a sourcing state /admin/jobs/{id}/mark-sourcing-failed: post: operationId: markSourcingFailed tags: [admin] summary: >- Operator marks sourcing as failed. Triggers an automatic TEST-mode Stripe refund of the sourcing fee. security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" responses: "200": description: Sourcing marked failed and refund initiated content: application/json: schema: $ref: "#/components/schemas/MarkSourcingFailedResult" "401": description: Authentication required "403": description: Admin access required "404": description: Job not found "409": description: Job is not in a sourcing state /admin/jobs/{id}/mark-completed: post: operationId: markJobCompleted tags: [admin] summary: Operator marks an approved paid job as completed security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" responses: "200": description: Job marked completed content: application/json: schema: $ref: "#/components/schemas/OkResponse" "401": description: Authentication required "403": description: Admin access required "404": description: Job not found "409": description: Job is not approved /partners: get: operationId: listPartners tags: [partners] summary: List trade partners (admin gets all; partner gets self) security: - bearerAuth: [] responses: "200": description: Trade partners content: application/json: schema: type: array items: $ref: "#/components/schemas/Partner" "401": description: Authentication required "403": description: Forbidden post: operationId: createPartner tags: [partners] summary: Submit a trade partner application requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PartnerInput" responses: "201": description: Application submitted content: application/json: schema: $ref: "#/components/schemas/PartnerApplicationReceipt" "200": description: Previously submitted application safely acknowledged content: application/json: schema: $ref: "#/components/schemas/PartnerApplicationReceipt" /admin/partner-applications: get: operationId: listPendingPartnerApplications tags: [admin] summary: List pending partner applications for admin review security: - bearerAuth: [] responses: "200": description: Pending partner applications content: application/json: schema: type: array items: $ref: "#/components/schemas/PartnerApplication" "401": description: Authentication required "403": description: Admin access required /partner-funnel/events: post: operationId: recordPartnerFunnelEvent tags: [partners] summary: Record a privacy-conscious partner acquisition funnel event requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PartnerFunnelEventInput" responses: "204": description: Event accepted "400": description: Invalid event /partners/{id}/availability: patch: operationId: updatePartnerAvailability tags: [partners] summary: Update trade partner availability security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AvailabilityInput" responses: "200": description: Updated partner content: application/json: schema: $ref: "#/components/schemas/Partner" "401": description: Authentication required "403": description: Forbidden /dispatches/{id}/decision: patch: operationId: decideDispatch tags: [jobs] summary: Accept or decline a dispatched opportunity security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DispatchDecisionInput" responses: "200": description: Updated dispatch content: application/json: schema: $ref: "#/components/schemas/Dispatch" "401": description: Authentication required "403": description: Forbidden /admin/partner-acquisition-summary: get: operationId: getPartnerAcquisitionSummary tags: [admin] summary: >- Admin-only, read-only partner acquisition funnel summary (page views, application starts, submissions, and conversion rates) broken down by UTM source, medium, and campaign security: - bearerAuth: [] responses: "200": description: Partner acquisition funnel summary content: application/json: schema: $ref: "#/components/schemas/PartnerAcquisitionSummary" "401": description: Authentication required "403": description: Admin access required /admin/summary: get: operationId: getAdminSummary tags: [admin] summary: Get admin dashboard summary security: - bearerAuth: [] responses: "200": description: Admin dashboard summary content: application/json: schema: $ref: "#/components/schemas/AdminSummary" "401": description: Authentication required "403": description: Forbidden /admin/jobs-awaiting-dispatch: get: operationId: listJobsAwaitingDispatch tags: [admin] summary: List jobs awaiting dispatch security: - bearerAuth: [] responses: "200": description: Jobs awaiting dispatch content: application/json: schema: type: array items: $ref: "#/components/schemas/Job" /admin/jobs/{id}/partner-recommendations: get: operationId: getPartnerRecommendations tags: [admin] summary: List deterministic partner recommendations without creating offers security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" responses: "200": description: Ranked partner recommendations content: application/json: schema: type: array items: $ref: "#/components/schemas/PartnerRecommendation" /admin/approved-partners: get: operationId: listApprovedPartners tags: [admin] summary: List approved partners eligible for dispatch security: - bearerAuth: [] parameters: - name: trade in: query schema: { type: string } responses: "200": description: Approved partners content: application/json: schema: type: array items: $ref: "#/components/schemas/Partner" /admin/dispatch-offers: get: operationId: listDispatchOffers tags: [admin] summary: List dispatch offer history security: - bearerAuth: [] responses: "200": description: Dispatch offers content: application/json: schema: type: array items: $ref: "#/components/schemas/DispatchOffer" post: operationId: createDispatchOffer tags: [admin] summary: Create a dispatch offer security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DispatchOfferInput" responses: "201": description: Dispatch offer created content: application/json: schema: $ref: "#/components/schemas/DispatchOffer" /partner/offers: get: operationId: listPartnerOffers tags: [partners] summary: List offers for the authenticated partner security: - bearerAuth: [] responses: "200": description: Partner opportunities content: application/json: schema: type: array items: $ref: "#/components/schemas/PartnerOffer" /admin/dispatch-offers/{id}/expire: patch: operationId: expireDispatchOffer tags: [admin] summary: Expire a pending dispatch offer security: - bearerAuth: [] parameters: - $ref: "#/components/parameters/Id" responses: "200": description: Expired dispatch offer content: application/json: schema: $ref: "#/components/schemas/Dispatch" /partner/offers/{offerId}/photos/{photoId}: get: operationId: getPartnerOfferPhoto tags: [partners] summary: Fetch a private job photo for an authorized offer security: - bearerAuth: [] parameters: - name: offerId in: path required: true schema: { type: number, minimum: 1 } - name: photoId in: path required: true schema: { type: number, minimum: 1 } responses: "200": description: Sanitized job photo content: image/webp: schema: { type: string } "401": description: Authentication required "404": description: Photo not found or not authorized components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT parameters: Id: name: id in: path required: true schema: type: number JobStatusToken: name: token in: query required: true schema: type: string minLength: 16 schemas: HealthStatus: type: object properties: status: type: string required: - status Job: type: object required: [ id, reference, description, trade, suburb, postcode, urgency, preferredTime, status, createdAt, assessment, expectedPrice, ] properties: id: { type: number } reference: { type: string } description: { type: string } trade: { type: string } suburb: { type: string } postcode: { type: string } urgency: { type: string } preferredTime: { type: string } status: { type: string } customerName: { type: string } customerPhone: { type: ["string", "null"] } customerEmail: { type: ["string", "null"] } createdAt: { type: string } assessment: anyOf: - $ref: "#/components/schemas/JobAssessment" - type: "null" expectedPrice: anyOf: - $ref: "#/components/schemas/PricingSnapshot" - type: "null" CreateJobResponse: type: object required: [id, reference, status, createdAt, statusAccessToken, statusAccessUrl] properties: id: { type: number } reference: { type: string } status: { type: string } createdAt: { type: string } statusAccessToken: { type: string } statusAccessUrl: { type: string } PublicJobStatus: type: object required: [ reference, status, createdAt, updatedAt, intake, expectedPrice, acceptedTradie, paidFlowState, paidMatch, ] properties: reference: { type: string } status: { type: string } createdAt: { type: string } updatedAt: { type: string } intake: $ref: "#/components/schemas/CustomerConfirmedIntake" assessment: anyOf: - $ref: "#/components/schemas/JobAssessment" - type: "null" expectedPrice: anyOf: - $ref: "#/components/schemas/PricingSnapshot" - type: "null" acceptedTradie: anyOf: - $ref: "#/components/schemas/AcceptedTradie" - type: "null" paidFlowState: $ref: "#/components/schemas/PaidFlowState" paidMatch: anyOf: - $ref: "#/components/schemas/PaidMatch" - type: "null" JobInput: type: object required: [ description, trade, suburb, postcode, urgency, preferredTime, customerName, serviceAddressLine1, ] properties: description: { type: string, minLength: 4 } trade: { type: string } suburb: { type: string } postcode: { type: string } urgency: { type: string } preferredTime: { type: string } customerName: { type: string } customerPhone: { type: string } customerEmail: { type: string } serviceAddressLine1: { type: string, minLength: 3 } serviceAddressLine2: { type: string } PricingPreviewInput: type: object additionalProperties: false required: [description, trade] properties: description: { type: string, minLength: 4, maxLength: 4000 } trade: { type: string, minLength: 1, maxLength: 120 } PricingSnapshot: type: object required: [code, version, kind, minCents, maxCents, customerLabel, scope] properties: code: { type: string } version: { type: string } kind: { type: string, enum: [total, diagnostic] } minCents: { type: number, minimum: 1 } maxCents: { type: number, minimum: 1 } customerLabel: { type: string } scope: { type: string } JobUpdate: type: object properties: status: { type: string } JobIntakeCorrection: type: object required: [ description, trade, suburb, postcode, urgency, preferredTime, customerName, serviceAddressLine1, ] properties: description: { type: string, minLength: 4 } trade: { type: string, minLength: 1 } suburb: { type: string, minLength: 1 } postcode: { type: string, minLength: 1 } urgency: { type: string, minLength: 1 } preferredTime: { type: string, minLength: 1 } customerName: { type: string, minLength: 1 } customerPhone: { type: string } customerEmail: { type: string } serviceAddressLine1: { type: string, minLength: 3 } serviceAddressLine2: { type: string } CustomerConfirmedIntake: type: object required: [ description, trade, suburb, postcode, urgency, preferredTime, customerName, serviceAddressLine1, ] properties: description: { type: string } trade: { type: string } suburb: { type: string } postcode: { type: string } urgency: { type: string } preferredTime: { type: string } customerName: { type: string } customerPhone: { type: ["string", "null"] } customerEmail: { type: ["string", "null"] } serviceAddressLine1: { type: string } serviceAddressLine2: { type: ["string", "null"] } JobAssessment: type: object required: [outcome, provider, model, safetyCodes, assessment, createdAt] properties: outcome: { type: string } provider: { type: string } model: { type: ["string", "null"] } safetyCodes: type: array items: { type: string } assessment: $ref: "#/components/schemas/JobIntakeAssessmentDraft" createdAt: { type: string } TradeClassification: type: string enum: [plumbing, electrical, heating_cooling, unsure] UrgencyClassification: type: string enum: [not_urgent, soon, today, emergency, unsure] PhotoContext: type: object additionalProperties: false required: [provided, count] properties: provided: { type: boolean } count: { type: number, minimum: 0 } JobIntakeAssessmentDraft: type: object additionalProperties: false required: - tradeClassification - urgencyClassification - suburb - postcode - preferredAttendanceTime - neutralProblemSummary - equipment - brand - model - photoContext - confidence - codes properties: tradeClassification: $ref: "#/components/schemas/TradeClassification" urgencyClassification: $ref: "#/components/schemas/UrgencyClassification" suburb: { type: ["string", "null"], maxLength: 120 } postcode: { type: ["string", "null"], maxLength: 16 } preferredAttendanceTime: { type: ["string", "null"], maxLength: 160 } neutralProblemSummary: { type: ["string", "null"], maxLength: 500 } equipment: { type: ["string", "null"], maxLength: 120 } brand: { type: ["string", "null"], maxLength: 120 } model: { type: ["string", "null"], maxLength: 120 } photoContext: $ref: "#/components/schemas/PhotoContext" confidence: type: string enum: [low, medium, high] codes: type: array maxItems: 3 items: type: string enum: [ROUTING_REVIEW, URGENCY_REVIEW, MANUAL_REVIEW_REQUIRED] Partner: type: object required: [id, businessName, contactName, trade, suburbs, availability, status] properties: id: { type: number } businessName: { type: string } contactName: { type: string } abn: { type: ["string", "null"] } trade: { type: string } suburbs: type: array items: { type: string } radiusKm: { type: number } availability: { type: boolean } status: { type: string } services: type: array items: { type: string } emergencyJobs: { type: boolean } PartnerAttribution: type: object additionalProperties: false properties: utmSource: { type: string, maxLength: 100 } utmMedium: { type: string, maxLength: 100 } utmCampaign: { type: string, maxLength: 100 } PartnerFunnelEventInput: type: object additionalProperties: false required: [sessionId, eventType] properties: sessionId: type: string pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" eventType: type: string enum: [partner_page_viewed, partner_application_started] attribution: $ref: "#/components/schemas/PartnerAttribution" PartnerInput: type: object required: [ submissionId, businessName, contactName, trade, mobile, email, suburbs, radiusKm, ] properties: submissionId: type: string pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" businessName: { type: string } contactName: { type: string } abn: { type: string } trade: { type: string } licence: { type: string } mobile: { type: string } email: { type: string } suburbs: type: array items: { type: string } radiusKm: { type: number } services: type: array items: { type: string } emergencyJobs: { type: boolean } funnelSessionId: type: string pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" attribution: $ref: "#/components/schemas/PartnerAttribution" PartnerApplicationReceipt: type: object required: [id, status, submittedAt, duplicate] properties: id: { type: number } status: { type: string } submittedAt: { type: string, format: date-time } duplicate: { type: boolean } PartnerApplication: allOf: - $ref: "#/components/schemas/Partner" - type: object required: [ mobile, email, submittedAt, notificationStatus, acknowledgementStatus, ] properties: licence: { type: ["string", "null"] } mobile: { type: string } email: { type: string } submittedAt: { type: string, format: date-time } notificationStatus: { type: string } acknowledgementStatus: { type: string } acquisitionUtmSource: { type: ["string", "null"] } acquisitionUtmMedium: { type: ["string", "null"] } acquisitionUtmCampaign: { type: ["string", "null"] } AvailabilityInput: type: object required: [availability] properties: availability: { type: boolean } Dispatch: type: object required: [id, jobId, businessId, decision] properties: id: { type: number } jobId: { type: number } businessId: { type: number } decision: { type: string } offeredAt: { type: string } respondedAt: { type: ["string", "null"] } eta: { type: ["string", "null"] } confirmedPriceKind: { type: ["string", "null"], enum: [total, diagnostic, null] } confirmedPriceCents: { type: ["number", "null"] } customerConfirmedAt: { type: ["string", "null"] } DispatchDecisionInput: type: object required: [decision] properties: decision: { type: string } eta: { type: string, maxLength: 160 } confirmedPriceKind: { type: string, enum: [total, diagnostic] } confirmedPriceCents: { type: number, minimum: 1 } DispatchOfferInput: type: object required: [jobId, partnerId, expiresAt] properties: jobId: { type: number } partnerId: { type: number } expiresAt: { type: string, format: date-time } DispatchOffer: type: object required: [id, jobId, partnerId, state, offeredAt] properties: id: { type: number } jobId: { type: number } partnerId: { type: number } state: { type: string } offeredAt: { type: string } respondedAt: { type: ["string", "null"] } expiresAt: { type: ["string", "null"] } eta: { type: ["string", "null"] } confirmedPriceKind: { type: ["string", "null"], enum: [total, diagnostic, null] } confirmedPriceCents: { type: ["number", "null"] } customerConfirmedAt: { type: ["string", "null"] } notificationStatus: { type: string, enum: [pending, sent, delivered, failed] } emailNotificationStatus: { type: string, enum: [pending, sent, delivered, failed] } smsNotificationStatus: { type: string, enum: [pending, sent, delivered, failed] } PartnerOffer: allOf: - $ref: "#/components/schemas/DispatchOffer" - type: object properties: job: $ref: "#/components/schemas/PartnerOfferJob" PartnerOfferJob: type: object required: [ reference, trade, suburb, postcode, urgency, preferredTime, description, createdAt, updatedAt, expectedPrice, photos, ] properties: reference: { type: string } trade: { type: string } suburb: { type: string } postcode: { type: string } urgency: { type: string } preferredTime: { type: string } description: { type: string } photos: type: array items: { $ref: "#/components/schemas/JobPhoto" } expectedPrice: anyOf: - $ref: "#/components/schemas/PricingSnapshot" - type: "null" customerName: { type: ["string", "null"] } customerPhone: { type: ["string", "null"] } customerEmail: { type: ["string", "null"] } serviceAddressLine1: { type: ["string", "null"] } serviceAddressLine2: { type: ["string", "null"] } createdAt: { type: string } updatedAt: { type: string } JobPhoto: type: object additionalProperties: false required: [id] properties: id: { type: number, minimum: 1 } PartnerRecommendation: type: object required: [partnerId, score, eligible, codes, disqualifications] properties: partnerId: { type: number } score: { type: number } eligible: { type: boolean } codes: type: array items: { type: string } disqualifications: type: array items: { type: string } AcceptedTradie: type: object required: [ businessName, contactName, eta, confirmedPriceKind, confirmedPriceCents, customerConfirmed, ] properties: businessName: { type: string } contactName: { type: string } eta: { type: ["string", "null"] } confirmedPriceKind: { type: ["string", "null"], enum: [total, diagnostic, null] } confirmedPriceCents: { type: ["number", "null"] } customerConfirmed: { type: boolean } PartnerAcquisitionFunnelCounts: type: object required: [ views, starts, submits, viewToStartRate, startToSubmitRate, viewToSubmitRate, ] properties: views: { type: number } starts: { type: number } submits: { type: number } viewToStartRate: type: ["number", "null"] description: starts / views, or null when there are no views startToSubmitRate: type: ["number", "null"] description: submits / starts, or null when there are no starts viewToSubmitRate: type: ["number", "null"] description: submits / views, or null when there are no views PartnerAcquisitionBreakdownRow: allOf: - $ref: "#/components/schemas/PartnerAcquisitionFunnelCounts" - type: object properties: utmSource: { type: ["string", "null"] } utmMedium: { type: ["string", "null"] } utmCampaign: { type: ["string", "null"] } PartnerAcquisitionSummary: type: object required: [totals, breakdown] properties: totals: $ref: "#/components/schemas/PartnerAcquisitionFunnelCounts" breakdown: type: array items: $ref: "#/components/schemas/PartnerAcquisitionBreakdownRow" AdminSummary: type: object required: [ newRequests, awaitingDispatch, tradieApplications, approvedTradies, availableTradies, sentOpportunities, acceptedJobs, declinedJobs, completedJobs, ] properties: newRequests: { type: number } awaitingDispatch: { type: number } tradieApplications: { type: number } approvedTradies: { type: number } availableTradies: { type: number } sentOpportunities: { type: number } acceptedJobs: { type: number } declinedJobs: { type: number } completedJobs: { type: number } PaidFlowState: type: string enum: [ not_started, serviceable, manual_review, unsupported, checkout_started, payment_confirmed, sourcing, match_ready, approved, completed, sourcing_failed, refund_pending, refunded, ] ServiceabilityCheckResult: type: object required: [ outcome, inferredTrade, candidateCount, rawCandidateCount, verifiedCandidateCount, dispatchReadyCount, reason, ] properties: outcome: type: string enum: [serviceable, manual_review, unsupported] inferredTrade: { type: string } # Deprecated alias of rawCandidateCount, kept for existing consumers. candidateCount: { type: number } # Every candidate that qualifies on trade + coverage, regardless of # verification status -- this is "we could plausibly source from # someone", not "we are ready to charge for it". rawCandidateCount: { type: number } # Subset of rawCandidateCount whose listing has been checked # (verification_status listing_verified/dispatch_eligible/checked). verifiedCandidateCount: { type: number } # Subset of verifiedCandidateCount considered ready to actually # dispatch a paid job to. outcome can only be "serviceable" when # this is greater than zero. dispatchReadyCount: { type: number } reason: { type: string } CheckoutInput: type: object required: [returnUrl] properties: # Embedded Checkout takes a single return_url -- Stripe navigates the # top-level page here (with ?session_id=... appended) once payment # completes inside the embedded iframe. There is no separate # cancel_url in embedded mode. returnUrl: { type: string, minLength: 1 } CheckoutSession: type: object required: [clientSecret, testMode] properties: clientSecret: { type: string } testMode: { type: boolean } ApproveMatchInput: type: object required: [token] properties: token: { type: string, minLength: 1 } OkResponse: type: object required: [ok] properties: ok: { type: boolean, enum: [true] } PaidMatch: type: object required: [providerName, providerPhone, priceMinCents, priceMaxCents, eta, notes] properties: providerName: { type: string } providerPhone: { type: ["string", "null"] } priceMinCents: { type: number } priceMaxCents: { type: number } eta: { type: string } notes: { type: ["string", "null"] } ManualMatchInput: type: object required: [providerName, priceMinCents, priceMaxCents, eta] properties: providerName: { type: string, minLength: 1, maxLength: 200 } providerPhone: { type: string, maxLength: 40 } priceMinCents: { type: number, minimum: 0 } priceMaxCents: { type: number, minimum: 0 } eta: { type: string, minLength: 1, maxLength: 200 } notes: { type: string, maxLength: 2000 } MarkSourcingFailedResult: type: object required: [ok, refund] properties: ok: { type: boolean, enum: [true] } refund: type: string enum: [initiated, failed, no_payment_on_file] PaidJob: type: object required: [ id, reference, description, trade, suburb, postcode, urgency, preferredTime, status, customerName, paidFlowState, createdAt, updatedAt, ] properties: id: { type: number } reference: { type: string } description: { type: string } trade: { type: string } suburb: { type: string } postcode: { type: string } urgency: { type: string } preferredTime: { type: string } status: { type: string } customerName: { type: string } customerPhone: { type: ["string", "null"] } customerEmail: { type: ["string", "null"] } serviceAddressLine1: { type: ["string", "null"] } serviceAddressLine2: { type: ["string", "null"] } paidFlowState: $ref: "#/components/schemas/PaidFlowState" serviceabilityReason: { type: ["string", "null"] } matchedProviderName: { type: ["string", "null"] } matchedProviderPhone: { type: ["string", "null"] } matchedProviderPriceMinCents: { type: ["number", "null"] } matchedProviderPriceMaxCents: { type: ["number", "null"] } matchedProviderEta: { type: ["string", "null"] } matchedProviderNotes: { type: ["string", "null"] } createdAt: { type: string } updatedAt: { type: string }