Find or create a standing design
const url = 'https://api.pixonaut.app/v1/designs/standing';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"approve":true,"blankId":"blk_3f9a2c1d8e7b6a5f4c3d2e1f","heightMm":90,"placementId":"front","templateId":"mug-wrap@4","widthMm":200}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pixonaut.app/v1/designs/standing \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "approve": true, "blankId": "blk_3f9a2c1d8e7b6a5f4c3d2e1f", "heightMm": 90, "placementId": "front", "templateId": "mug-wrap@4", "widthMm": 200 }'Operation ID: designs.findOrCreateStanding
Finds the workspace’s standing design for a template version, blank, placement and print size, or makes it from the template version as its author left it: the workspace’s own design for a fixed product, which is ordered any number of times without reorder, each order reusing the print of its current revision. One live standing design per template version, blank, placement and size: the same request again answers the same design, 200 with created: false, and two sent at once make one. Made, it answers 201 with created: true. A rejected or deleted standing design is not found, and the next request makes another. blankId and placementId, both or neither, and widthMm and heightMm, both or neither, as on POST /v1/designs: no size is the placement’s default size, which finds the design naming that size made. On a blank whose print areas change with its size, variant or variantRow names the size it is for, as on POST /v1/designs, and one standing design is kept per size. A connected store finds only the standing designs its own keys made, and never the workspace’s own. The version is read as a number, so mug@04 finds the design mug@4 made, and the answer spells it mug@4. A key, the store’s own name for a product, keeps a standing design per product: one naming a key finds only the design that key made, from the same store. A proofToken from a correction link handed out with adjustLayout makes the design from that layout adjustment, as a standing design of its own that the same proof finds again, for a store to keep one product’s row laid out by hand while the others follow the template; the design it was laid out from is not changed. A secret key, an integration key or a member holding designs:create; a publishable key or a link is refused secret_key_required. Nothing is approved unless approve: true asks.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Approve the design, made by this call or found not yet approved, recorded as design.approved like any other approval. Needs designs:update as well as designs:create; a caller without it is refused with forbidden and nothing is written. Left out or false, nothing is approved.
The store’s own name for the product the design is for, such as product-123: two products on one template version, blank, placement and size each keep their own standing design. Found only by the same key, from the same store. Left out, the design is the one every request naming no key finds.
A layout adjustment’s proof: the token a correction link handed out with adjustLayout answered for one of the caller’s own standing designs of the same key, template version, blank, placement, size and row. The design is made from that proof’s document, as a standing design of its own; the same proof again finds it, and the design it was laid out from is not changed. Any other proof is refused not_a_layout_proof, one of another key, placement, size or row layout_proof_mismatch, and one whose design was since rejected, deleted or erased unknown_proof.
The published template version, <baseId>@<version>. A base id without its version is refused with template_version_required.
A variant of the blank, by ref (v_…). On a blank whose print areas change with its size, the design is sized at, and keeps, that variant’s size; a ref the blank has no variant of is refused with variant_not_of_blank. On any other blank it is not checked. A proof also keeps it as proofVariant, for display.
The size the design is for, as the blank’s option values, such as {"Size": "XL"}, in place of variant: a value of each option the blank’s print areas change with, and nothing else, or it is refused with variant_row_invalid. Ignored on a blank whose print areas change with nothing.
object
Examples
Example
{ "approve": true, "blankId": "blk_3f9a2c1d8e7b6a5f4c3d2e1f", "heightMm": 90, "placementId": "front", "templateId": "mug-wrap@4", "widthMm": 200}Responses
Section titled “Responses”The standing design found
object
Whether the design is a layout adjustment’s, made from proofToken, rather than the template version as its author left it.
Whether this call made the design; false when it found one.
The print’s trim height, in millimetres.
The store’s key the request named; null for none.
The design’s status after the call: approved when approved by this call or before, else committed.
The print’s trim width, in millimetres.
Examples
Example
{ "adjusted": false, "blankId": "blk_3f9a2c1d8e7b6a5f4c3d2e1f", "created": false, "designId": "6f1c8a2b-3d4e-4f5a-8b6c-7d8e9f0a1b2c", "heightMm": 90, "key": null, "placementId": "front", "revision": 1, "standing": true, "status": "approved", "templateId": "mug-wrap@4", "widthMm": 200}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
The standing design made
object
Whether the design is a layout adjustment’s, made from proofToken, rather than the template version as its author left it.
Whether this call made the design; false when it found one.
The print’s trim height, in millimetres.
The store’s key the request named; null for none.
The design’s status after the call: approved when approved by this call or before, else committed.
The print’s trim width, in millimetres.
Examples
Example
{ "adjusted": false, "blankId": "blk_3f9a2c1d8e7b6a5f4c3d2e1f", "created": true, "designId": "6f1c8a2b-3d4e-4f5a-8b6c-7d8e9f0a1b2c", "heightMm": 90, "key": null, "placementId": "front", "revision": 1, "standing": true, "status": "approved", "templateId": "mug-wrap@4", "widthMm": 200}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: template_version_required, bad_request
object
Examples
bad_request
{ "error": "bad_request"}template_version_required
{ "error": "template_version_required"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: unauthorized
object
Examples
unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: secret_key_required, forbidden, origin_forbidden, feature_disabled, workspace_suspended
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}forbidden
{ "error": "forbidden"}origin_forbidden
{ "error": "origin_forbidden"}secret_key_required
{ "error": "secret_key_required"}workspace_suspended
{ "error": "workspace_suspended"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: unknown_proof
object
Examples
unknown_proof
{ "error": "unknown_proof"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: proof_expired
object
Examples
proof_expired
{ "error": "proof_expired"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: spot_plate_required, unknown_printshop, printshop_disconnected, printshop_unavailable, printshop_differs_from_blank, constraint_violation, unknown_placement, variant_not_of_blank, variant_row_invalid, variant_required, not_a_layout_proof, layout_proof_mismatch, invalid_doc, payload_too_large
object
Always sent with variant_required.
Sent with payload_too_large.
Always sent with spot_plate_required.
Always sent with invalid_doc.
Always sent with payload_too_large.
Always sent with unknown_printshop, printshop_disconnected, printshop_unavailable, printshop_differs_from_blank, variant_not_of_blank, variant_row_invalid, variant_required.
Always sent with spot_plate_required.
Always sent with variant_not_of_blank.
Always sent with constraint_violation.
object
On a text_draws_fallback_glyphs or text_draws_missing_glyphs warning: the characters the text’s font cannot draw, each once, in the order the text first holds them. Absent on every other violation.
The language whose overrides break the rule, when only the template as it reads in that language does. Absent, the original.
error refuses a publish; warning is worth the author’s attention and never does.
Examples
constraint_violation
{ "error": "constraint_violation", "violations": [ { "given": {}, "layerId": "string", "prop": "string", "rule": "string", "severity": "error" } ]}invalid_doc
{ "detail": {}, "error": "invalid_doc"}layout_proof_mismatch
{ "error": "layout_proof_mismatch"}not_a_layout_proof
{ "error": "not_a_layout_proof"}payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}printshop_differs_from_blank
{ "error": "printshop_differs_from_blank", "reason": "string"}printshop_disconnected
{ "error": "printshop_disconnected", "reason": "string"}printshop_unavailable
{ "error": "printshop_unavailable", "reason": "string"}spot_plate_required
{ "cause": "printshop_takes_no_plates", "error": "spot_plate_required", "references": [ "string" ]}unknown_placement
{ "error": "unknown_placement"}unknown_printshop
{ "error": "unknown_printshop", "reason": "string"}variant_not_of_blank
{ "error": "variant_not_of_blank", "reason": "string", "variant": "string"}variant_required
{ "areasVaryBy": [ "string" ], "error": "variant_required", "reason": "string"}variant_row_invalid
{ "error": "variant_row_invalid", "reason": "string"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: rate_limited
object
Examples
rate_limited
{ "error": "rate_limited"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: db_error. A request that failed unexpectedly answers as text instead.
object
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Questions? Write to [email protected].