Invoice template

An invoice with dated line items and tax rates, totals and consumption tax by rate, and bank details. A layout example that includes fields for the items required on a qualified invoice in Japan.

  • A4 portrait
  • 34 merge fields
  • Issued as PDF
  • Company names, people, addresses and amounts in the sample are fictional.
  • The sample layout is in Japanese. You can change any text in the template editor.
Sample of the invoice template (first page of a PDF issued with DocRelay)

Use cases

  • Monthly subscription and maintenance billing
  • Bulk invoice issuance from sales or ERP systems
  • Sending PDF invoices by email

Merge fields

The data fields you send to the API. Fields inside an array are shown as array.field.

FieldDescription
numberInvoice number
issued_atIssue date (YYYY-MM-DD)
customer.nameCustomer name (recipient)
customer.postal_codeCustomer postal code
customer.addressCustomer address
totalTotal amount including tax
subjectSubject
due_datePayment due date (YYYY-MM-DD)
issuer.nameIssuer name
issuer.registration_numberIssuer registration number (T + 13 digits)
issuer.postal_codeIssuer postal code
issuer.addressIssuer address
issuer.telIssuer phone number
issuer.contactContact person
itemsLine items (array)
items.dateTransaction date
items.nameItem or description
items.qtyQuantity
items.unitUnit
items.priceUnit price excluding tax
items.tax_rateTax rate (e.g. 10%, 8%※)
items.amountAmount excluding tax
tax.rate10.baseAmount subject to 10% (excluding tax)
tax.rate10.taxConsumption tax at 10%
tax.rate8.baseAmount subject to 8% (excluding tax)
tax.rate8.taxConsumption tax at 8%
subtotalSubtotal excluding tax
tax_totalTotal consumption tax
bank.nameBank name
bank.branchBranch
bank.typeAccount type
bank.numberAccount number
bank.holderAccount holder
noteNotes

How to use it

  1. In the dashboard, choose Create template, select "Start from a template" and pick "Invoice". The layout and sample data are copied into your project.
  2. Edit the company name, logo and field positions in the template editor to match your own format.
  3. Send the template name and data to POST /v1/renders to issue a PDF.

With a test API key (sk_test_) you can issue documents from the draft. Publish a version before issuing with a production API key. From an AI assistant, specify the same template in the from of the MCP create_template tool.

Create and issue via the API

Create a template by setting from to the template ID (invoice) in POST /v1/templates, then send the template name and data to POST /v1/renders.

1. Create a template from the ready-made one
curl https://api.docrelay.jp/v1/templates \
  -H "Authorization: Bearer $DOCRELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Invoice", "from": "invoice" }'
2. Send data and issue a PDF
curl https://api.docrelay.jp/v1/renders \
  -H "Authorization: Bearer $DOCRELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @invoice.json \
  -o invoice.pdf
invoice.json (sample data; arrays show the first item and long text is shortened)
{
  "template": "Invoice",
  "format": "pdf",
  "data": {
    "number": "INV-2026-0412",
    "issued_at": "2026-10-31",
    "due_date": "2026-11-30",
    "subject": "2026 年 10 月分 ご利用料金",
    "customer": {
      "name": "株式会社見本製作所",
      "postal_code": "530-0000",
      "address": "大阪府大阪市北区例示町4-5-6 見本ビル3F"
    },
    "issuer": {
      "name": "サンプル商事株式会社",
      "registration_number": "T1234567890123",
      "postal_code": "100-0000",
      "address": "東京都千代田区見本町1-2-3 サンプルビル5F",
      "tel": "03-0000-0000",
      "contact": "経理部 山田 太郎"
    },
    "items": [
      {
        "date": "2026-10-01",
        "name": "クラウドサービス利用料(10 月分)",
        "qty": 1,
        "unit": "式",
        "price": 50000,
        "tax_rate": "10%",
        "amount": 50000
      }
    ],
    "tax": {
      "rate10": {
        "base": 106800,
        "tax": 10680
      },
      "rate8": {
        "base": 13200,
        "tax": 1056
      }
    },
    "subtotal": 120000,
    "tax_total": 11736,
    "total": 131736,
    "bank": {
      "name": "見本銀行",
      "branch": "本店営業部",
      "type": "普通",
      "number": "1234567",
      "holder": "サンプルシヨウジ(カ)"
    },
    "note": "本書の金額は、ご契約のプランと 10 月 1 日〜31 日のご利用実績にもとづきます。…"
  }
}

API reference

Early access is open

We are preparing for launch. Pre-register and we will notify you when the service becomes available.