Skip to main content

Documentation 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.

The Quotes API powers Krafta’s custom-order workflow. A client submits a quote request specifying what they want, how many units, and where to ship; the platform creates a Quote record with all pricing fields zeroed out and status PENDING_REVIEW. An admin then reviews the request, fills in the pricing via a PUT call, and moves the quote to APPROVED. Once the customer accepts, the quote converts to a live order.

POST /api/quotes

Create a new quote request. No authentication is required — anonymous visitors may submit requests. The response includes a human-readable quote number in the format COT-XXXXXX that can be shown to the customer as a reference.

Request body

variantId
string
required
UUID of the ProductVariant being quoted. Must match an existing variant in the catalog.
quantity
number
required
Number of units the customer wants to order. Parsed as an integer server-side.
email
string
required
Customer’s email address used for follow-up communication about the quote.
name
string
Customer’s full name. Defaults to "Cliente Anónimo" if omitted.
phone
string
Customer’s phone number for WhatsApp or direct contact.
shippingState
string
Venezuelan state the order will be shipped to (e.g., "Lara", "Miranda").
shippingCity
string
City within the destination state (e.g., "Barquisimeto", "Caracas").
details
string
Free-form text for special requirements, custom artwork instructions, or other notes relevant to production.

Response

{
  "success": true,
  "quoteId": "e7c4b2a1-33f8-4d01-bc92-1a5e6f7d8c09",
  "quoteNumber": "COT-482917"
}
success
boolean
Always true on a successful submission.
quoteId
string
UUID of the newly created Quote record.
quoteNumber
string
Human-readable reference code in the format COT-XXXXXX (six random digits). Show this to customers so they can reference their quote without exposing the internal UUID.

Default values on creation

FieldDefault
statusPENDING_REVIEW
subtotal0.00
shippingCost0.00
total0.00
totalBs0.00
exchangeRate40.00 (BCV fallback)
currencyUSD
expiresAt15 days from creation

Error responses

StatusCondition
400variantId, quantity, or email missing.
500Unexpected server error.

PUT /api/quotes ADMIN

Review a submitted quote and set the final pricing. Requires the ADMIN role. The admin supplies subtotal and shippingCost; the server calculates total and totalBs automatically using the exchange rate stored on the quote.

Request body

quoteId
string
required
UUID of the Quote to update.
status
string
required
New quote status. Accepted values: "APPROVED" or "REJECTED".
subtotal
number
Product subtotal in USD. Defaults to 0.00 if omitted or non-numeric.
shippingCost
number
Shipping cost in USD. Defaults to 0.00 if omitted or non-numeric.

Response

{ "success": true }

Computed fields

The server derives the following values automatically — do not send them in the request body:
FieldDerivation
totalsubtotal + shippingCost
totalBstotal × exchangeRate (BCV fallback: 40.00)

Error responses

StatusCondition
400quoteId or status missing.
401 / 403Caller does not hold the ADMIN role.
500Unexpected server error.

GET /api/quotes ADMIN

Retrieve all quote records, ordered by createdAt descending. Each record includes its items array and the associated user object. Requires the ADMIN role.

Response

{
  "success": true,
  "quotes": [
    {
      "id": "e7c4b2a1-33f8-4d01-bc92-1a5e6f7d8c09",
      "status": "PENDING_REVIEW",
      "subtotal": 0,
      "shippingCost": 0,
      "total": 0,
      "totalBs": 0,
      "exchangeRate": 40,
      "expiresAt": "2024-03-16T14:00:00.000Z",
      "createdAt": "2024-03-01T14:00:00.000Z",
      "items": [{ "variantId": "...", "quantity": 50, "price": 0 }],
      "user": { "id": "...", "email": "cliente@example.com" }
    }
  ]
}

QuoteStatus lifecycle

Every Quote moves through the following states. Transitions are driven by admin actions (via PUT) or automated expiry logic.
StatusMeaning
DRAFTQuote was started but not yet submitted. Not yet used by the public API — reserved for future editor flows.
PENDING_REVIEWDefault state after a customer submits a request via POST /api/quotes. Awaiting admin pricing.
APPROVEDAdmin has set pricing and approved the quote. The customer can review total cost and accept.
ACCEPTEDCustomer has accepted the approved quote. The quote is ready to be converted into an Order.
EXPIREDThe quote was not accepted before its expiresAt date (15 days after creation).
REJECTEDAdmin explicitly rejected the request (e.g., product unavailable, insufficient quantity).
REPLACEDA new revised quote superseded this one. The previous quote is archived as REPLACED to preserve history.

Build docs developers (and LLMs) love