Skip to main content
POST
/
api
/
v1
/
invoices-templates
/
preview
Preview template
curl --request POST \
  --url https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices-templates/preview \
  --header 'Content-Type: application/json' \
  --header 'X-Preferred-Language: <x-preferred-language>' \
  --header 'x-admin-api-key: <x-admin-api-key>' \
  --data '
{
  "templateId": "550e8400-e29b-41d4-a716-446655440000",
  "previewData": {
    "invoiceNumber": "INV-2023-001",
    "description": "Monthly subscription fee",
    "amount": 99.99,
    "currency": "USD",
    "planName": "Premium Plan",
    "customerName": "John Doe",
    "customerEmail": "[email protected]",
    "startDate": "2023-01-01T00:00:00Z",
    "renewalDate": "2023-02-01T00:00:00Z",
    "paymentTerms": 30
  }
}
'
"<string>"

Headers

x-admin-api-key
string
required

The API key to access the admin API

X-Preferred-Language
enum<string>
required

Language for the PDF preview

Available options:
ar,
en

Body

application/json

Template ID and optional preview data for customization

templateId
string
required

ID of the invoice template to preview

Example:

"550e8400-e29b-41d4-a716-446655440000"

previewData
object

Preview data to customize the invoice preview

Response

Template preview generated successfully

PDF buffer of the preview invoice