anchor.diff:  
   Kill Bill provides an API to retrieve an html invoice (formatted and translated using the account locale). The templating mechanism is based on https://github.com/spullara/mustache.java[mustache]. In order to configure the system, the following steps need to happen:
   
  +* Upload the invoice template
   * Upload the translation for all the supported locales
   * Upload the catalog translation for all the locales (if required)
   
  -Example for the locale `fr_FR`:
  -
  -1. Upload the invoice translation for locale `fr_FR`:
  +[start=1]
  +1. Upload the invoice template:
  +
  +The file `$SOME_PATH_PREFIX/HtmlInvoiceTemplate.mustache` would contain for instance:
  +
  +[source,bash]
  +----
  +<html>
  +    <head>
  +        <style type="text/css">
  +            th {align=left; width=225px; border-bottom: solid 2px black;}
  +        </style>
  +    </head>
  +    <body>
  +        <h1>{{text.invoiceTitle}}</h1>
  +        <table>
  +            <tr>
  +                <td rowspan=3 width=350px>Insert image here</td>
  +                <td width=100px/>
  +                <td width=225px/>
  +                <td width=225px/>
  +            </tr>
  +            <tr>
  +                <td />
  +                <td align=right>{{text.invoiceDate}}</td>
  +                <td>{{invoice.formattedInvoiceDate}}</td>
  +            </tr>
  +            <tr>
  +                <td />
  +                <td align=right>{{text.invoiceNumber}}</td>
  +                <td>{{invoice.invoiceNumber}}</td>
  +            </tr>
  +            <tr>
  +                <td>{{text.companyName}}</td>
  +                <td></td>
  +                <td align=right>{{text.accountOwnerName}}</td>
  +                <td>{{account.name}}</td>
  +            </tr>
  +            <tr>
  +                <td>{{text.companyAddress}}</td>
  +                <td />
  +                <td />
  +                <td>{{account.email}}</td>
  +            </tr>
  +            <tr>
  +                <td>{{text.companyCityProvincePostalCode}}</td>
  +                <td />
  +                <td />
  +                <td>{{account.phone}}</td>
  +            </tr>
  +            <tr>
  +                <td>{{text.companyCountry}}</td>
  +                <td />
  +                <td />
  +                <td />
  +            </tr>
  +            <tr>
  +                <td><{{text.companyUrl}}</td>
  +                <td />
  +                <td />
  +                <td />
  +            </tr>
  +        </table>
  +        <br />
  +        <br />
  +        <br />
  +        <table>
  +            <tr>
  +                <th>{{text.invoiceItemBundleName}}</td>
  +                <th>{{text.invoiceItemDescription}}</td>
  +                <th>{{text.invoiceItemServicePeriod}}</td>
  +                <th>{{text.invoiceItemAmount}}</td>
  +            </tr>
  +            {{#invoice.invoiceItems}}
  +            <tr>
  +                <td>{{description}}</td>
  +                <td>{{planName}}</td>
  +                <td>{{formattedStartDate}}{{#formattedEndDate}} - {{formattedEndDate}}{{/formattedEndDate}}</td>
  +                <td>{{invoice.currency}} {{amount}}</td>
  +            </tr>
  +            {{/invoice.invoiceItems}}
  +            <tr>
  +                <td colspan=4 />
  +            </tr>
  +            <tr>
  +                <td colspan=2 />
  +                <td align=right><strong>{{text.invoiceAmount}}</strong></td>
  +                <td align=right><strong>{{invoice.chargedAmount}}</strong></td>
  +            </tr>
  +            <tr>
  +                <td colspan=2 />
  +                <td align=right><strong>{{text.invoiceAmountPaid}}</strong></td>
  +                <td align=right><strong>{{invoice.paidAmount}}</strong></td>
  +            </tr>
  +            <tr>
  +                <td colspan=2 />
  +                <td align=right><strong>{{text.invoiceBalance}}</strong></td>
  +                <td align=right><strong>{{invoice.balance}}</strong></td>
  +            </tr>
  +        </table>
  +    </body>
  +</html>
  +----
  +
  +[source,bash]
  +----
  +curl -v \
  +     -u admin:password \
  +     -H "X-Killbill-ApiKey: bob" \
  +     -H "X-Killbill-ApiSecret: lazar" \
  +     -H 'X-Killbill-CreatedBy: admin' \
  +     -H "Content-Type: text/html" \
  +     -X POST \
  +     --data-binary @$SOME_PATH_PREFIX/HtmlInvoiceTemplate.mustache \
  +     http://127.0.0.1:8080/1.0/kb/invoices/template
  +----
  +
  +
  +
  +[start=2]
  +2. Upload the invoice translation for locale `fr_FR`:
   
   The file `$SOME_PATH_PREFIX/InvoiceTranslation_fr_FR.properties` would contain for instance:
     
  
positive.code:      http://127.0.0.1:8080/1.0/kb/invoices/catalogTranslation/fr_FR
  ----
  
  [start=3]
  3. Retrieve a specfic invoice html:
  
  [source,bash]
  ----
  
negative.code:      http://127.0.0.1:8080/1.0/kb/invoices/translation/fr_FR
  ----
  
  [start=3]
  3. Upload the catalog translation for locale `fr_FR`:
  
  
  The file `$SOME_PATH_PREFIX/CatalogTranslation_fr_FR.properties` would contain for instance:
  