Skip to main content
POST
/
api
/
v1
/
invoices-templates
Create invoice template
curl --request POST \
  --url https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices-templates \
  --header 'Content-Type: application/json' \
  --header 'x-admin-api-key: <x-admin-api-key>' \
  --data '
{
  "name": "Standard Template",
  "components": {
    "requiredFields": {
      "invoiceNumber": true,
      "date": true,
      "amount": true,
      "customerDetails": true
    },
    "showCompanyDetails": true,
    "showCustomerDetails": true,
    "showLineItems": true,
    "showPaymentTerms": true,
    "showFooter": true,
    "showLogo": true,
    "companyDetails": {
      "companyName": "Company Name",
      "companyAddress": "Company Address",
      "companyCity": "City",
      "companyCountry": "Country",
      "companyEmail": "[email protected]",
      "logoUrl": "https://example.com/logo.png",
      "vatNumber": "123456789"
    },
    "taxSettings": {
      "enabled": true,
      "rate": 20,
      "label": "VAT"
    }
  },
  "isDefault": false
}
'
{
  "name": "Standard Template",
  "components": {
    "requiredFields": {
      "invoiceNumber": true,
      "date": true,
      "amount": true,
      "customerDetails": true
    },
    "showCompanyDetails": true,
    "showCustomerDetails": true,
    "showLineItems": true,
    "showPaymentTerms": true,
    "showFooter": true,
    "showLogo": true,
    "companyDetails": {
      "companyName": "Company Name",
      "companyAddress": "Company Address",
      "companyCity": "City",
      "companyCountry": "Country",
      "companyEmail": "[email protected]",
      "logoUrl": "https://example.com/logo.png",
      "vatNumber": "123456789"
    },
    "taxSettings": {
      "enabled": true,
      "rate": 20,
      "label": "VAT"
    }
  },
  "isDefault": false
}

Headers

x-admin-api-key
string
required

The API key to access the admin API

Body

application/json

Template configuration including layout, required fields, and display settings

name
string
required

Unique name for the invoice template

Example:

"Standard Template"

components
object
required

Template components configuration that defines the invoice layout and content. Includes: - Required fields (invoiceNumber, date, amount, etc.) - Display settings (company details, customer details, line items) - Company information - Tax settings - Custom fields

Example:
{
"requiredFields": {
"invoiceNumber": true,
"date": true,
"amount": true,
"customerDetails": true
},
"showCompanyDetails": true,
"showCustomerDetails": true,
"showLineItems": true,
"showPaymentTerms": true,
"showFooter": true,
"showLogo": true,
"companyDetails": {
"companyName": "Company Name",
"companyAddress": "Company Address",
"companyCity": "City",
"companyCountry": "Country",
"companyEmail": "[email protected]",
"logoUrl": "https://example.com/logo.png",
"vatNumber": "123456789"
},
"taxSettings": {
"enabled": true,
"rate": 20,
"label": "VAT"
}
}
isDefault
boolean
default:false

Set this template as the default template for new invoices

Response

Template created successfully

name
string
required

Unique name for the invoice template

Example:

"Standard Template"

components
object
required

Template components configuration that defines the invoice layout and content. Includes: - Required fields (invoiceNumber, date, amount, etc.) - Display settings (company details, customer details, line items) - Company information - Tax settings - Custom fields

Example:
{
"requiredFields": {
"invoiceNumber": true,
"date": true,
"amount": true,
"customerDetails": true
},
"showCompanyDetails": true,
"showCustomerDetails": true,
"showLineItems": true,
"showPaymentTerms": true,
"showFooter": true,
"showLogo": true,
"companyDetails": {
"companyName": "Company Name",
"companyAddress": "Company Address",
"companyCity": "City",
"companyCountry": "Country",
"companyEmail": "[email protected]",
"logoUrl": "https://example.com/logo.png",
"vatNumber": "123456789"
},
"taxSettings": {
"enabled": true,
"rate": 20,
"label": "VAT"
}
}
isDefault
boolean
default:false

Set this template as the default template for new invoices