# Quotes (API v1, deprecated)

Deprecated: API v1 keeps working for existing integrations but gets no new features. New integrations should use API v2 (https://public-api.dapi.digital/docs/guides/quickstart.md).

Upload an STL file and get its print price, then poll the quote or wait for its webhook.

## Endpoints

-   [POST `/v1/quotes/upload_file`](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_uploadQuoteFile)
-   [GET `/v1/quotes`](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_listQuotes)
-   [POST `/v1/quotes`](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_createQuote)
-   [GET `/v1/quotes/status_check`](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_getQuoteStatus)
-   [GET `/v1/quotes/{publicId}`](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_getQuoteByPublicId)

## The quote object

### Attributes

-   `publicId` (string): Identifier for this quote. Use it to poll for results, reference the quote when creating an order, or contact support.
-   `name` (object, optional): Optional label you assigned at creation. Purely informational - not used in processing.
-   `webhook_metadata` (object, optional): Arbitrary key-value data you attached at creation. Echoed back unchanged in all API responses and webhook payloads.
-   `status` (string): Current processing state. Poll until `DONE` to read the price, or handle `ERROR` if the file could not be priced.
    
    Possible values: `FILE_UPLOADED`, `PROCESSING`, `DONE`, `CANCELLED`, `ERROR`.
    
-   `result` (object, optional): Estimated price per unit in USD, rounded to two decimal places. Populated only when `status` is `DONE`.
-   `metrics` (value, optional): What the slicer measured for one unit: filament weight and print time. Populated only when `status` is `DONE`; `null` while processing and after an error.
-   `store_id` (object, optional): The store this quote belongs to, or `null` if your account does not use stores.
-   `errorMessage` (string, optional): Short explanation of what went wrong. Populated only when `status` is `ERROR`.
-   `createdAt` (timestamp): ISO 8601 timestamp of when this quote was submitted.
-   `finishedAt` (object, optional): ISO 8601 timestamp of when processing completed, regardless of outcome. `null` while still `PROCESSING`.

**The quote object**

```json
{
  "publicId": "dapi_a3f9b2c1e4",
  "name": "bracket-v2",
  "webhook_metadata": {
    "order_id": "ORD-123",
    "notify_slack": true
  },
  "status": "PROCESSING",
  "result": 12.34,
  "metrics": null,
  "store_id": "str_9f2c4a7b13d84e0fa6c5b8e21d47a903",
  "errorMessage": "We could not complete the quote for this file.",
  "createdAt": "2026-03-24T12:00:00.000Z",
  "finishedAt": "2026-03-24T12:05:00.000Z"
}
```

## Get a pre-signed upload URL

POST `/v1/quotes/upload_file`

- **Credentials**: An API key with the `PRICING` or `FULL` permission.

- **For**: Designers

- **Operation id**: `v1_uploadQuoteFile`

Generates a pre-signed S3 URL that lets you upload an `.stl` file directly to storage, bypassing the API server entirely. Call this first - you need the returned `s3_key` to submit a quote.

## Upload Steps

1.  Call this endpoint to receive an `upload_url` and `s3_key`.
2.  `PUT` your STL file to `upload_url` with header `Content-Type: application/octet-stream`. **Maximum file size: 250 MB.**
3.  Pass the `s3_key` to `POST /quotes` to start the pricing process.

The upload URL expires after 1 hour. After expiry you must call this endpoint again.

## Daily Quote Limit

A global daily limit on quote submissions is enforced to prevent abuse. Integration accounts are exempt from it. This endpoint is where the limit is checked and counted, since the quote record is created here. When a limit is active, successful responses include an `X-Daily-Quotes-Remaining` header with the number of quotes that can still be submitted today. Submitting once the limit is exhausted returns `429 Too Many Requests`. The limit resets at midnight.

### Request body

-   `file_name` (string):
    
    Name of the file you are about to upload, used only to keep its extension.
    
    The slicer picks its model loader from the file extension, so a `.3mf` stored under an `.stl` name cannot be read and the quote fails with "The input model file to the slicer can not be parsed". Pass the real name and the extension is preserved.
    
    Supported: `.stl`, `.3mf`, `.obj`, `.step`, `.stp`. Anything else is rejected. Omit this field and the upload is treated as `.stl`, which is what callers got before this field existed.
    

### Returns 201 Created

Pre-signed URL ready. Upload your STL file to `upload_url` before it expires.

Response attributes (V1UploadFileResponse):

-   `publicId` (string): Identifier for this quote - use it to track the quote after submitting.
-   `upload_url` (string): Pre-signed S3 URL. Send a `PUT` request with the raw STL file as the body and `Content-Type: application/octet-stream`. Max file size: 250 MB.
-   `s3_key` (string): The S3 key for your uploaded file. Pass this to `POST /quotes` to start the quoting process.
-   `expires_in` (number): Number of seconds until the upload URL expires.

### Responses

-   `201`: Pre-signed URL ready. Upload your STL file to `upload_url` before it expires.
-   `401`: API key is missing or invalid.
-   `403`: The API key does not have permission to use quote endpoints.
-   `429`: Daily quote limit reached - try again tomorrow.
-   `500`: An unexpected error occurred on our side.

Errors use [the v1 error body](https://public-api.dapi.digital/docs/v1/reference.md#errors).

**Request**

```bash
curl -X POST "https://public-api.dapi.digital/v1/quotes/upload_file" \
  -H "x-api-key: $DAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file_name": "bracket-v2.3mf"
}'
```

**Response 201**

```json
{
  "publicId": "dapi_a3f9b2c1e4",
  "upload_url": "https://s3.eu-central-1.amazonaws.com/...",
  "s3_key": "public-api/quotes/abc-123/input/1711000000000-upload.stl",
  "expires_in": 3600
}
```

## List your quotes

GET `/v1/quotes`

- **Credentials**: An API key with the `PRICING` or `FULL` permission.

- **For**: Designers

- **Operation id**: `v1_listQuotes`

Returns a paginated list of your quotes, sorted by creation date (newest first). Each entry shows the current processing status and, once complete, the estimated per-unit price. Use the `publicId` field to fetch full details via `GET /quotes/:publicId`.

### Query parameters

-   `page` (integer): 1-based page index. Defaults to `1`.
    
    Range at least 1. Defaults to 1.
    
-   `page_size` (integer): Number of quotes per page. Maximum is `100`. Defaults to `20`.
    
    Range 1 to 100. Defaults to 20.
    
-   `store_id` (string): Return only quotes belonging to this store. Omit to return quotes from every store on your account.

### Returns 200 OK

Paginated list of quotes for the authenticated account.

Response attributes (V1ListQuotesResponseDto):

-   `items` (array of V1QuotePublicResponseDto): Quotes on this page, sorted by creation date (newest first).
    
    Described in [the quote object](https://public-api.dapi.digital/docs/reference/v1-quotes#v1_quote_public_object).
    
-   `page` (number): Page number returned, matching the `page` query parameter.
    
    Range at least 1.
    
-   `page_size` (number): Number of items per page, matching the `page_size` query parameter.
    
    Range 1 to 100.
    
-   `total` (number): Total number of quotes across all pages. Use this to determine whether more pages exist.
    
    Range at least 0.
    

### Responses

-   `200`: Paginated list of quotes for the authenticated account.
-   `400`: `page` or `page_size` is outside the allowed range.
-   `401`: API key is missing or invalid.
-   `403`: The API key does not have permission to use quote endpoints.
-   `429`: Rate limit exceeded - wait until the window resets before retrying.
-   `500`: An unexpected error occurred on our side.

Errors use [the v1 error body](https://public-api.dapi.digital/docs/v1/reference.md#errors).

**Request**

```bash
curl "https://public-api.dapi.digital/v1/quotes" \
  -H "x-api-key: $DAPI_API_KEY"
```

**Response 200**

```json
{
  "items": [
    {
      "publicId": "dapi_a3f9b2c1e4",
      "name": "bracket-v2",
      "webhook_metadata": {
        "order_id": "ORD-123",
        "notify_slack": true
      },
      "status": "PROCESSING",
      "result": 12.34,
      "metrics": null,
      "store_id": "str_9f2c4a7b13d84e0fa6c5b8e21d47a903",
      "errorMessage": "We could not complete the quote for this file.",
      "createdAt": "2026-03-24T12:00:00.000Z",
      "finishedAt": "2026-03-24T12:05:00.000Z"
    }
  ],
  "page": 1,
  "page_size": 20,
  "total": 42
}
```

## Submit an STL file for pricing

POST `/v1/quotes`

- **Credentials**: An API key with the `PRICING` or `FULL` permission.

- **For**: Designers

- **Operation id**: `v1_createQuote`

Queues an uploaded STL file for automated price estimation. You must first obtain an `s3_key` by uploading the file via `POST /quotes/upload_file`.

The response includes a `publicId` you can use to poll `GET /quotes/:publicId` until `status` reaches `DONE` or `ERROR`. Alternatively, configure a webhook URL in the dashboard to receive a notification when processing completes.

## Webhook Notifications

When processing finishes, we send an HTTP `POST` to your configured webhook URL. Any `webhook_metadata` you attached to this request is echoed back unchanged in the payload.

### HMAC Signature Verification

Every webhook delivery includes two headers so you can verify authenticity:

-   **`X-Dapi-Webhook-Signature`**: `sha256=<hex-digest>`
-   **`X-Dapi-Webhook-Timestamp`**: Unix timestamp (seconds) when the payload was signed

**Verification steps:**

1.  Read the raw request body as a UTF-8 string.
2.  Concatenate: `{X-Dapi-Webhook-Timestamp}.{raw_body}`
3.  Compute HMAC-SHA256 of that string using your webhook secret as the key.
4.  Compare the hex digest with the value after `sha256=` in the signature header (use constant-time comparison to prevent timing attacks).
5.  Reject the payload if the timestamp is older than 5 minutes (replay protection).

### Webhook Payload Shape

**JSON**

```json
{
  "event": "quote.completed",
  "quote": {
    "public_id": "dapi_a3f9b2c1e4",
    "status": "DONE",
    "result": 12.34,
    "error_message": null
  },
  "webhook_metadata": { "order_id": "ORD-123", "notify": true },
  "timestamp": "2026-03-25T12:05:00.000Z"
}
```

### Expected Response

Return any `2xx` status code to acknowledge receipt. We retry on non-2xx responses.

### Request body

-   `s3_key` (string, required): The S3 key returned from `POST /quotes/upload_file`.
-   `name` (string): Optional name or label for this quote (e.g. part name).
-   `store_id` (string): The store this quote belongs to. Required once your account has at least one store. An order may only reference quotes from its own store.
-   `webhook_metadata` (object): Optional flat key-value metadata object that will be echoed back in webhook payloads. Values must be strings (max 64 characters), numbers, or booleans. Maximum 20 keys.

### Returns 201 Created

Quote accepted and queued for processing. Poll with the returned `publicId` to retrieve the result.

Response attributes (V1CreateQuoteResponse):

-   `publicId` (string): Use this id with `GET /quotes/:publicId` to see when your quote is ready and to read prices.
-   `status` (string): `PROCESSING` - we accepted your request and are working on it. `ERROR` - we could not start the quote; try again or contact support.

### Responses

-   `201`: Quote accepted and queued for processing. Poll with the returned `publicId` to retrieve the result.
-   `400`: The `s3_key` is invalid, not found, or has already been submitted for another quote.
-   `401`: API key is missing or invalid.
-   `403`: The API key does not have permission to use quote endpoints.
-   `429`: Rate limit exceeded - wait until the window resets before retrying.
-   `500`: An unexpected error occurred on our side.

Errors use [the v1 error body](https://public-api.dapi.digital/docs/v1/reference.md#errors).

**Request**

```bash
curl -X POST "https://public-api.dapi.digital/v1/quotes" \
  -H "x-api-key: $DAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "s3_key": "public-api/quotes/abc-123/input/1711000000000-upload.stl",
  "name": "helmet-v3",
  "store_id": "str_9f2c4a7b13d84e0fa6c5b8e21d47a903",
  "webhook_metadata": {
    "order_id": "ORD-123",
    "notify_slack": true,
    "priority": 1
  }
}'
```

**Response 201**

```json
{
  "publicId": "dapi_a3f9b2c1e4",
  "status": "PROCESSING"
}
```

## Check quote access

GET `/v1/quotes/status_check`

- **Credentials**: An API key with the `PRICING` or `FULL` permission.

- **For**: Designers

- **Operation id**: `v1_getQuoteStatus`

Verifies that your API key has permission to use quote endpoints. Call this before integrating the quote workflow if you want to confirm access is granted without side effects.

### Returns 200 OK

The key has permission to submit and retrieve quotes.

Response attributes (V1QuoteStatusCheckResponse):

-   `ok` (boolean): Always `true` when you receive a `200` - confirms the key has access to quote endpoints.
-   `status` (string): Access status for pricing endpoints. `pricing_access_granted` means you may submit and retrieve quotes.

### Responses

-   `200`: The key has permission to submit and retrieve quotes.
-   `401`: API key is missing or invalid.
-   `403`: The API key does not have permission to use quote endpoints.
-   `429`: Rate limit exceeded - wait until the window resets before retrying.

Errors use [the v1 error body](https://public-api.dapi.digital/docs/v1/reference.md#errors).

**Request**

```bash
curl "https://public-api.dapi.digital/v1/quotes/status_check" \
  -H "x-api-key: $DAPI_API_KEY"
```

**Response 200**

```json
{
  "ok": true,
  "status": "pricing_access_granted"
}
```

## Get one quote

GET `/v1/quotes/{publicId}`

- **Credentials**: An API key with the `PRICING` or `FULL` permission.

- **For**: Designers

- **Operation id**: `v1_getQuoteByPublicId`

Returns the quote matching the given `publicId`. While `status` is `PROCESSING`, poll this endpoint periodically until it transitions to `DONE` or `ERROR`. When `status` is `DONE`, read **`result`** for the estimated per-unit price in USD. If a webhook URL is configured in your dashboard, you will be notified automatically when processing completes - no polling required.

### Path parameters

-   `publicId` (string, required): The `publicId` returned when the quote was submitted.

### Returns 200 OK

The requested quote object. Returns [the quote object](https://public-api.dapi.digital/docs/v1/reference/quotes.md#v1_quote_public_object).

### Responses

-   `200`: The requested quote object.
-   `400`: The request could not be parsed or validated.
-   `401`: API key is missing or invalid.
-   `403`: The API key does not have permission to use quote endpoints.
-   `404`: No quote with this `publicId` exists for your account.
-   `429`: Rate limit exceeded - wait until the window resets before retrying.
-   `500`: An unexpected error occurred on our side.

Errors use [the v1 error body](https://public-api.dapi.digital/docs/v1/reference.md#errors).

**Request**

```bash
curl "https://public-api.dapi.digital/v1/quotes/dapi_a3f9b2c1e4" \
  -H "x-api-key: $DAPI_API_KEY"
```

---

3DAPI API Docs. This page on the web: https://public-api.dapi.digital/docs/v1/reference/quotes. Index of every page: https://public-api.dapi.digital/docs/llms.txt.
