comecerodocs

Get a template

GET
/templates/{id}

Gets one template with its body. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

id*string

The template id.

Query Parameters

timezone?string

An IANA time zone name, such as America/New_York or UTC. It sets how date_start and date_end are read and the time zone of every date in the response. The default is the account's time zone (Settings, Technical), or UTC when it has none. A name that is not known is a 400.

expand?string

Comma-separated child objects to return in full instead of as a URL, for example customer,payments. Use dot notation for nested objects (items.product), up to four levels deep. A single object takes up to 12 paths; a list takes up to 2, applied to every item. Extra paths are dropped without an error. See Expanding objects.

show?string

Comma-separated fields to return; all others are left out. Use dot notation for child fields (customer.email). You cannot send show and hide together (400). See Customizing output.

hide?string

Comma-separated fields to leave out of the response. Use dot notation for child fields (customer.email). You cannot send show and hide together (400). See Customizing output.

formatted?boolean

When true, the object also has a formatted child with amounts and dates as display text in the shopper's language and currency (for example $19.99 or November 7, 2026). The default is false. See Localized formatting.

Defaultfalse

Response Body

The template.

application/json
  1. response

A Handlebars template that builds the body of an email (or a PDF). Use one on a notification subscription, wrap it in another with wrapper_template, or render it yourself with the build endpoint.

object?"template"

Always template.

Value in"template"
url?string

The URL of this template in the API.

Formaturi
template_id?string

The template id.

date_created?string

When the template was created.

Formatdate-time
date_modified?string

When the template last changed.

Formatdate-time
test?boolean

true for a test mode template.

account_id?string

The account it belongs to.

expand?|

Comma-separated child objects of the data to expand before the template is filled.

show?|

Comma-separated fields of the data to keep.

hide?|

Comma-separated fields of the data to leave out.

wrapper_template?||

The template this one is placed inside (a shared header and footer, for example): its URL, the full object with expand=wrapper_template, or null.

comments?|

Your own notes, at most 256 characters.

template_type?|

email (or null, the same) or pdf. A PDF template cannot be changed back.

Value in"email""pdf"null
pdf_type?|

For a PDF template, what it renders, such as invoice or order.

page_format?|

For a PDF template, the page size, such as A4 or Letter.

orientation?|

For a PDF template, portrait or landscape.

margin_top?|

For a PDF template, the top margin.

margin_bottom?|

For a PDF template, the bottom margin.

margin_left?|

For a PDF template, the left margin.

margin_right?|

For a PDF template, the right margin.

body?|

The Handlebars source, at most 128 kB. In a list this holds a short note instead; get the template by id to read the body.

formatted?

Dates as display text. Only returned with formatted=true.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/templates/string'
Example Response
{  "object": "template",  "url": "https://api.comecero.com/api/v1/templates/1102500900112TEm5Jc3Rw",  "template_id": "1102500900112TEm5Jc3Rw",  "date_created": "2026-10-01T09:05:00Z",  "date_modified": "2026-10-01T09:05:00Z",  "test": true,  "account_id": "AB1234",  "expand": null,  "show": null,  "hide": null,  "wrapper_template": null,  "comments": "Download email",  "template_type": null,  "pdf_type": null,  "page_format": null,  "orientation": null,  "margin_top": null,  "margin_bottom": null,  "margin_left": null,  "margin_right": null,  "body": "<p>Hi {{customer.first_name}}, your download is ready: {{download_url}}</p>"}