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.

Workshops are the production partners that fulfill Krafta print orders. Each workshop has a geographic base, a daily production capacity, a service-level agreement expressed in days, and a payment policy that governs when Krafta pays the partner. The GET endpoint is public so the platform can display available workshops; all write operations require the ADMIN role.

GET /api/workshops

Returns all workshops with active: true. No authentication required. The response is drawn from the database; if the database is unreachable or returns no rows, a built-in seed list (Taller Creativo Barquisimeto and Taller Cabudare Premium) is returned as a fallback.

Response

{
  "success": true,
  "workshops": [
    {
      "id": "main-workshop-lara",
      "name": "Taller Creativo Barquisimeto",
      "contactName": "Carlos Taller",
      "phone": "04141234567",
      "email": "carlos@taller.com",
      "cityBase": "Barquisimeto",
      "stateBase": "Lara",
      "capacityPerDay": 50,
      "slaDays": 3,
      "paymentPolicy": "PAGO_AL_FINALIZAR",
      "active": true
    }
  ]
}
success
boolean
Always true on success.
workshops
array
Array of active Workshop objects.

POST /api/workshops ADMIN

Create a new workshop record. Requires the ADMIN role. The generated workshopId follows the pattern taller-{7 random alphanumeric chars} and is returned in the response.

Request body

name
string
required
Display name of the workshop (e.g., "Taller Express Caracas").
contactName
string
required
Full name of the primary contact person at the workshop.
phone
string
required
Venezuelan mobile number for WhatsApp and order coordination.
email
string
required
Email address for formal communication and order notifications.
cityBase
string
City where the workshop is physically located. Defaults to "Barquisimeto" if omitted.
stateBase
string
Venezuelan state of the workshop’s location. Defaults to "Lara" if omitted.
capacityPerDay
number
Maximum units producible per day. Parsed as an integer. Defaults to 10 if omitted or non-numeric.
slaDays
number
Production SLA in business days. Parsed as an integer. Defaults to 3 if omitted or non-numeric.
paymentPolicy
string
When the workshop expects payment from Krafta. Accepted values: DEPOSITO_TOTAL, DEPOSITO_PARCIAL, PAGO_AL_FINALIZAR, PAGO_CONTRA_ENTREGA. Defaults to "PAGO_AL_FINALIZAR" if omitted.

Response

{
  "success": true,
  "workshopId": "taller-x4k9z2m"
}

Error responses

StatusCondition
400name, contactName, phone, or email missing.
401 / 403Caller does not hold the ADMIN role.
500Unexpected server error.

PUT /api/workshops ADMIN

Update an existing workshop’s details. All fields except id follow the same defaults as the POST endpoint. The active flag is not modified by this operation — use DELETE to deactivate.

Request body

id
string
required
UUID (or seed-style slug) of the workshop to update.
name
string
required
Updated display name.
contactName
string
required
Updated contact person name.
phone
string
required
Updated contact phone number.
email
string
required
Updated contact email address.
cityBase
string
Updated city. Defaults to "Barquisimeto" if omitted.
stateBase
string
Updated state. Defaults to "Lara" if omitted.
capacityPerDay
number
Updated daily capacity. Defaults to 10 if omitted or non-numeric.
slaDays
number
Updated SLA in days. Defaults to 3 if omitted or non-numeric.
paymentPolicy
string
Updated payment policy. Defaults to "PAGO_AL_FINALIZAR" if omitted.

Response

{ "success": true }

Error responses

StatusCondition
400id, name, contactName, phone, or email missing.
401 / 403Caller does not hold the ADMIN role.
500Unexpected server error.

DELETE /api/workshops?id= ADMIN

Deactivate a workshop. In the database, this sets active: false on the Workshop record (a soft delete). In the local filesystem fallback, the workshop entry is removed from public/workshops.json. Requires the ADMIN role.

Query parameters

id
string
required
UUID or slug of the workshop to deactivate.

Response

{ "success": true }

Error responses

StatusCondition
400id query parameter missing.
401 / 403Caller does not hold the ADMIN role.
500Unexpected server error.

PaymentPolicy values

The paymentPolicy field controls when Krafta transfers production cost to the workshop after an order is fulfilled.
ValueMeaning
DEPOSITO_TOTALFull production cost is paid to the workshop before work begins.
DEPOSITO_PARCIALA partial deposit is paid upfront; the remainder is paid on completion.
PAGO_AL_FINALIZARFull payment is made to the workshop once production is complete and verified.
PAGO_CONTRA_ENTREGAPayment is made to the workshop only after the order has been delivered to the customer.

Build docs developers (and LLMs) love