{
  "openapi": "3.1.0",
  "info": {
    "title": "PrintAWorld quote API",
    "version": "1.0.0",
    "description": "One short quote request for custom fabrication. We reply to the person by email; no receipt is sent. Prices and services: https://prtwd.com/llms.txt",
    "contact": {
      "email": "contact@prtwd.com",
      "url": "https://prtwd.com/agents/"
    }
  },
  "externalDocs": {
    "url": "https://prtwd.com/agents/"
  },
  "servers": [
    {
      "url": "https://printaworld-figure-inquiry.clawdbro.workers.dev"
    }
  ],
  "paths": {
    "/agent/quote": {
      "get": {
        "operationId": "describeQuoteRequest",
        "summary": "List the fields and limits",
        "responses": {
          "200": {
            "description": "Fields and limits"
          }
        }
      },
      "post": {
        "operationId": "requestQuote",
        "summary": "Request a quote",
        "description": "3 requests a minute per IP. A 400 names each field to fix.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              },
              "example": {
                "service": "trophies",
                "item": "Resin fantasy football trophy with the league name",
                "size": "12in",
                "quantities": [
                  1,
                  10
                ],
                "budget": "$500",
                "needed_by": "2026-12-12",
                "delivery_zip": "11385",
                "file_urls": [
                  "https://example.com/ref.png"
                ],
                "name": "Ana",
                "email": "ana@example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteReceipt"
                }
              }
            }
          },
          "400": {
            "description": "A field is missing, too long or unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests; retry after a minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "502": {
            "description": "Could not send; email contact@prtwd.com instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuoteRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service",
          "item",
          "name",
          "email"
        ],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "figures",
              "uv",
              "engraving",
              "trophies",
              "scanning",
              "modeling",
              "printing",
              "other"
            ]
          },
          "item": {
            "type": "string",
            "maxLength": 120,
            "description": "What to make, specifically: the object, material or finish, and any text or logo"
          },
          "size": {
            "type": "string",
            "maxLength": 120,
            "description": "Finished size, inches or mm"
          },
          "quantities": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000
            },
            "minItems": 1,
            "maxItems": 6,
            "description": "Every quantity to price, e.g. [1, 50, 300]"
          },
          "budget": {
            "type": "string",
            "maxLength": 120,
            "description": "A number or range"
          },
          "needed_by": {
            "type": "string",
            "maxLength": 120,
            "description": "In-hand date"
          },
          "delivery_zip": {
            "type": "string",
            "pattern": "^\\d{5}(-\\d{4})?$",
            "description": "US ZIP code"
          },
          "file_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https?://",
              "maxLength": 300
            },
            "maxItems": 10,
            "description": "Links to images or files; no uploads"
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "The person asking"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "maxLength": 120,
            "description": "Phone number"
          },
          "notes": {
            "type": "string",
            "maxLength": 200,
            "pattern": "^[^\\r\\n]*$",
            "description": "Anything else, in one line"
          }
        }
      },
      "QuoteReceipt": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "example": "Received. We reply by email."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
