Skip to main content
API Documentation

Integrate PDF tools into your workflow

Use the iTextMaster REST API to programmatically generate invoices and process PDFs. All API calls are authenticated with API keys and include free-tier access.

Overview

API overview

Use this page as the central API reference for authentication, endpoint patterns, Credits, response headers, and operational rules. For workflow-specific examples and FAQ, open the dedicated tool API pages from the menu.

Authenticated requests

Send x-api-key from server-side code.

Credits billing

1 successful basic PDF API call = 1 Credit.

Tool pages

Each priority API has its own examples and limits.

Quick Start

Get started with the iTextMaster API in two steps.

1

Get your API Key

Sign in to your account, go to the Account page, and create an API key in the API Access section. Each account can have one active key at a time.

2

Make your first request

Use cURL, fetch, or any HTTP client to call the invoice generation endpoint.

cURL
curl -X POST https://itextmaster.com/api/external/invoice-generator/pdf \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "invoiceNumber": "INV-001",
    "from": {
      "name": "Your Company",
      "email": "you@example.com",
      "addressLines": ["123 Main St", "City, Country"]
    },
    "billTo": {
      "name": "Client Name",
      "email": "client@example.com",
      "addressLines": ["456 Oak Ave", "City, Country"]
    },
    "items": [
      {
        "description": "Consulting Services",
        "quantity": 10,
        "rate": 150
      }
    ]
  }' \
  --output invoice.pdf

Developer entry points

Tool API pages

Use these dedicated pages for workflow-specific examples, limits, error codes, and FAQ.

Merge PDF APIMerge PDF files through the iTextMaster PDF Tools API. 1 Credit per successful request with cURL, Node.js, and Python examples.Split PDF APISplit PDF files into page ranges with the iTextMaster PDF Tools API. Includes cURL, Node.js, Python, Credits, limits, and errors.Rotate PDF APIRotate selected PDF pages by API. Automate page orientation fixes with iTextMaster, 1 Credit per successful request.Delete Pages APIDelete unwanted PDF pages by API. Remove blank, outdated, or sensitive pages with Credits-based PDF automation.Extract Pages APIExtract selected PDF pages by API and return a focused PDF. Includes multipart and JSON base64 examples.Organize PDF APIReorder PDF pages by API. Automate page organization with 1 Credit per successful request.Add Watermark APIAdd text watermarks to PDFs by API. Brand, classify, or mark documents with 1 Credit per successful request.Header Footer APIAdd headers and footers to PDFs by API. Automate document labels, dates, and page context.Page Numbers APIAdd page numbers to PDFs by API with cURL, Node.js, Python, Credits, limits, and error documentation.Flatten PDF APIFlatten PDF annotations and form fields by API. Create static PDFs for sharing, archiving, or compliance workflows.Form Filler APIFill PDF form fields by API and optionally flatten the result. Automate PDF forms with Credits-based billing.Remove Metadata APIRemove PDF metadata by API before sharing files externally. Includes examples, limits, response headers, and FAQ.Edit Metadata APIEdit PDF title, author, subject, and keyword metadata by API. Use 1 Credit per successful request.Crop PDF APICrop PDF margins or page boxes by API. Automate page cleanup for scanned and generated PDFs.Reverse Pages APIReverse PDF page order by API. Fix back-to-front scans and batch document ordering issues.Invoice Generator APIGenerate PDF invoices from JSON with the iTextMaster Invoice Generator API. Includes cURL, Node.js, Python, Credits, errors, and FAQ.HTML to PDF APIConvert HTML to PDF by API with Credits billing, cURL, Node.js, Python, multipart, JSON, errors, limits, and response headers.Webpage to PDF APIConvert a public webpage URL to PDF by API. Includes pricing, examples, rate behavior, limits, errors, and response headers.PDF Redaction APIApply PDF redaction boxes by API and return a redacted PDF. Includes pricing, examples, limits, errors, headers, and FAQ.PDF OCR APIPlan PDF OCR automation with iTextMaster API examples, pricing, limits, response headers, and related PDF tools.

Authentication

All API requests require an API key passed via the x-api-key header. Keys are prefixed with itm_live_ and are only shown once at creation time.

HTTP Header
x-api-key: itm_live_your_api_key_here

Security note: Never expose your API key in client-side code or public repositories. Use environment variables and server-side proxies.

Endpoints

POST/api/external/invoice-generator/pdf

Generate a PDF invoice from a JSON payload. Returns the rendered PDF file directly.

Invoice Generator API landing page

Request Headers

HeaderRequiredDescription
x-api-keyYesYour API key (itm_live_...)
Content-TypeYesapplication/json

Request Body

Request Body (JSON)
{
  "invoiceNumber": "INV-001",       // required
  "from": {                          // required
    "name": "Your Company",
    "email": "you@example.com",
    "phone": "+1-555-0100",
    "addressLines": ["123 Main St"],
    "taxId": "US12345678"
  },
  "billTo": {                        // required
    "name": "Client Name",
    "email": "client@example.com",
    "addressLines": ["456 Oak Ave"]
  },
  "items": [                         // required, at least 1
    {
      "description": "Consulting",
      "quantity": 10,
      "rate": 150
    }
  ],
  "currency": "USD",                 // optional, default USD
  "taxRate": 0.1,                    // optional, e.g. 0.1 = 10%
  "notes": "Payment due in 30 days", // optional
  "dueDate": "2026-05-12",           // optional
  "issueDate": "2026-04-12"          // optional
}

Response Codes

200PDF file with X-Credits-Charged and X-Credit-Balance headers
401{ "error": "invalid_api_key" }
402{ "error": "insufficient_credits", "creditsRequired": 1, "creditBalance": 0 }
POST/api/external/pdf-tools/:toolId

Run first-stage pdf-lib based operations through the API. Each successful API request costs 1 Credit. Failed processing attempts are refunded.

Credits

1 basic PDF API call = 1 Credit

Output

PDF for single-file results, ZIP for multi-file split results

Balance headers

Read X-Credits-Charged and X-Credit-Balance

Headers

NameRequiredDescription
x-api-keyYesYour account API key.
Content-TypeYesUse application/json or multipart/form-data.

JSON request

Use this format when your app already has base64 PDF bytes.

Merge PDFs with JSON
curl -X POST https://itextmaster.com/api/external/pdf-tools/merge-pdf \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "files": [
      { "name": "a.pdf", "dataBase64": "JVBERi0xLjcK..." },
      { "name": "b.pdf", "dataBase64": "JVBERi0xLjcK..." }
    ],
    "options": {}
  }' \
  --output merged.pdf

Multipart request

Use file for one PDF and repeated files fields for tools that accept multiple PDFs.

Split PDF with multipart/form-data
curl -X POST https://itextmaster.com/api/external/pdf-tools/split-pdf \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'file=@input.pdf;type=application/pdf' \
  -F 'options={"mode":"ranges","ranges":[{"start":1,"end":2},{"start":3,"end":5}]}' \
  --output split-results.zip

Supported tool IDs and options

toolIdFilesExample options
merge-pdf2+ PDFs{}
split-pdf1 PDF{"mode":"ranges","ranges":[{"start":1,"end":3},{"start":4,"end":8}]}
rotate-pdf1 PDF{"angle":90,"pages":[1,3,5]}
delete-pages1 PDF{"pages":[2,4]}
extract-pages1 PDF{"pages":[1,2,5]}
organize-pdf1 PDF{"pageOrder":[3,1,2,4]}
edit-metadata1 PDF{"title":"Report","author":"iTextMaster","subject":"Q2","keywords":"pdf,api"}
remove-metadata1 PDF{}
page-numbers1 PDF{"position":"bottom-center","format":"page-of-total","startNumber":1,"fontSize":12}
add-watermark1 PDF{"type":"text","text":"CONFIDENTIAL","position":"diagonal","opacity":0.25,"fontSize":48}
header-footer1 PDF{"header":{"center":"{date}"},"footer":{"right":"Page {page} of {total}"},"pageRange":"all"}
flatten-pdf1 PDF{}
form-filler1 PDF{"fields":{"Name":"Ada Lovelace","Approved":true},"flatten":true}
add-blank-page1 PDF{"position":"end","pageSize":"A4"}
reverse-pages1 PDF{}
crop-pdf1 PDF{"cropBox":{"x":36,"y":36,"width":540,"height":720},"pages":"all"}
remove-annotations1 PDF{}

Responses

200PDF or ZIP file with X-Credits-Charged and X-Credit-Balance headers
401{ "error": "invalid_api_key" }
402{ "error": "insufficient_credits", "creditsRequired": 1, "creditBalance": 0 }
422{ "error": "pdf_tool_processing_failed" }

Credits and limits

Credit unit

1,000 Credits = $1

Every signed-in user also receives 100 free API Credits each month.

Basic PDF API

1 Credit / call

Only API calls consume Credits. Browser-local website tools do not consume Credits; server-side website tools may apply fair-use limits.

Operational guide

Build reliable PDF API workflows

When to choose the API

  • Use the API for server-side automation, scheduled jobs, batch processing, and app integrations that should run without a browser UI.
  • Keep manual browser-local tools for private one-off work: they do not require login or Credits; server-side website tools may apply fair-use limits.
  • Each successful basic PDF Tools API request uses 1 Credit; failed processing attempts are refunded automatically.

Best files and requests

  • Use PDFs that open normally and are not encrypted, corrupted, or intentionally restricted.
  • Send multipart requests for normal file uploads, or JSON requests with base64 data when files already live in your app.
  • For large batches, process documents in smaller groups and monitor X-Credits-Charged and X-Credit-Balance headers.

Common API limits

  • Browser-only tools and complex WASM workflows may not be exposed as API endpoints yet.
  • Scanned files, unusual fonts, damaged PDFs, and complex layers can still affect output quality.
  • Insufficient Credits return 402 responses; every signed-in user receives 100 free API Credits each month.

Website tools vs API privacy

  • Website tools process files locally in the browser for private manual workflows.
  • API calls intentionally send files to the server so your application can automate processing.
  • Use website tools when you do not want to upload files; use the API when automation is more important than local-only processing.

What to do if API processing fails

  • Check the HTTP status, response body, and credit headers before retrying.
  • Retry with a smaller file, fewer pages, or a simpler request body when a PDF is very large or complex.
  • Unlock encrypted PDFs, repair damaged files, or test the same file in the website tool to isolate file-specific issues.

Get an API Key

Sign in to create an API Key, use your 100 monthly free API Credits, and buy additional Credits only when automation volume grows.