The orders API covers the full lifecycle of a Krafta print-on-demand order: a customer submits their design, shipping details, and payment evidence in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/PloutusLab/krafta-web/llms.txt
Use this file to discover all available pages before exploring further.
POST; the ADMIN or workshop (TALLER) team then retrieves the order list via GET and advances its status through the production pipeline via PUT. Orders are identified by a sequential human-readable number in the format KRFT-XXXXXX.
POST /api/orders
Creates a new order. The endpoint accepts the chosen product variant, shipping details, pricing snapshot, design identifiers, and a payment submission in one request body. Authentication is optional: if a validkrafta-token cookie is present the order is linked to the authenticated user; otherwise it is recorded under a fallback guest identifier.
On success the order is persisted to the database with status: "REPORTED", meaning Krafta staff must verify the payment before production begins. If the database is unavailable the order falls back to a local JSON file in public/orders/.
Request body
The ID of the
ProductVariant the customer is ordering (e.g. "var-1").Number of units ordered.
Street address for delivery (e.g.
"Av. Libertador 123").Destination city (e.g.
"Barquisimeto").Destination state (e.g.
"Lara").Shipping cost in USD (e.g.
3.00).Product subtotal in USD before shipping (e.g.
12.00).Total amount charged in USD including shipping (e.g.
15.00).Total amount in Venezuelan bolívares at the time of checkout (e.g.
600.00).USD → VES exchange rate used to compute
totalBs (e.g. 40.00).UUID of the
DesignUpload record referencing the customer’s artwork file. Pass null or omit if no upload was made.A URL or data URI for the design preview image generated by the on-canvas editor.
Array of per-view design configuration objects captured by the editor. Stored as JSON in
designViewsJson on the OrderItem.Payment submission details reported by the customer.
Response
true when the order is created.UUID of the newly created order, used for internal references and status updates.
Human-readable order identifier shown to the customer. Format:
KRFT-XXXXXX where XXXXXX is a six-digit random number (e.g. "KRFT-482031").The order’s initial
status is always REPORTED. The customer’s payment has not yet been verified by Krafta staff. Production does not begin until an ADMIN advances the status to CONFIRMED.GET /api/orders
Returns all orders sorted by creation date descending. Each order includes its fullitems and payments arrays. This endpoint is intended for the internal admin dashboard and workshop management panel.
This endpoint does not enforce authentication at the route level — it is the caller’s responsibility to protect any UI that surfaces this data. In practice, the admin and workshop dashboards that consume it are themselves behind role-gated page guards.
Response
true on a successful fetch.Array of order objects, each containing the full order record with nested
items and payments.PUT /api/orders
Advances an order to a new status in the production lifecycle. Requires theADMIN or TALLER role.
Request body
The UUID of the order to update (the
id field, not the orderNumber).The target status. Must be one of the values in the table below.
Valid status values
| Value | Meaning |
|---|---|
CONFIRMED | Payment has been verified by an admin; order enters production queue |
IN_PRODUCTION | Workshop has started printing/producing the order |
READY | Production complete; order is ready for pickup or dispatch |
HANDED_TO_DELIVERY | Order handed off to a courier or delivery partner |
COMPLETED | Order delivered and closed |
CANCELLED | Order cancelled by admin or customer request |
Response
true when the status update is applied.Error responses
| Status | Condition |
|---|---|
400 | orderId or status is missing from the request body |
403 | The request does not carry a valid ADMIN or TALLER session |
404 | No order with the given orderId was found in the local filesystem fallback (returned only when the database update also fails) |
