Automation and integrations
Filling one form at a time is fine for a person. A business usually needs hundreds. This page shows the ways to do that, from the simplest to the most flexible.
If you want to... · Use; Fill one PDF per row of a spreadsheet · Google Sheets; Connect Zapier, Make, n8n or Power Automate · Hooks, or the apps; Fill from your books or your records app · Odoo, Airtable, NocoDB or Baserow, Supabase, or a company database (Workflows); Send many rows from your own code · Batch; Have PhilForms pull from your system every day · Schedules
Hooks
A hook is a private web address for one form. Anything that sends values to it gets the filled PDF back. Because the address itself is the secret, the tool you connect never needs your API key.
Create one under Account, then Automations. Starter plans include 3 hooks and Pro plans 25.
curl -X POST 'https://philforms.com/api/v1/hook/hk_...' \ -H 'Content-Type: application/json' \ -d '{"taxpayer_tin":"123-456-789-000","taxpayer_name":"DELA CRUZ, JUAN"}' \ -o filled.pdf
- Send one set of values and you get one PDF back. - Send a list (or { "row": [...] }; the older rows also works) and you get a job. Its ZIP file is ready to download when it finishes, and it is also sent to the hook's webhook if you set one. - Add ?wait=1 to the address and the hook waits for the job (up to 25 seconds) and answers with how it went: 200 when every row was made, 207 with row_error naming each failed row and why, 202 if it is still running. Use this when your tool should show a failure instead of a success. - A hook can hold preset values, like your company's TIN and address. They fill in under every row, and a blank cell never replaces them. - Pause a hook and it stops answering. Delete it and the address stops working for good. - A hook that bills an organization follows that organization's data policy: its allowed forms when it runs, and its saved values setting when you add preset values.
How to connect the common tools:
Tool · What to set up; Zapier · Add the action "Webhooks by Zapier", choose POST, paste the hook address, and choose JSON.; Make · Add "HTTP, Make a request", choose POST and a JSON body.; n8n · Add an "HTTP Request" node, choose POST and JSON, and set the response format to File.; Power Automate · Add an "HTTP" action. Or import our connector file for ready-made actions.
Google Sheets
Fill one PDF for each row, saved straight to Google Drive.
1. Download the form's column template: https://philforms.com/api/v1/engine/forms/{form_id}/template.csv. Row 1 has the field names. Row 2 has the printed labels and starts with #, so it is skipped. 2. Import it into a sheet. Fill in one row per person or filing. 3. In the sheet, open Extensions, then Apps Script. Paste in philforms-sheets.gs and save. 4. In Project Settings, add a Script Property called PHILFORMS_HOOK_URL with your hook address. Add PHILFORMS_FOLDER_ID too if you want the PDFs in a particular Drive folder. 5. Reload the sheet. A new PhilForms menu appears. Choose "Fill selected rows".
Each row then shows its status and a link to its PDF in Drive. You can also turn on "Fill when a Google Form is submitted" to make a PDF for every new form response.
Batch
From your own code, send many rows at once and get one ZIP file back. One batch takes up to your plan's batch_row_max rows — 1,000, or 200 on the Pro trial (GET /api/v1/plans gives the number for each plan). More than that is refused with 400 and code: "row_limit_exceeded"; split the rows into several batches.
curl -X POST https://philforms.com/api/v1/engine/batch/bir-2307 \ -H "Authorization: Bearer $PHILFORMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"row":[{"payee_tin":"123-456-789-000"},{"payee_tin":"987-654-321-000"}],"file_name_field":"payee_tin"}'
You get a job back right away. Check on it with GET /api/v1/engine/jobs/{id}, then download the ZIP from GET /api/v1/engine/jobs/{id}/download. The ZIP has every sealed PDF plus a manifest.json listing them. manifest.json is { "job_id", "form_id", "row": [ … ] }, one entry per row you sent (counted from 1). Each says what it cost and whether it is complete: { "row": 1, "file": "…pdf", "document_id": "…", "credit_cost": 1, "is_complete": true, "missing_core": [] }. Each PDF costs 1 of your plan's monthly credits (test keys: 0). A refused row costs nothing, and its manifest entry carries the same issue list as a refused fill, plus credit_cost: 0. missing_core has the same shape as in a check: [{ "field", "label" }]. Prepaid credits are not spent by a batch. A row that could not be filled does not stop the others: the job ends completed_with_error, and row_error in the job tells you which rows and why ({ "row": 3, "error": "…" }) without downloading anything. Give a row an external_id (your own employee or record number) and it comes back on that row's manifest entry and in row_error, so a failure maps straight to your record; it is never printed on the form. GET /api/v1/engine/jobs lists your latest jobs.
The whole batch is priced before it starts. Rows that repeat a PDF you already made this month (or an earlier row of the same batch) cost nothing, and so do rows the form's checks refuse; every other row costs 1 credit. If your plan stops at its monthly credits (Free, Student, the trial) and the batch needs more than are left, it is refused up front with 402, code: "quota_exceeded", and the numbers — nothing is filled or charged:
{ "error": "This batch needs 640 credits; 412 of this month's 500 are left on your plan — nothing was filled or charged", "code": "quota_exceeded", "row_count": 650, "credit_needed": 640, "credit_left": 412, "credit_limit": 500, "replay_count": 6, "row_problem_count": 4, "row_problem": [{ "row": 17, "error": ["payee_tin: …"] }], "is_allowed": false }
Plans with overage (Starter, Pro) are never refused for credits; the price check says is_overage and overage_count instead. Add ?dry=1 (or "dry": true in the body) to get that same price and the rows the checks would refuse, without filling anything. A test key is priced against its 500 test PDFs a month (test_pdf_needed, test_pdf_left, code: "test_key_limit").
Failed rows. GET /api/v1/engine/jobs/{id} lists the first 200 failed rows in row_error, with row_error_count (how many failed in all) and is_row_error_truncated: true when there are more. Page through all of them with GET /api/v1/engine/jobs/{id}/errors?offset=200 (limit up to 1,000; the answer's next is the next offset, null at the end), or read them from manifest.json in the ZIP.
How long the ZIP is kept, and deleting it. The ZIP and its manifest are kept for 30 days (an organization can set 1–30 days with job_retention_day), then deleted. DELETE /api/v1/engine/jobs/{id} deletes them now, with the signed download link. The job's own row stays (id, form, counts, status, times — no values), and so does each PDF's line in the ledger (document id, form, the SHA-256 of the PDF and of its values — no values), because that is what POST /api/v1/verify checks: PDFs you already handed out still verify after the delete. A single fill (/engine/fill) keeps no PDF at all — it is sent to you once — so there is nothing to delete; a PDF you keep in the vault (/api/v1/vault) is deleted with DELETE /api/v1/vault/{id}.
Retrying after a timeout? Send an Idempotency-Key header (any unique string, e.g. your own batch id). A repeat of the same key within 24 hours returns the job the first request started (200, Idempotent-Replayed: true) instead of filling — and billing — the rows again; two requests with the same key at the same moment start one job. See Idempotency-Key.
Schedules
A schedule makes PhilForms fetch rows from your system on a timer and fill them. Create one with POST /api/v1/schedules and:
- form_id: the form to fill. - daily_at: a time like "18:00" (Manila time), or interval_minute for every N minutes (5 or more). - source: where to get the rows, for example { "type": "url", "url": "https://yourapp.example/rows" }. That address may return a JSON list of rows or a CSV file (a published Google Sheet works). Add "header": { "Authorization": "Bearer …" } if it needs a key. - webhook_url (optional): where to send the finished ZIP. - is_mail_on_finish (optional): true emails your confirmed address after each run, with the counts and a link to the ZIP. Anyone who has that link can open it for 7 days. A workflow of several forms sends one email per form. To stop the emails, delete the schedule and make it again without this.
For your safety, schedules never call addresses on a private network.
Your own column names
Your sheet probably says TIN No. where the form says payee_tin. Save the match once and every batch, schedule and recipe with those columns fills by itself:
curl -X PUT https://philforms.com/api/v1/mappings/bir-2307 \ -H "Authorization: Bearer $PHILFORMS_API_KEY" -H "Content-Type: application/json" \ -d '{"header":["TIN No.","Full Name","Amount"],"mapping":[{"header":"TIN No.","parameter":"payee_tin"},{"header":"Full Name","parameter":"payee_name"}]}'
The answer lists unmapped_column (columns nothing uses) and unfed_parameter (fields no column fills). Not sure which column is which? POST /api/v1/mappings/bir-2307/propose with {"header": [...]} suggests a match and saves it. Only the column names are looked at, never your values. The next file with the same columns uses the saved match and nothing is asked again.
Recipes
A recipe is one small JSON file that says where the rows come from, which column fills which field, what is the same on every form, and where to send the result. A person or an AI agent can read and edit it.
{ "name": "2307 from the payables sheet", "form_id": "bir-2307", "source": { "type": "url", "url": "https://docs.google.com/spreadsheets/d/…/export?format=csv" }, "mapping": [{ "header": "TIN No.", "parameter": "payee_tin" }, { "header": "Full Name", "parameter": "payee_name" }], "join": [{ "parameter": "payee_registered_address", "header": ["Street", "City"], "separator": ", " }], "constant": { "payor_tin": "123456789000", "payor_name": "ACME TRADING CORP." }, "transform": [{ "parameter": "payee_tin", "step": ["digit"] }, { "parameter": "period_from", "step": ["date:DD/MM/YYYY"] }], "file_name_field": "payee_name", "deliver": { "webhook_url": "https://hooks.example.com/philforms" } }
Save it with POST /api/v1/recipes. Then:
- POST /api/v1/recipes/{id}/run?dry=1 shows mapped_column, unmapped_column and row_count without filling anything or using a credit. - POST /api/v1/recipes/{id}/run makes a batch job (a ZIP, and a webhook if you gave one). Send {"row": [...]} or {"csv": "…"} to use other rows than the source. - "when": { "header": "Civil status", "equals": ["Married", "Widowed"] } makes the form only for the rows whose cell matches (capitals and spaces aside); { "header": "Spouse", "is_filled": true } for rows with anything in that column. The others are counted as skipped_row_count. In a workflow, each person's folder in the ZIP still holds only that person's forms. - "row_mode": "total" makes ONE form for the whole sheet instead of one per row, with the fields in "total_parameter" added up — for example a 1601-EQ whose total tax withheld is the sum of the same payables sheet that makes a 2307 per supplier. The sum is over the rows that run got: a hook that posts one new supplier row makes a 1601-EQ of that one row. For the quarter's return, run the workflow on the whole sheet (from the app, a schedule, or a hook called with an empty body, which reads the workflow's saved source). - "row_mode": "table" with "row_table": "member" makes ONE form with one table line per row: the employees on an SSS R-3 or a PhilHealth RF-1. Map columns to member[0].ss_number and so on; each row takes the next line. Other fields come from constant, your organization's details or the first row. On those two forms, more lines than a page prints continue on more copies in one PDF, for one credit.
No JSON needed: Workflows (in the (i) menu) builds the same recipes as blocks — pick a form, paste a sheet or link one, choose which column fills which box (or press *Suggest the mapping*), add fixed values, add another form from the same sheet, and dry-run it. *Copy as code* shows the recipes it saved.
Run a workflow by API
Running a workflow takes a live key or a sign-in. A test key is refused (test_key_write), because a workflow can carry a saved source and a saved webhook. To try a form with a test key, use POST /api/v1/engine/batch/{id}.
The workflow's id is in its address (/workflows/wf_…). An empty body reads the sheet or link the workflow saved; send row (objects keyed by your column names) or csv to run it on other rows. Add ?dry=1 to see each form's mapping and what is missing without filling anything or using a credit.
curl -X POST "$BASE/api/v1/workflows/wf_abc123/run?dry=1" \ -H "Authorization: Bearer $PHILFORMS_API_KEY" -H "Content-Type: application/json" \ -d '{"row": [{"Full Name": "Juan Santos Dela Cruz", "Date of Birth": "1990-04-12", "TIN": "123-456-789-000"}]}'
In an organization with clients, send client_id to run for one of them: its name, TIN and address fill the blanks in place of your organization's details, values in your rows win, the forms count under that client, and each step lists client_filled. A test key cannot do this.
Without ?dry=1 the answer is a 202 with one batch job per form (step[].job, step[].poll) and a zip_by_person link for one folder per row. Add &combined=1 to it for one PDF per person instead, up to 100 people: all their forms, page after page, and the merged file passes /api/v1/verify as its own document. A row that fills no name or address a form needs makes the run a 400 that names the field; send "allow_incomplete": true to make the forms anyway.
See what a workflow made
GET /api/v1/workflows/:id/run lists the last runs: when, how many rows, and what each form made (the last 50 are kept). GET /api/v1/workflows/:id/run/:runId goes row by row: the document id each form made for that row, and any form that refused it. Only row numbers and ids are kept. Your sheet says who row 7 is. Rows are listed for as long as the run's files are kept.
Read rows from your company database
A workflow can read one table or view straight from your company's database: PostgreSQL, MySQL or MariaDB, Oracle or Microsoft SQL Server. In the Workflows page choose *Company database*, or send the source by API:
{ "type": "database", "engine": "postgres", "host": "db.yourcompany.com", "database": "accounting", "user": "philforms_reader", "password": "…", "table": "accounting.payable_q3" }
- Use a read-only login. Ask your IT team for a user that may only SELECT the one view you name — never an admin. We also run each read in a read-only transaction where the database has one (PostgreSQL, MySQL/MariaDB, Oracle); SQL Server has none, so the login is what keeps it read-only there. - A table or view, never a query. table is a name (payable_q3 or schema.payable_q3). To choose columns or rows, make a view. - Always encrypted. tls is verify (the default: the certificate and the server name are checked) or require (encrypted, certificate not checked — for a server with its own certificate). If your company runs its own certificate authority, send its certificate as ca (PEM) and keep verify. There is no unencrypted mode. - Reachable from the internet. The server must have a public address (open its port to our server in your firewall). Addresses on private networks (10.x, 192.168.x, localhost …) are refused. - Limits. At most 5,000 rows and 32 MB of text per read; a read that takes longer than 20 seconds is stopped. Reads wait their turn: 429 source_busy means try again in a moment. engine oracle uses the service name as database (Oracle needs TCPS on its listener). - Your password is encrypted when the workflow is saved and is never shown again (has_password: true). Change the server, port, user or kind of database and you must type the password again.
A SQLite file works without a server: choose *SQLite file*, or send { "type": "sqlite", "data": "<the file, base64>", "table": "payable" } (at most 5 MB; table only when the file has more than one). We open a temporary copy read-only and delete it after each read.
A recipe gives the same result every time. Run it twice on the same rows on the same day and you get the same PDFs, byte for byte. To date the documents yourself, add "as_of": "2026-09-30". Leave out mapping and the recipe uses your saved column names.
Steps you can use in transform: trim, upper, lower, collapse_space, digit, number, date (or date:DD/MM/YYYY for the order your sheet writes dates in), zip, default:<value>, prefix:<text>, slice:<start>,<end>.
Signatures and photos by link
A signature, thumbmark or ID photo can be a link to the image in your own storage instead of the image itself:
{ "payee_signature": { "url": "https://storage.example.com/signatures/123.png" } }
PhilForms fetches it when it fills the form. It must be a PNG or JPEG of 4 MB or less on the public internet. One fill takes at most 8 links and 8 MB in all, and a batch at most 500 links. A link to a private network is refused, and the error names the field. Links work with an API key or a hook; a fill from a browser sends the picture itself.
Accounting and payroll exports
Already keep your books in Xero or QuickBooks Online, or run payroll in Sprout? Send the export and get rows ready for a batch:
- xero-bill-2307: Xero bills (plus the contacts export for each supplier's TIN) → one BIR 2307 per supplier for a quarter. - qbo-vendor-2307: QuickBooks Online Transaction List by Vendor (plus the Vendor Contact List) → one BIR 2307 per supplier. - sprout-alphalist-2316: the Sprout Payroll annual alphalist → one BIR 2316 per employee.
curl -X POST https://philforms.com/api/v1/accounting-sources/xero-bill-2307/rows \ -H "Authorization: Bearer $PHILFORMS_API_KEY" -H "Content-Type: application/json" \ -d '{"csv":"…bills export…","lookup_csv":"…contacts export…","quarter":"2026-Q3","rate":0.10,"atc":"WC010","constant":{"payor_tin":"123456789000"}}'
Amounts are added up month by month for the quarter. skipped lists every line that was left out and why. GET /api/v1/accounting-sources lists the exports and the vendor page that documents each one's columns.
The 1604-C alphalist
Every 2316 you issue is kept on the register, so the year's alphalist needs no typing. On Certificates, open the register for BIR 2316 and download the alphalist as a PDF or a CSV: every employee in the BIR's columns, minimum wage earners in Schedule 2, with totals.
curl -H "Authorization: Bearer pk_live_..." \ "https://philforms.com/api/v1/certificates/alphalist?year=2025&format=pdf" -o alphalist.pdf
format is json, csv or pdf. If the register holds 2316s from more than one employer, send the employer's TIN in an X-Employer-TIN header. The employer_tin query parameter also works, but a web address is kept in our web server's log for about 14 days and a header is not. Test keys cannot read it.
A 2316 does not show everything the alphalist asks for. These columns stay blank for you to add: nationality, employment status, region, reason of separation, the split of tax withheld between January to November and December, and the previous employer's breakdown. This is not the DAT file you submit: use the BIR's Alphalist Data Entry module for that.
Zapier, Make, n8n and Power Automate
Each has the same parts:
- Fill a form: one row of values in, the sealed PDF out (the form's own fields appear once you pick the form). - Run a workflow (and, on Zapier and n8n, Run a recipe): rows from the step before, or the workflow's own source; one job per form. - Job finished: starts your Zap, scenario or flow when a batch, schedule, recipe or workflow job is done. It signs up for the batch.completed event (POST /api/v1/webhooks) and signs off when you turn it off.
Tool · How to add it; Power Automate · Custom connectors ▸ New ▸ Import an OpenAPI file from URL: https://philforms.com/api/v1/integrations/power-automate.swagger.json. Security: API key, parameter X-Api-Key. Actions: Fill a form, Run a workflow, Batch job status, Download a job's ZIP; trigger: When a batch job finishes.; Make · Not in Make's directory yet: ask us for an invitation. Modules: Fill a form, Run a workflow, Download a job's ZIP, Watch finished jobs.; Zapier · Private app for now: ask us for an invitation.; n8n · Community node n8n-nodes-philforms, not yet published: ask us for the package.
All use your API key. Until a tool is listed in its directory, the hooks above work with any of them.
Webhooks
A webhook is a message PhilForms sends to your server when something finishes. Every webhook is a POST with this header:
X-PhilForms-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + body)>
Every webhook also carries the same value as X-PDFPhile-Signature, the older name, so a receiver written before the rename still works.
Checking it in Node (the raw body, before any JSON parsing):
import crypto from 'node:crypto' function isFromPhilForms(rawBody, header, secret) { const { t, v1 } = Object.fromEntries(String(header).split(',').map(p => p.split('='))) if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false const want = crypto.createHmac('sha256', secret).update(${t}.${rawBody}).digest('hex') return v1?.length === want.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(want)) }
To be sure a message really came from PhilForms, compute the same signature on your side and compare. Ignore any message whose time t is more than five minutes (300 seconds) from your clock — sample/verify refuses it the same way, with is_stale: true and timestamp_age_second.
Try it before you have an endpoint. GET /api/v1/webhooks/sample?event=fill.completed (no key) returns a signed sample exactly as a delivery would arrive: the raw body, the header, and a public sample secret that signs nothing real. Run your receiver's check on it; if it says no, POST /api/v1/webhooks/sample/verify with { "body", "header", "secret" } tells you why (the usual one: the body was parsed and re-serialised before signing — sign the raw bytes).
Two kinds of webhook, two secrets. Which secret signs a message depends on how you asked for it: