Print from code
Beta. The same API the site uses. No key needed yet; routes may change.
Quote
POST /api/quote with the model as multipart field file. STL, 3MF or STEP, up to 100 MB.
curl -F file=@bracket.stl https://mandarin3d.com/api/quote{
"id": "Xk3…",
"filename": "bracket.stl",
"grams": 6.19,
"seconds": 763.58,
"bbox": [30, 30, 20],
"cached": false,
"example": { "qty": 1, "print": 3.91, "shipping": 5.51, "total": 9.42 }
}Same file again: served from cache in milliseconds. Raw bytes work too: ?filename=part.stl.
Price
POST /api/price for another quantity. No side effects.
curl https://mandarin3d.com/api/price -H 'content-type: application/json' \
-d '{"quoteId":"Xk3…","qty":10}'Or price locally: GET /api/config has the formula, colors and shipping table.
Order
POST /api/checkout returns a checkout link. Send acceptTerms: true only after the buyer accepts: custom made to order, all sales final (Terms).
curl https://mandarin3d.com/api/checkout -H 'content-type: application/json' \
-d '{"quoteId":"Xk3…","color":"BLK","qty":1,"acceptTerms":true}'{ "checkoutId": "co_…", "invoiceUrl": "https://…", "price": { "total": 9.42 } }The buyer pays at invoiceUrl. Ships by USPS in 3-5 days.
Reference
GET /api/config- formula, colors, shipping, limits
POST /api/quote- file → grams, time, size, price
GET /api/quote/:id- a saved quote
GET /api/quote/:id/model- mesh for previews
POST /api/price- price for a quantity
POST /api/checkout- checkout link
Errors are { "error": "…" } with a plain-English message. Limits: 250 × 250 × 250 mm, 60 quotes per 10 minutes per IP. Questions: orders@mandarin3d.com.