Finance template

Bahrain VAT Invoice

National Bureau for Revenue (NBR) compliant bilingual tax invoice for Bahrain businesses. VAT 10%, Decree-Law 48 / 2018.

Pro, Business & Scale plansCountry: BHLanguage: ar+enBH-NBR
slug: bh-vat-invoiceRendered with sample data
01

Quick start

Reference the template by its slug and pass your data. The same call works from any language; pick whichever fits your stack. Replace $KAMY_API_KEY with a key from the dashboard.

curl
curl https://kamy.dev/api/v1/render \
  -H "Authorization: Bearer $KAMY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateSlug": "bh-vat-invoice",
    "data": {
      "invoiceNumber": "BH-2026-00387",
      "issueDate": "2026-04-15",
      "supplyDate": "2026-04-12",
      "placeOfSupply": "Manama, Bahrain",
      "reverseCharge": false,
      "currency": "BHD",
      "supplier": {
        "name": "Pearl Software Solutions W.L.L.",
        "trn": "200123456700001",
        "address": [
          "Office 22, 9th Floor, Al Moayyed Tower",
          "Seef District, Manama 0117",
          "Kingdom of Bahrain"
        ],
        "email": "[email protected]",
        "phone": "+973 1771 5544",
        "iban": "BH67 BMAG 0000 1299 1234 56"
      },
      "recipient": {
        "name": "Gulf Aluminum Industries B.S.C.",
        "trn": "200987654300001",
        "address": [
          "Askar Industrial Area, Block 951",
          "Sitra, Bahrain"
        ],
        "email": "[email protected]"
      },
      // …
    }
  }'
node.js
import { Kamy } from "@kamydev/sdk";

const kamy = new Kamy({ apiKey: process.env.KAMY_API_KEY! });

const { url } = await kamy.render({
  templateSlug: "bh-vat-invoice",
  data: {
    "invoiceNumber": "BH-2026-00387",
    "issueDate": "2026-04-15",
    "supplyDate": "2026-04-12",
    "placeOfSupply": "Manama, Bahrain",
    "reverseCharge": false,
    "currency": "BHD",
    "supplier": {
      "name": "Pearl Software Solutions W.L.L.",
      "trn": "200123456700001",
      "address": [
        "Office 22, 9th Floor, Al Moayyed Tower",
        "Seef District, Manama 0117",
        "Kingdom of Bahrain"
      ],
      "email": "[email protected]",
      "phone": "+973 1771 5544",
      "iban": "BH67 BMAG 0000 1299 1234 56"
    },
    "recipient": {
      "name": "Gulf Aluminum Industries B.S.C.",
      "trn": "200987654300001",
      "address": [
        "Askar Industrial Area, Block 951",
        "Sitra, Bahrain"
      ],
      "email": "[email protected]"
    },
    // …
  },
});

console.log(url); // signed URL, valid for 1 hour
python
import os, requests

resp = requests.post(
    "https://kamy.dev/api/v1/render",
    headers={"Authorization": f"Bearer {os.environ['KAMY_API_KEY']}"},
    json={
        "templateSlug": "bh-vat-invoice",
        "data": {
          "invoiceNumber": "BH-2026-00387",
          "issueDate": "2026-04-15",
          "supplyDate": "2026-04-12",
          "placeOfSupply": "Manama, Bahrain",
          "reverseCharge": false,
          "currency": "BHD",
          "supplier": {
            "name": "Pearl Software Solutions W.L.L.",
            "trn": "200123456700001",
            "address": [
              "Office 22, 9th Floor, Al Moayyed Tower",
              "Seef District, Manama 0117",
              "Kingdom of Bahrain"
            ],
            "email": "[email protected]",
            "phone": "+973 1771 5544",
            "iban": "BH67 BMAG 0000 1299 1234 56"
          },
          "recipient": {
            "name": "Gulf Aluminum Industries B.S.C.",
            "trn": "200987654300001",
            "address": [
              "Askar Industrial Area, Block 951",
              "Sitra, Bahrain"
            ],
            "email": "[email protected]"
          },
          // …
        },
    },
)
resp.raise_for_status()
print(resp.json()["url"])
02

Sample payload

The full sample data the live preview above renders from. Use it as a starting point for your own integration — every field is optional except those marked required in the schema below.

json
{
  "invoiceNumber": "BH-2026-00387",
  "issueDate": "2026-04-15",
  "supplyDate": "2026-04-12",
  "placeOfSupply": "Manama, Bahrain",
  "reverseCharge": false,
  "currency": "BHD",
  "supplier": {
    "name": "Pearl Software Solutions W.L.L.",
    "trn": "200123456700001",
    "address": [
      "Office 22, 9th Floor, Al Moayyed Tower",
      "Seef District, Manama 0117",
      "Kingdom of Bahrain"
    ],
    "email": "[email protected]",
    "phone": "+973 1771 5544",
    "iban": "BH67 BMAG 0000 1299 1234 56"
  },
  "recipient": {
    "name": "Gulf Aluminum Industries B.S.C.",
    "trn": "200987654300001",
    "address": [
      "Askar Industrial Area, Block 951",
      "Sitra, Bahrain"
    ],
    "email": "[email protected]"
  },
  "lineItems": [
    {
      "description": "ERP integration — Phase 2 delivery",
      "quantity": 1,
      "unitPrice": 4800,
      "netAmount": 4800,
      "vatRate": 10,
      "vatAmount": 480,
      "lineTotal": 5280
    },
    {
      "description": "Monthly platform support — March 2026",
      "quantity": 1,
      "unitPrice": 1250,
      "netAmount": 1250,
      "vatRate": 10,
      "vatAmount": 125,
      "lineTotal": 1375
    }
  ],
  "subtotal": 6050,
  "discountAmount": 0,
  "totalVat": 605,
  "total": 6655,
  "paymentTerms": "Net 30 from issue date.",
  "notes": "VAT 10% per NBR Decree-Law 48 / 2018."
}
03

JSON Schema

The render endpoint validates your payload against this JSON Schema before queuing the render. Validation errors come back with HTTP 400 and a VALIDATION_FAILED code listing every offending path.

json
{
  "type": "object",
  "required": [
    "invoiceNumber",
    "issueDate",
    "supplier",
    "recipient",
    "lineItems",
    "subtotal",
    "totalVat",
    "total"
  ],
  "properties": {
    "invoiceNumber": {
      "type": "string",
      "minLength": 1
    },
    "issueDate": {
      "type": "string"
    },
    "supplyDate": {
      "type": "string"
    },
    "placeOfSupply": {
      "type": "string"
    },
    "reverseCharge": {
      "type": "boolean"
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "exchangeRate": {
      "type": "number"
    },
    "supplier": {
      "type": "object",
      "required": [
        "name",
        "trn"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "trn": {
          "type": "string",
          "pattern": "^[0-9A-Z]{15}$"
        },
        "address": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string"
        },
        "iban": {
          "type": "string"
        }
      }
    },
    "recipient": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "trn": {
          "type": "string",
          "pattern": "^[0-9A-Z]{15}$"
        },
        "address": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      }
    },
    "lineItems": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "unitPrice",
          "netAmount",
          "vatRate",
          "vatAmount",
          "lineTotal"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1
          },
          "quantity": {
            "type": "number",
            "minimum": 0
          },
          "unitPrice": {
            "type": "number"
          },
          "netAmount": {
            "type": "number"
          },
          "vatRate": {
            "type": "number",
            "minimum": 0
          },
          "vatAmount": {
            "type": "number",
            "minimum": 0
          },
          "lineTotal": {
            "type": "number"
          }
        }
      }
    },
    "subtotal": {
      "type": "number"
    },
    "discountAmount": {
      "type": "number"
    },
    "totalVat": {
      "type": "number"
    },
    "total": {
      "type": "number"
    },
    "notes": {
      "type": "string"
    },
    "paymentTerms": {
      "type": "string"
    }
  }
}
Bahrain VAT Invoice template — Kamy PDF API — Kamy