Saltar al contenido principal
← Referencia de la API

El documento order.v1

Cada pedido que registra el configurador es un documento order.v1 firmado: el workflow en el que se creó, la lista de corte, el plan de producción, el presupuesto con precio y su token, y su procedencia. No contiene datos personales, solo tu customerRef opaco.

Las rutas, los nombres de campo, los códigos de error, los nombres de cabecera y los ejemplos de código se quedan en inglés: son el contrato.

Reglas que se cumplen en todos los pedidos

  • Toda longitud está en milímetros; unit es solo la unidad de visualización.
  • Todo importe es Money en unidades menores enteras y toda moneda es igual a la currency del pedido.
  • Un pedido es un workflow: workflow.mode selecciona la forma de la lista de corte y del plan (hoy panel2d).
  • plan.planHash es el SHA-256 del plan canónico; el token del presupuesto lo vincula, de modo que se detecta un plan modificado.
  • El documento es cerrado y solo aditivo dentro de v1: los campos nuevos son opcionales, no se quita ni se renombra nada.

Campos

Las tablas de abajo se generan a partir del propio JSON Schema; el mismo esquema está incluido, sin cambios, en el documento OpenAPI.

Las descripciones de esta tabla proceden del contrato en inglés (el JSON Schema o el documento OpenAPI).

Order

CampoTipoObligatorioDescripción
schemaVersion1sí—
idempotencyKeystringsíThe caller's replay key for POST /cfg/v1/order (P2-09): the same key returns the same order.
tenantIdstringsí—
configVersionintegersíThe tenant-config snapshot this order was priced against. Capped at 2^53−1 (one JSON text per integer, so one hash / token claim per version).
workflowWorkflowsí—
customerRefstringnoOpaque reference into the merchant's own customer records. Never a name or an address.
customerGroupstringnoThe tenant-config customer group the price list was chosen for.
locale"en" | "de" | "it" | "fr" | "pl" | "cs" | "ro" | "hu" | "es" | "hr"sí—
unit"mm" | "cm" | "in"síDisplay unit at ordering time; every length in this document is millimetres.
currencystringsí—
pricingMode"platform" | "external"sí—
createdAtstringsí—
expiresAtstringsíQuote validity; equals the token's exp.
sourceSourcesí—
cutListCutPart[]síMODE-DISCRIMINATED by workflow.mode (Order.allOf). One branch today: panel2d CutPart.
fullSheetsFullSheetItem[]síFull stock units bought uncut. MODE-DISCRIMINATED; panel2d: whole sheets.
hardwareHardwareLine[]síMode-independent (catalogue hardware).
bondedPanelsBondedPanel[]noGlued multi-layer panels (P5-05). MODE-DISCRIMINATED; panel2d only today. Shape may gain optional fields there; this is the v1 minimum.
planPlansíMODE-DISCRIMINATED; the plan carries its own `mode` tag (= workflow.mode), covered by planHash.
quoteQuotesí—
shippingOrderShippingno—
filesFileRef[]no—
signatureSignatureno—

Workflow

The tenant workflow this order was made in (tenant-config.v1 workflows[].id, or `default` for the implicit workflow). `mode` and `profile` are repeated so a consumer can dispatch without fetching the config; the quote token binds `id` and `mode`.

CampoTipoObligatorioDescripción
idstringsí—
mode"panel2d"síA BUILT mode (x-cfg-modes.built). Reserved ⇒ `mode_unavailable`; unknown ⇒ `enum`.
profile"furniture"sí—

Source

Provenance: which embed build collected the list, which engine version produced the plan, which config snapshot priced it.

CampoTipoObligatorioDescripción
embedVersionstringsí—
engineVersionstringsí= plan.engineVersion (the Engine API's engineVersion).
configVersionintegersí= $.configVersion.

CutPart

panel2d cut-list row = Engine API ApiPart2D (name, w, h, qty, rotatable, grain, grainGroup, priority, edgeBanding, material, meta) + the order's own id, group and machining. name/qty/material are REQUIRED here (optional on the API).

CampoTipoObligatorioDescripción
idstringsí—
namestringsíNo C0/C1 control characters (audit P7-01 F1: a newline in a name wrote DXF entities).
wnumbersíThe size the engine was given (after the tenant's dimension convention / edging deduction were applied).
hnumbersí—
qtyintegersí—
materialstringsíCatalogue MaterialItem.id (the API's material partition key).
rotatablebooleanno—
grain"w" | "h"no—
grainGroupstringno—
prioritybooleanno—
edgeBandingEdgeBandingno—
metaobjectnoOpaque passthrough (= ApiPart2D.meta), ≤ 2048 bytes canonical.
groupstringnoRoom / cabinet / project the customer assigned; printed on labels and exports.
machiningMachiningOp[]no—

EdgeBanding

Per-edge banding TYPE references (catalogue EdgingItem.id); an absent side is not banded (= ApiPart2D.edgeBanding).

CampoTipoObligatorioDescripción
topstringno—
rightstringno—
bottomstringno—
leftstringno—

MachiningOp

A machining operation on the part (catalogue MachiningType.id). `params` stays open in v1; P5-04 types its known keys additively (see params).

CampoTipoObligatorioDescripción
typeIdstringsí—
qtyintegersí—
paramsobjectnoOpen object; the KNOWN keys are typed (P5-04, additive): corner, measure, xMm, yMm, diameterMm, radiusMm, lengthMm, widthMm, depthMm. Per catalogue kind: hole/hinge = corner+measure+xMm+yMm+diameterMm[+depthMm]; groove = corner(top-left|top-right)+xMm+lengthMm[+widthMm+depthMm]; radius = corner+radiusMm. Any other key stays valid.

FullSheetItem

CampoTipoObligatorioDescripción
materialIdstringsí—
wnumbersí—
hnumbersí—
qtyintegersí—

HardwareLine

CampoTipoObligatorioDescripción
hardwareIdstringsí—
qtyintegersí—

BondedPanel

CampoTipoObligatorioDescripción
idstringsí—
wnumbersí—
hnumbersí—
qtyintegersí—
layersBondedLayer[]sí—
namestringno—

BondedLayer

CampoTipoObligatorioDescripción
materialIdstringsí—
thicknessMmnumbersí—

Plan

The panel2d production plan as the Engine API returned it (ApiOptimize2DResponse fields), plus the `mode` tag and planHash. Numbers are the engine's own, in millimetres; sheets[].price / metrics.totalPrice are the engine's unit-less price fields, NOT money (prices live in `quote`).

CampoTipoObligatorioDescripción
mode"panel2d"síThe mode tag — INSIDE the plan so planHash covers it; must equal $.workflow.mode (D15).
engine"heuristic" | "balanced" | "max"sí—
engineVersionstringsí—
deterministicbooleansí—
sheetsSheet[]sí—
metricsMetrics2Dsí—
cutPlanarray | nullsínull when the layout is not guillotine.
unplacedUnplaced2D[]sí—
warningsstring[]sí—
guillotineValidbooleansí—
planHashstringsísha256 hex of canonicalize(plan without planHash) — RFC 8785; covers `mode`.

Sheet

= ApiSheet (types.ts).

CampoTipoObligatorioDescripción
wnumbersí—
hnumbersí—
pricenumber | nullsíThe engine's unit-less per-sheet price; the issuer passes null.
partsPlacedPart2D[]sí—
offcutsRect[]no—
materialstringno—
grain"w" | "h"no—
metaobjectno—

PlacedPart2D

= ApiPlacedPart2D (types.ts).

CampoTipoObligatorioDescripción
namestringsí—
xnumbersí—
ynumbersí—
wnumbersí—
hnumbersí—
rotatedbooleansí—
metaobjectno—

Rect

= ApiRect (types.ts).

CampoTipoObligatorioDescripción
xnumbersí—
ynumbersí—
wnumbersí—
hnumbersí—

Metrics2D

= ApiMetrics2D (types.ts), unchanged: cutLines (collinear cuts merged), sawPasses (every strip crossed), cutLength (mm, convention-independent).

CampoTipoObligatorioDescripción
sheetCountintegersí—
yieldPctnumbersí—
placedintegersí—
totalintegersí—
cutLinesintegersí—
sawPassesintegersí—
cutLengthnumbersí—
totalPricenumbersí—

CutStep

= ApiCutStep (types.ts): sheet is the 0-based index into plan.sheets, step restarts at 1 per sheet, stage is the 1-based machine pass.

CampoTipoObligatorioDescripción
sheetintegersí—
stepintegersí—
axis"h" | "v"sí—
posnumbersí—
lengthnumbersí—
stageintegersí—

Unplaced2D

= ApiUnplaced2D (types.ts).

CampoTipoObligatorioDescripción
namestringsí—
wnumbersí—
hnumbersí—
qtyintegersí—

Quote

CampoTipoObligatorioDescripción
pricedbooleansífalse under pricingMode = external: lines carry quantities, every amount is 0.
linesQuoteLine[]sí—
totalsTotalssí—
quoteTokenstringsíSee x-cfg-quote-token. The merchant's server verifies it with the tenant's key (P4-02 /quote/verify).

QuoteLine

CampoTipoObligatorioDescripción
idstringsí—
type"cutPart" | "fullSheet" | "hardware" | "machining" | "bondedPanel" | "edging" | "surcharge" | "shipping" | "tax"sí—
labelstringsí—
qtynumbersíPieces, sheets, metres (edging) — the line's own unit.
unitAmountMoneysí—
amountMoneysíLine total after the tenant's rounding. Σ non-tax amounts = totals.net.
refLineRefno—
metaobjectno—

LineRef

What the line prices. At least one id when present.

CampoTipoObligatorioDescripción
partIdstringno—
materialIdstringno—
edgingIdstringno—
hardwareIdstringno—
machiningIdstringno—
zoneIdstringno—
ruleIdstringno—
bondedPanelIdstringno—

Totals

CampoTipoObligatorioDescripción
netMoneysí—
taxMoneysí—
grossMoneysí—

Money

CampoTipoObligatorioDescripción
amountMinorintegersí—
currencystringsí—

OrderShipping

Ids only — the delivery address is the merchant shop's data, not the contract's.

CampoTipoObligatorioDescripción
method"delivery" | "pickup"sí—
zoneIdstringno—
pickupLocationIdstringno—

FileRef

CampoTipoObligatorioDescripción
kind"pdf" | "labels" | "csv" | "dxf" | "svg" | "xlsx" | "json"sí—
urlstringsí—
sha256stringno—
bytesintegerno—

Signature

HMAC-SHA256 over canonicalize(order without signature). keyId names the tenant key (P2-07: derived from a master, the DB holds only the id).

CampoTipoObligatorioDescripción
alg"HMAC-SHA256"sí—
keyIdstringsí—
valuestringsí—

Aquí no hay un botón «probar» a propósito: la clave secreta pertenece a tu servidor, nunca a un navegador. La tienda demo muestra la incrustación y el traspaso del pedido funcionando de principio a fin.

Información legalCondiciones del configurador (EN) ·Contrato de encargo de tratamiento (EN) ·Aviso de privacidad para compradores ·Licencias de terceros (EN)