API v1 preview

# Calculate manufacturing prices

Get itemized prices for selected models, sizes and quantities.

## Request manufacturing prices

After inspection completes with current model and support measurements, send model IDs, sizes and quantities to Calculate prices using models:read. Inspection defects do not prevent a price estimate. Each size must be 30–200 mm; changing it does not modify the model or existing cart items.

Calculate prices

```
#!/usr/bin/env bash
# Bash + curl + jq. Server-side key with models:read; completed model inspection.
set -euo pipefail
: "${API_BASE_URL:?Set your API origin}"
: "${OTTOMFG_API_KEY:?Set your server-side API key}"
: "${MODEL_ID:?Set the model ID}"
: "${LONGEST_DIMENSION_MM:?Set the requested print size in millimeters, 30 to 200}"
# Keep the cart size; pricing never modifies the model or existing cart items.
# Optional key; this example saves one for safe retries within 24 hours.
: "${PRICE_REQUEST_KEY:?Set a saved key for this request}"
body=$(jq -n --arg id "$MODEL_ID" --argjson size "$LONGEST_DIMENSION_MM" \
  '{items: [{model_id: $id, longest_dimension_mm: $size, quantity: 2}]}')
curl --fail-with-body --silent --show-error --max-time 30 \
  -X POST "${API_BASE_URL%/}/api/v1/prices" \
  -H "Authorization: Bearer $OTTOMFG_API_KEY" \
  -H "Idempotency-Key: $PRICE_REQUEST_KEY" \
  -H 'Content-Type: application/json' --data "$body"
# USD cents. No charge or price lock. Read error code/message before retrying.
# model_not_ready: poll GetModel. pricing_unavailable: inspect/correct the model
# or contact support; retrying unchanged inputs does not rerun inspection.
```

## Use the returned amounts

All amounts are integer USD cents. unit_price is manufacturing per model. Each line's repair object reports any Model repair fee; use it rather than computing a charge.

Manufacturing includes estimated support material and post-processing for each model. Service fees apply separately; use the returned amounts.

Line total

text

```
subtotal = unit_price × quantity + repair.fee (when charged on this line)
```

Matching model/size entries merge; different sizes stay separate. The basket subtotal sums the returned lines. Shipping and tax are excluded. Use returned amounts directly; displayed volume and weight are informational estimates, not a pricing formula.

Review the quote’s itemized charges before accepting it.

## Model repair

The server decides Model repair; requests have no repair input. Repair applies when mesh inspection fails, when your account requested repair for the file revision, or when a paid order already covers the revision. A model that passes inspection prints as uploaded.

| Field | Meaning |
| --- | --- |
| required | Mesh inspection requires repair. |
| applied | Staff repair this model before printing. |
| reason | inspection_failed, customer_request or covered; null when repair does not apply. |
| status | not_applied, estimating, priced or covered. |
| fee | Repair fee in cents; null while estimating. Charged once per model revision per quote, on the first line of that model. |
| covered_by_order_id | Paid order that covers the file revision; the repaired file is printed at no charge. |

The fee comes from an automatic estimate: $7.50 per person or animal and $3.50 per large accessory, from $3.50 up to $50. Quotes and orders wait while status is estimating and return model_repair_estimate_pending; a model whose repair applies stays processing until its fee is known. A repair charge does not mean repair has completed.

## Availability and recovery

| Code | Action |
| --- | --- |
| model_not_ready | Poll until inspection completes and manufacturing_estimate is no longer pending. |
| pricing_unavailable | The model is failed or action_required. Retry a failed model with PATCH at the same size, or replace its file. Otherwise follow status_reasons or contact support. Repeating the price request does not reprocess the model. |
| model_not_found | Check the ID, owning account and whether the model was deleted. |

Prices are estimates until saved in a quote. Defects can affect measurement accuracy. A request prices every item or returns an error; there is no partial basket.

## Save a quote

Repeating a price request is safe, but later results can change. Create a quote to save manufacturing prices and shipping options for 30 minutes. pricing_version is an opaque reference, not a price lock.

[Create a shipping quote](https://ottomfg.com/docs/quotes.md)

API v1 preview

Source: https://ottomfg.com/docs/pricing
