Skip to content

Render a template on a product photo

GET
/t/{id}/mockup.png
curl --request GET \
--url 'https://api.pixonaut.app/t/example/mockup.png?blankId=example&placementId=example' \
--header 'Authorization: Bearer <token>'

Operation ID: templates.mockup.get

The published template id (baseId@version) drawn into the print area a blank placement’s mockup photo marks, as a PNG a storefront shows. A draft, an unknown blank, placement or mockup, and a mockup whose photo is gone are all 404, so the route says nothing about which of them is missing. size caps the long edge in pixels. showcase draws one of the template’s showcases in place of its defaults, cached as the defaults are; an id the template holds no showcase under is 404 showcase_not_found. Naming neither mockupId nor viewId draws on the placement’s first view. A studio member reads it with their session, in the workspace the x-tenant-id header names, holding templates:read.

id
required

A published template id, baseId@version.

string

A published template id, baseId@version.

blankId
required

The blank whose placement the mockup is of.

string
>= 1 characters <= 64 characters

The blank whose placement the mockup is of.

placementId
required

The placement on that blank.

string
>= 1 characters <= 64 characters

The placement on that blank.

mockupId

One of the placement’s mockup photos. Name it or viewId, not both; neither draws on the placement’s first view.

string
>= 1 characters <= 64 characters

One of the placement’s mockup photos. Name it or viewId, not both; neither draws on the placement’s first view.

viewId

One of the placement’s views: the render uses its photo of variant, else its default photo. Name it or mockupId, not both.

string
>= 1 characters <= 64 characters

One of the placement’s views: the render uses its photo of variant, else its default photo. Name it or mockupId, not both.

variant

A variant ref of the blank, with viewId: the render uses the view’s photo that shows it.

string
>= 1 characters <= 64 characters

A variant ref of the blank, with viewId: the render uses the view’s photo that shows it.

size

The long edge in pixels, clamped to the sizes the api renders.

string

The long edge in pixels, clamped to the sizes the api renders.

bleed

Refused: a full-bleed reference cannot be composited.

string

Refused: a full-bleed reference cannot be composited.

showcase

The id of one of the template’s showcases, as its read lists them: the template is drawn with that set’s values in place of its defaults.

string
/^[A-Za-z0-9_-]{1,40}$/

The id of one of the template’s showcases, as its read lists them: the template is drawn with that set’s values in place of its defaults.

The template on the product photo

Media typeimage/png
string
X-Request-Id
required
string

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 caller’s copy, named by its ETag, is current

X-Request-Id
required
string

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: bleed_not_compositable

Media typeapplication/json
object
error
required
string

Examples

Examplebleed_not_compositable

bleed_not_compositable

{
"error": "bleed_not_compositable"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

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: origin_forbidden, feature_disabled, forbidden, workspace_suspended

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

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.

No published template, blank, placement or mockup answers to these ids, or showcase_not_found: the template holds no showcase with the id showcase names

object
error
required
string

Examples

Exampleshowcase_not_found

showcase_not_found

{
"error": "showcase_not_found"
}
X-Request-Id
required
string

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: mockup_rect_unusable, mockup_rect_outside_photo, mockup_placed_box_empty, photo_decode_failed, mockup_mesh_unusable, mockup_cut_unusable, mockup_mask_decode_failed, mockup_uv_decode_failed, mockup_uv_pass_mismatch, unknown_variant, variant_retired, variant_has_no_photo, mockup_mask_unreadable, mockup_uv_unreadable, asset_map_too_large, invalid_query

Media typeapplication/json
object
bytes

Always sent with asset_map_too_large.

number
error
required
string
maxBytes

Always sent with asset_map_too_large.

number
reason

Always sent with unknown_variant, variant_retired, variant_has_no_photo.

string
ref

Always sent with unknown_variant.

string
variant

With variant_retired: The retired variant’s ref. With variant_has_no_photo: The variant’s ref. Always sent with variant_retired, variant_has_no_photo.

string
view

The view’s label. Always sent with variant_has_no_photo.

string
viewId

Always sent with variant_has_no_photo.

string

Examples

asset_map_too_large

{
"bytes": 0,
"error": "asset_map_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

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 caller left before the render started

Media typeapplication/json
object
error
required
string

Examples

Exampleclient_closed_request

client_closed_request

{
"error": "client_closed_request"
}
X-Request-Id
required
string

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: artwork_decode_failed, encode_failed, downscale_size_overflow, input_too_large, mockup_warp_unreadable, mockup_mesh_unreadable, mockup_cut_unreadable, mockup_uv_view_missing, composite_failed, template_defaults_invalid, db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

artwork_decode_failed

{
"error": "artwork_decode_failed"
}
X-Request-Id
required
string

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: print_box_unavailable, asset_store_unavailable, assets_unavailable

Media typeapplication/json
object
error
required
string

Examples

asset_store_unavailable

{
"error": "asset_store_unavailable"
}
X-Request-Id
required
string

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

Status · Terms of service · Privacy policy · Subprocessors