# Parts

How an agent uploads a design, gets quotes from fabrication suppliers, orders a part and follows it. What the service is and what it costs is on [Services](/services).

## Before you start

The agent needs an open account and its Passport. You connect nothing: the fabrication suppliers take payment on their own checkout page, with your card.

## Upload a design

```text
Upload bracket.stl from my workspace as a design for the assistant account.
```

The client calls `stack_upload_design`. From code or the terminal:

```typescript
const design = await stack.accounts.making.uploadDesign('acct_123', {
  file_name: 'bracket.stl',
  content_base64: b64,
}, { passportToken });
```

```bash
npx @getstackrun/cli account making acct_123 upload ./bracket.stl
```

- Give the file in one way: content_base64, a source_url, or a drive_file_id.
- A file sent in the request is at most 20 MB. A larger file goes to the drive first and is named by drive_file_id.
- The same file uploaded again returns the same design.

## Get quotes

```typescript
const { quotes, unavailable } = await stack.accounts.making.quote('acct_123', {
  design_id: design.id,
  spec: { quantity: 2, process: 'fdm_print', material: 'PLA' },
  recipient: {
    name: 'Anna Berg', email: 'anna@example.com', phone: '+4915112345678',
    address1: '1 Main St', city: 'Berlin', postal_code: '10115', country: 'DE',
  },
}, { passportToken });
```

- The tool is stack_quote_making. Without supplier, every available supplier is asked.
- process names how the part is made, for example fdm_print or cnc. It is passed to the supplier as given.
- Offers come back cheapest first, up to three from each supplier.
- A supplier with no offer is listed in unavailable with the reason, for example format_unsupported.
- A quote that returns no offer is not counted as an action.

## Order and pay

```typescript
const order = await stack.accounts.making.order('acct_123', quotes[0].id, { passportToken });
// order.state === 'awaiting_payment', order.checkout.url
```

The tool is `stack_order_making`. The order comes back `awaiting_payment` with the supplier's checkout page. The agent pays there with your card through the account's browser checkout, which you approve on your own device. See [Your own card](/docs/account/card). A checkout page left unpaid is given up after 24 hours.

## Follow or cancel

`stack_get_making_order` and `stack_list_making_orders` read orders. Reading one order asks the supplier for its current state, at most once every 30 seconds; the list shows the state last read. The states after payment are `placed`, `in_production`, `shipped` and `delivered`. An order still under way after 90 days is `tracking_stopped` and is no longer read. `stack_cancel_making_order` cancels while the supplier still can. Reads and cancelling are free. Upload, quote and order are one action each.

## When it is refused

- 409 MAKING_QUOTE_EXPIRED - the quote has lapsed. Quote again.
- 422 MAKING_SUPPLIER_REJECTED - the supplier refused the file or the specification.
- 409 MAKING_ORDER_STATE - the order is past the point where it can be cancelled.
- 503 MAKING_UNAVAILABLE - the supplier cannot be reached. Nothing was ordered.
- 403 CONTROL_DENIED - with controls on, your policy or your own server refused it. Controls are asked as making.quote and making.order, the order with its total.

## Reference

Every field is on [Making](/docs/api/account-making). Every tool is in the [tool reference](/docs/mcp-tools). Printed products go through your own supplier accounts: see [Print on demand](/docs/account/print-on-demand).
