Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
Logo
Sign inBook a demo
API ReferenceEntityEmail Template

Create entity email template

POST
https://api.mercoa.com/entity/:entityId/email-template
POST
/entity/:entityId/email-template
1from mercoa import Mercoa
2from mercoa.entity_types import EmailTemplateRequest
3
4client = Mercoa(
5 token="YOUR_TOKEN",
6)
7client.entity.email_template.create(
8 entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
9 request=EmailTemplateRequest(
10 template_type="PAYMENT",
11 name="Generic Payment Email",
12 subject="Action Required - Your payment is due",
13 content="<h1>Your invoice has been sent.</h1>",
14 is_default=True,
15 ),
16)
Try it
1{
2 "id": "emt_8545a84e-a45f-41bf-bdf1-33b42a55812c",
3 "entityId": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
4 "templateType": "PAYMENT",
5 "name": "Generic Payment Email",
6 "subject": "Action Required - Your payment is due",
7 "content": "<h1>Your invoice has been sent.</h1>",
8 "isDefault": true
9}
Was this page helpful?
Previous

Get entity email template

Next
Built with
Get entity email template

Authentication

AuthorizationBearer
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Path parameters

entityIdstringRequired
Entity ID or Entity ForeignID

Request

This endpoint expects an object.
templateTypeenumRequired
Allowed values:
namestringRequired
The name of the email template.
subjectstringRequired
The subject of the email template.
contentstringRequired
The HTML content of the email template.
isDefaultbooleanOptional
If true, this email template will be used as the default template for new invoices.

Response

This endpoint returns an object.
idstring
entityIdstring
The ID of the entity that this email template is associated with.
templateTypeenum
Allowed values:
namestring
The name of the email template.
subjectstring
The subject of the email template.
contentstring
The HTML content of the email template.
isDefaultboolean
True if this email template is the default template for new invoices.

Errors

If true, this email template will be used as the default template for new invoices.
Entity ID or Entity ForeignID

Bearer authentication of the form Bearer <token>, where token is your auth token.