# Making API

Designs, quotes and orders with fabrication and print-on-demand suppliers. The steps are in the Parts and Print on demand guides.

## Making

The account's agent uploads a design (a 3D model, a CNC or sheet-metal part, or print artwork), asks suppliers for quotes, orders and tracks. Each supplier says which files and destinations it takes, and STACK's own money never pays a supplier.

- POST /v1/accounts/:id/making/designs - { file_name, content_base64 | source_url | drive_file_id, description? }. A file in any format (the extension is the format): up to 20 MB sent in the request, or a file of any size already on the agent's drive by drive_file_id, which is not copied and is streamed to the supplier whenever one is asked (keep it on the drive while the design is used; file_name then defaults to the drive file's name). Returns the design with its SHA-256; the same file again returns the same design.
- POST /v1/accounts/:id/making/quotes - { design_id, recipient, supplier?, spec? }. Returns quotes, cheapest first, and unavailable (suppliers that gave no offer, with the supplier's own reason or a code).
- POST /v1/accounts/:id/making/orders - { quote_id }. One order per quote. 201 with a checkout page to pay on, or 202 awaiting approval.
- GET /v1/accounts/:id/making/designs, /designs/:designId, /quotes/:quoteId, /orders and /orders/:orderId - reads; an order read refreshes it from its supplier.
- POST /v1/accounts/:id/making/orders/:orderId/cancel - stop an order while the supplier still can. The agent or the operator.
- POST /v1/accounts/:id/making/orders/:orderId/approve and /reject - the customer decides a held order. Operator only; approving needs a person in a browser.
- GET, PUT and DELETE /v1/accounts/making/suppliers[/:supplier] - the customer's own Gelato, Prodigi, Printful and Lulu accounts. Owner or admin only; a key is never read back. POST /v1/accounts/making/suppliers/printful/connect connects Printful by signing in at Printful instead of a token: it answers { authorize_url, expires_in_seconds }, the owner opens the address, signs in or up at Printful and approves, and STACK stores and renews the tokens. To keep the key out of a chat, ask for a connect link instead: POST /v1/services/connect-links with { connect: { kind: "making_supplier", supplier } }, { connect: { kind: "telegram_bot", account_id } } or { connect: { kind: "post_address" } } returns a single-use page where the owner or an admin enters the key. Sign-up and key pages: Gelato https://dashboard.gelato.com/keys/manage, Prodigi https://dashboard.prodigi.com/, Printful https://developers.printful.com/, Lulu https://developers.lulu.com/user-profile/api-keys, mailbox.bot https://mailbox.bot.

Uploading, quoting and ordering run under the agent's Passport and count one action each, and quotes and orders are asked of your controls first (`making.quote`, `making.order`). A refusal is never charged. Every quote and order is in the record with the design file's SHA-256.

Agentic Fabrication Network and Craftcloud answer an order with a hosted checkout page, which the agent pays with the account's card checkout and you approve on your device. Gelato, Prodigi, Printful and Lulu charge your own account at the supplier: the order is held on the agent's budget until you approve exactly that order, then placed.

- 409 MAKING_SUPPLIER_ACCOUNT_REQUIRED - connect your own account at that supplier first.
- 422 MAKING_SUPPLIER_REJECTED - the supplier refused the spec or the file. Nothing was ordered.
- 409 MAKING_QUOTE_EXPIRED and 409 MAKING_ORDER_STATE - the supplier no longer honours that quote, so ask for a new one; the order is not in a state that allows this.
- 503 MAKING_UNAVAILABLE - STACK or a supplier is down. Nothing is ordered or charged; retry later.
