Invoice Templates#
Invoice Templates allow you to create reusable configurations for recurring invoices. Templates define default line items, tax rates, and payment terms.
The Invoice Template object#
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with invtpl_ prefix |
object | string | Always "invoice_template" |
name | string | Template name |
description | string | Template description |
default_line_items | array | Default line items |
default_tax_rates | array | Default tax rate IDs |
payment_terms_days | integer | Days until payment is due |
memo | string | Default memo text |
metadata | hash | Key-value pairs |
created | timestamp | Time at which the object was created |
{
"id": "invtpl_standard",
"object": "invoice_template",
"name": "Standard Monthly Rent",
"description": "Monthly rent invoice for residential units",
"default_line_items": [
{
"description": "Monthly rent",
"amount": 120000,
"currency": "eur"
}
],
"default_tax_rates": [],
"payment_terms_days": 14,
"memo": "Thank you for your prompt payment.",
"created": 1706140800
}Create a Template#
POST /v1/invoice_templates
curl https://api.casapay.com/v1/invoice_templates \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{
"name": "Standard Monthly Rent",
"default_line_items": [
{ "description": "Monthly rent", "amount": 120000, "currency": "eur" }
],
"payment_terms_days": 14
}'Retrieve, Update, Delete, List Templates#
GET /v1/invoice_templates/:id
POST /v1/invoice_templates/:id
DELETE /v1/invoice_templates/:id
GET /v1/invoice_templates