---
title: "Customise a billing email template"
description: "Edits the words and the layout."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/webhooks/customise-a-billing-email-template"
---
# Customise a billing email template

> Edits the words and the layout.

<api-operation method="PUT" path="/v1/businesses/{biz}/emails/templates/{type}">
<template v-slot:docs="">

Text uses the template language: `{{var}}`, `{{var | default: "text"}}`, `{{#if var}}…{{else}}…{{/if}}` and `{{#unless var}}…{{/unless}}`. The body accepts a small HTML subset (p, br, b, i, u, h1, h2, ul, ol, li, a) and is sanitised on save. A variable this email never has, or a section that is not closed, is a 400. The logo, colours, button link and footer stay engine-owned.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Billing email type
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        subject
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The draft subject line.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        heading
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The draft heading.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The draft body text.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        footer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      This email's own footer, same syntax and HTML subset as body. Null or empty uses the business footer (<code>
        email_config.footerNote
      </code>
      
      ), else the built-in one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cta_label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Button text; only for emails with a button. Null keeps the default.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        show_facts
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Whether the email shows the table of key facts (such as amount and date).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        block_order
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Order of the movable sections, each exactly once. Null = body, action, facts, footer.
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        email_template
      </code>
      
      . One of <code>
        email_template
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Null when this is the built-in — no override row exists.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The email type this template is for.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subject
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The subject line of the email.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        heading
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The heading at the top of the email.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The body text of the email.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        footer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      This email's own footer, same syntax and HTML subset as body. Null or empty uses the business footer (<code>
        email_config.footerNote
      </code>
      
      ), else the built-in one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cta_label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Button text override. Null keeps <code>
        default_cta_label
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        show_facts
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      False hides the facts card.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        block_order
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      Order of the movable sections, each exactly once. Null = body, action, facts, footer.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        default_cta_label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The engine's button label; null when this email never has a button.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        has_facts
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether this email ever has a facts card.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        default_footer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What a null <code>
        footer
      </code>
      
       uses: the business footer (<code>
        email_config.footerNote
      </code>
      
      ), else the built-in one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        built_in
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The built-in subject, heading and body, for resetting a draft to the default.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customized
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      False = the built-in. Improvements to built-ins reach these businesses automatically.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        variables
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Merge variables the engine populates for this type.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        attachments
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      This business's attachment rule for this email: business config, not template wording, changed through <code>
        email_config.attachments
      </code>
      
      . Null when the email is about no document.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updated_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the email template was last changed (ISO-8601 UTC).
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Saved
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Invalid template
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X PUT "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/emails/templates/invoice_issued" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Your invoice from Brightwater Analytics",
    "heading": "Thanks for your business",
    "body": "Requested by the customer."
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "email_template",
  "id": "et_XXXXXXXXXXXX01",
  "type": "invoice_issued",
  "subject": "Your invoice from Brightwater Analytics",
  "heading": "Thanks for your business",
  "body": "Requested by the customer.",
  "footer": "Thanks for being a customer.",
  "cta_label": "View invoice",
  "show_facts": false,
  "block_order": [
    "body"
  ],
  "default_cta_label": "View invoice",
  "has_facts": false,
  "default_footer": "Brightwater Analytics",
  "built_in": {
    "subject": "Your invoice from Brightwater Analytics",
    "heading": "Thanks for your business",
    "body": "Requested by the customer."
  },
  "customized": false,
  "variables": [
    {
      "key": "seats",
      "label": "Example",
      "always": false,
      "sample": "Maya Castillo"
    }
  ],
  "attachments": {
    "document": "invoice",
    "pdf": false,
    "skip_zero_pdf": false,
    "skip_zero_send": false,
    "can_skip_zero_pdf": false,
    "can_skip_zero_send": false
  },
  "updated_at": "2026-03-14T09:30:00Z"
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid template"
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
