Skip to content

Preview email branding

POST
/stores/{storeRef}/email-templates/branding-preview
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/email-templates/branding-preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "email_accent_color": "#f4644f", "email_bg_color": "#FFFFFF", "email_body_bg_color": "#FFFFFF", "email_text_color": "#1A1A1A", "email_footer_text_color": "#6B7280", "email_logo_url": "example", "email_header_tagline": "example", "email_footer_address": "example", "email_footer_phone": "example", "template_name": "example" }'

Renders a built-in template, never the store’s saved version, with branding you have not saved: colours, logo, header tagline and footer details. Use it to see how a colour change looks. Nothing is saved and no email is sent.

Required scopes: read:settings

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
email_accent_color

Accent colour for buttons and links, as a 6-digit hex colour.

string
/^#[0-9A-Fa-f]{6}$/

Example

#f4644f
email_bg_color

Background colour around the email, as a 6-digit hex colour.

string
/^#[0-9A-Fa-f]{6}$/

Example

#FFFFFF
email_body_bg_color

Background colour of the email body, as a 6-digit hex colour.

string
/^#[0-9A-Fa-f]{6}$/

Example

#FFFFFF
email_text_color

Text colour, as a 6-digit hex colour.

string
/^#[0-9A-Fa-f]{6}$/

Example

#1A1A1A
email_footer_text_color

Footer text colour, as a 6-digit hex colour.

string
/^#[0-9A-Fa-f]{6}$/

Example

#6B7280
email_logo_url

URL of the logo shown in the email header.

string
email_header_tagline

Tagline shown in the email header.

string
<= 120 characters
email_footer_address

Postal address shown in the email footer.

string
<= 255 characters
email_footer_phone

Phone number shown in the email footer.

string
<= 32 characters
template_name

Name of the built-in template to render. Defaults to order-confirmation.

string
Media typeapplication/json
object
text

The rendered plain-text email.

string
subject

The rendered subject line.

string
html
required

The rendered HTML email.

string

Example generated

{
"text": "example",
"subject": "example",
"html": "example"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}