Templates

Seven of them, each validated on the way in. A missing invoice total is a 422 naming the field, not a blank line in a customer’s inbox. Every preview here is rendered by the code that sends the real thing, with a sample shop’s branding.

Your branding

Set your name, colour and logo once in your API console, under Settings → API → How your emails look, and every template comes out looking like you. Nothing to pass per request, and no HTML to maintain.

Receipt

After a payment lands. The one email customers keep and search for later.

template
{
"name": "receipt",
"receiptNumber": "R-1042",
"total": "25,000",
"paidOn": "5 August 2026",
"customerName": "Neema",
"paymentMethod": "M-Pesa",
"items": [
{
"description": "Kitenge fabric, 2 metres",
"quantity": 2,
"amount": "18,000"
},
{
"description": "Delivery, Kariakoo",
"amount": "7,000"
}
]
}
Subject: Receipt R-1042: TZS 25,000

Invoice

Asking to be paid. Add payUrl and the button takes them straight to checkout.

template
{
"name": "invoice",
"invoiceNumber": "INV-2026-118",
"total": "480,000",
"dueDate": "19 August 2026",
"customerName": "Neema",
"items": [
{
"description": "Monthly retainer, August",
"amount": "400,000"
},
{
"description": "Extra support hours",
"quantity": 4,
"amount": "80,000"
}
],
"payUrl": "https://example.co.tz/pay/inv-2026-118"
}
Subject: Invoice INV-2026-118 from Duka Langu: TZS 480,000

Order confirmation

Straight after checkout, while they are still wondering whether it worked.

template
{
"name": "order_confirmation",
"orderNumber": "ORD-8891",
"total": "62,000",
"customerName": "Neema",
"items": [
{
"description": "Sandals, size 39",
"quantity": 1,
"amount": "62,000"
}
],
"deliveryEstimate": "Thursday, 7 August",
"deliveryAddress": "Mikocheni B, Dar es Salaam",
"trackUrl": "https://example.co.tz/orders/8891"
}
Subject: Order ORD-8891 confirmed

One-time code

The code leads the subject line, so it is readable from the notification banner.

template
{
"name": "otp",
"code": "482913",
"app": "Duka Langu",
"expiresMinutes": 10
}
Subject: 482913 is your Duka Langu code

Password reset

Says plainly that ignoring it is safe. This is the message phishing imitates most.

template
{
"name": "password_reset",
"resetUrl": "https://example.co.tz/reset/abc123",
"userName": "Neema",
"expiresMinutes": 30
}
Subject: Reset your Duka Langu password

Welcome

First contact after signup.

template
{
"name": "welcome",
"userName": "Neema",
"message": "Your shop is ready. Add your first product and you are live.",
"actionUrl": "https://example.co.tz/start",
"actionLabel": "Open my shop"
}
Subject: Welcome to Duka Langu

Notification

Anything else you need to tell someone. Title, message, optional button.

template
{
"name": "notification",
"title": "Your delivery is on the way",
"message": "The rider left the shop a few minutes ago and should reach you within the hour.",
"actionUrl": "https://example.co.tz/track/8891",
"actionLabel": "Track it"
}
Subject: Your delivery is on the way

Money and dates

#

Amounts are strings you have already formatted, so write "25,000", not 25000. currency defaults to TZS. That is deliberate: formatting shillings automatically means deciding on your behalf that 25,000/= should read "TZS 25,000.00", which is not how anybody writes it here. Dates are strings too, so they read the way your customers expect.

Send anything else

#

Skip template and write the message yourself. Give html, text, or both; whichever you leave out is derived from the other.

json
{
"from": "Receipts <billing@yourdomain.co.tz>",
"to": ["customer@gmail.com"],
"subject": "Your statement for July",
"text": "Asante! Your July statement is attached."
}

Something unclear or wrong? That is a bug in these docs. Write to support@barua.tz.