Preview email branding
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/email-templates/branding-preview';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"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"}'};
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://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
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Accent colour for buttons and links, as a 6-digit hex colour.
Example
#f4644fBackground colour around the email, as a 6-digit hex colour.
Example
#FFFFFFBackground colour of the email body, as a 6-digit hex colour.
Example
#FFFFFFText colour, as a 6-digit hex colour.
Example
#1A1A1AFooter text colour, as a 6-digit hex colour.
Example
#6B7280URL of the logo shown in the email header.
Tagline shown in the email header.
Postal address shown in the email footer.
Phone number shown in the email footer.
Name of the built-in template to render. Defaults to order-confirmation.
Responses
Section titled “Responses”object
The rendered plain-text email.
The rendered subject line.
The rendered HTML email.
Example generated
{ "text": "example", "subject": "example", "html": "example"}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
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.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}