# GEO Partner Estimate API

This document is for partners who need to generate GEO estimates programmatically through the Prometheus Computing partner API.

## Base URL

Production:

```text
https://prometheuscomputing.com
```

Partner endpoints:

- `GET /api/partner/pricing/options`
- `POST /api/partner/pricing/quote`

Authentication:

- A partner token is required.
- Contact Prometheus Computing to receive a token for your organization.
- Send it as `Authorization: Bearer <PARTNER_TOKEN>`.

Quick start:

```bash
export PROMETHEUS_PARTNER_TOKEN='YOUR_PARTNER_TOKEN'
```

Estimate notice:

```text
Final pricing with taxes will be added to the official quote.
```

## Recommended integration flow

1. Set `PROMETHEUS_PARTNER_TOKEN`
2. Call `GET /api/partner/pricing/options`
3. Read the available IDs for stack, scale, timeline, client tier, depth, and modules
4. Build an estimate request
5. Submit it to `POST /api/partner/pricing/quote`
6. Read back the returned estimate total and per-module line prices

## Endpoint 1: Get available options

Request:

```bash
curl -s https://prometheuscomputing.com/api/partner/pricing/options \
  -H "Authorization: Bearer $PROMETHEUS_PARTNER_TOKEN" | jq
```

Response shape:

```json
{
  "currency": "USD",
  "isEstimate": true,
  "estimateNotice": "Final pricing with taxes will be added to the official quote.",
  "defaults": {
    "technicalStackId": "T2",
    "scaleTierId": "S2",
    "timelineId": "STANDARD",
    "clientTierId": "ENTERPRISE",
    "modules": [
      {
        "code": "P1",
        "include": true,
        "depthId": "STANDARD"
      }
    ]
  },
  "lookups": {
    "technicalStacks": [
      {
        "id": "T1",
        "label": "T1 - Controlled CMS",
        "description": "Lower implementation variance and fewer platform-side unknowns.",
        "examples": "Shopify / Webflow / Squarespace"
      }
    ],
    "scaleTiers": [],
    "timelines": [],
    "clientTiers": [],
    "scopeDepths": []
  },
  "modules": [
    {
      "code": "A0",
      "name": "GEO Technical Assessment & Priority Mapping",
      "category": "Assessment",
      "phase": "assessment"
    },
    {
      "code": "P1",
      "name": "Product Page Structure",
      "category": "Core Foundation",
      "phase": "implementation"
    }
  ],
  "phases": {
    "flow": [
      { "step": 1, "phaseId": "assessment", "label": "Phase 1 — Assessment", "shortLabel": "Assessment" },
      { "step": 2, "phaseId": "implementation", "label": "Phase 2 — Implementation quote", "shortLabel": "Implementation quote" },
      { "step": 3, "phaseId": "implementation", "label": "Build", "shortLabel": "Build" }
    ],
    "assessment": {
      "id": "assessment",
      "label": "Phase 1 — Assessment",
      "formula": "Phase 1 line price = Base × Assessment tech tier",
      "basePrice": 2500,
      "tiers": [
        { "id": "T1", "label": "T1 - Controlled CMS", "assessmentMultiplier": 1, "linePrice": 2500 },
        { "id": "T2", "label": "T2 - Flexible CMS or SPA", "assessmentMultiplier": 2.6, "linePrice": 6500 },
        { "id": "T3", "label": "T3 - Custom / Enterprise", "assessmentMultiplier": 5.4, "linePrice": 13500 }
      ],
      "priceRange": { "min": 2500, "max": 13500 },
      "creditNote": "Assessment fee may be credited toward Phase 2 when proceeding within 60 days."
    },
    "implementation": {
      "id": "implementation",
      "label": "Phase 2 — Implementation",
      "followsAssessment": true
    }
  }
}
```

Notes:

- `phases` describes the two-phase engagement model and Phase 1 tier prices.
- `defaults.assessmentModules` and `defaults.implementationModules` provide phase-specific starting selections.
- `estimateNotice` is the line you should display with the returned estimate.

## Endpoint 2: Generate an estimate

Request:

```bash
curl -s https://prometheuscomputing.com/api/partner/pricing/quote \
  -H "Authorization: Bearer $PROMETHEUS_PARTNER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "technicalStackId": "T2",
    "scaleTierId": "S2",
    "timelineId": "STANDARD",
    "clientTierId": "ENTERPRISE",
    "modules": [
      { "code": "P0", "include": true, "depthId": "STANDARD" },
      { "code": "P1", "include": true, "depthId": "STANDARD" },
      { "code": "P2", "include": true, "depthId": "STANDARD" },
      { "code": "P3", "include": true, "depthId": "STANDARD" },
      { "code": "P4", "include": true, "depthId": "STANDARD" },
      { "code": "P5A", "include": true, "depthId": "STANDARD" },
      { "code": "P5B", "include": true, "depthId": "STANDARD" },
      { "code": "P5C", "include": false, "depthId": "STANDARD" },
      { "code": "P5D", "include": true, "depthId": "STANDARD" },
      { "code": "P5E", "include": true, "depthId": "STANDARD" },
      { "code": "P7", "include": false, "depthId": "STANDARD" }
    ]
  }' | jq
```

Request body fields:

- `technicalStackId`: one of the values returned by `lookups.technicalStacks`
- `scaleTierId`: one of the values returned by `lookups.scaleTiers`
- `timelineId`: one of the values returned by `lookups.timelines`
- `clientTierId`: one of the values returned by `lookups.clientTiers`
- `quotePhase`: optional — `"assessment"`, `"implementation"`, or `"combined"`
- `modules`: optional array of module overrides

`quotePhase` controls which module phase is priced:

- `"assessment"`: only `A*` modules (stable formula: Base × Tech)
- `"implementation"`: only `P*` modules (full formula)
- `"combined"`: both phases (assessment + implementation)
- omitted: inferred from included modules

Quick assessment example:

```bash
curl -s https://prometheuscomputing.com/api/partner/pricing/quote \
  -H "Authorization: Bearer $PROMETHEUS_PARTNER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "technicalStackId": "T2",
    "scaleTierId": "S2",
    "timelineId": "STANDARD",
    "clientTierId": "ENTERPRISE",
    "quotePhase": "assessment"
  }' | jq
```

Assessment pricing ignores scale, timeline, and client tier multipliers.

Module override fields:

- `code`: module code
- `include`: `true` or `false`
- `depthId`: one of the values returned by `lookups.scopeDepths`

If `modules` is omitted:

- the API uses each module's default selection **for the requested `quotePhase` only**
- when `quotePhase` is also omitted, the API defaults to **`implementation`** (Phase 2 only) for backward compatibility — assessment (`A0`) is not included unless you pass `quotePhase: "assessment"` or `"combined"`

If a module is omitted from the `modules` array:

- that specific module also falls back to its current default selection

## Estimate response

Response shape:

```json
{
  "currency": "USD",
  "isEstimate": true,
  "estimateNotice": "Final pricing with taxes will be added to the official quote.",
  "selections": {
    "technicalStack": {
      "id": "T2",
      "label": "T2 - Flexible CMS / Hybrid"
    },
    "scaleTier": {
      "id": "S2",
      "label": "S2 - Mid"
    },
    "timeline": {
      "id": "STANDARD",
      "label": "Standard"
    },
    "clientTier": {
      "id": "ENTERPRISE",
      "label": "Enterprise"
    }
  },
  "breakdown": {
    "modules": [
      {
        "code": "P1",
        "name": "Product Page Structure",
        "category": "Core Foundation",
        "include": true,
        "depth": {
          "id": "STANDARD",
          "label": "Standard"
        },
        "linePrice": 9282
      }
    ],
    "includedModuleCount": 7,
    "subtotal": 38056.2,
    "total": 38056.2
  }
}
```

The fields most partners will use are:

- `currency`
- `estimateNotice`
- `breakdown.modules[].linePrice`
- `breakdown.includedModuleCount`
- `breakdown.subtotal`
- `breakdown.total`

## Current option IDs

Technical stack:

- `T1`: Controlled CMS
- `T2`: Flexible CMS / Hybrid
- `T3`: Custom / Enterprise

Scale tier:

- `S1`: Small
- `S2`: Mid
- `S3`: Large
- `S4`: Global

Timeline:

- `STANDARD`
- `RUSH_2_WEEKS`
- `RUSH_1_WEEK`
- `RUSH_3_DAYS`

Client tier:

- `STARTUP`
- `GROWTH`
- `ENTERPRISE`

Scope depth:

- `LITE`
- `STANDARD`
- `DEEP`

Modules:

- `P0`: JS Rendering & Pre-rendering
- `P1`: Product Page Structure
- `P2`: FAQ System
- `P3`: Content Engine
- `P4`: Schema Layer
- `P5A`: Metadata System
- `P5B`: Internal Linking System
- `P5C`: Media Optimization
- `P5D`: Performance / Mobile
- `P5E`: Crawlability, Indexing & Discovery
- `P7`: Monitoring & Observability

## JavaScript example

```ts
const headers = {
  Authorization: `Bearer ${process.env.PROMETHEUS_PARTNER_TOKEN}`
}

const options = await fetch('https://prometheuscomputing.com/api/partner/pricing/options', {
  headers
}).then((res) => res.json())

const estimate = await fetch('https://prometheuscomputing.com/api/partner/pricing/quote', {
  method: 'POST',
  headers: {
    ...headers,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    technicalStackId: options.defaults.technicalStackId,
    scaleTierId: options.defaults.scaleTierId,
    timelineId: options.defaults.timelineId,
    clientTierId: options.defaults.clientTierId,
    modules: options.defaults.modules
  })
}).then((res) => res.json())

console.log(estimate.breakdown.total)
console.log(estimate.estimateNotice)
```

## Error handling

Common responses:

- `200 OK`: estimate generated successfully
- `400 Bad Request`: invalid ID or malformed request body
- `401 Unauthorized`: missing or invalid partner token

Examples of invalid input:

- unknown `technicalStackId`
- unknown module `code`
- invalid `depthId`

## Integration guidance

- Fetch the latest options before generating estimates.
- Send a full `modules` array when you want to pass an exact module selection.
- Display the returned `estimateNotice` with the estimate.
