Guide · Airtable

Airtable webhook: every sale in your base

Your base knows who paid, when, and how much. It does not know which campaign brought them in. One automation with the right trigger, and the missing column fills itself.

What the script sends, what Subtraq replies

201

fetch('https://subtraq.co/api/v1/sales', { method: 'POST', … })
headers: {
  Authorization: 'Bearer stq_sk_…',
  'Content-Type': 'application/json' }

body: { space: "atelier-vitrail",
        amount: 4300,
        currency: "EUR",
        invoiceId: "F-2026-0148",
        email: "claire@exemple.fr" }

→ 201  { ok: true, attributed: true }

The amount is in cents: $43 is written 4300. And attributed tells the truth — true when the sale found its source link, false when it did not. Never an invented origin to look good in a report.

The six steps in Airtable

Read this before looking through the actions

Airtable does not have a "send a webhook" field

In other words: there are about ten lines of JavaScript to paste. This is not development — it's a form written differently — but it is not a toggle either, and you have the right to know that before you start.

If you prefer to write no code at all: a Subtraq webhook to Make or Zapier, and the go-between writes the row in Airtable through its API. Both paths are honest; this one has one fewer link in the chain.

Source: the Run a script action, Airtable support.

What the API expects exactly

Recorded 12 September 2026

The action that does the work, and its limits

It is "Run a script". It calls fetch() with no domain restriction, accepts custom headers, and can read a secret. Documented limits: thirty seconds per request, fifty requests per execution, and a bounded total execution time.

In Airtable, 6 steps

Which fields to create, and which trigger to choose

Automations are available on all Airtable plans, with varying limits. The trigger matters more than you'd think: it decides whether you're sending a sale or an intent to sell.

1

Set up the table: four working fields

An email field for the client, a number field for the amount, a single-select field for the status, and a text field for the invoice ID. That last one is not decorative: it's what prevents counting twice.

2

Store the server key in a secret

Airtable lets you store a sensitive value and call it from a script, rather than writing it in plain text in the code. The Subtraq key starts with stq_sk_, carries the events:write permission, and is shown only once.

3

Create the automation with the right trigger

Choose "When a record matches conditions" and set the condition on the status field — "collected". This is safer than triggering on creation: a row is often created before it is paid.

4

Add the "Run a script" action

Declare the row's fields as input variables, then call fetch in POST to https://subtraq.co/api/v1/sales, with the Authorization header set to Bearer followed by the key. That is where all the work happens.

5

Multiply the amount by a hundred

Subtraq counts in cents and rejects decimal numbers for money. A number field holding 43 must be sent as 4300. It's one line of script, and it's the mistake that divides a revenue figure by a hundred without anyone noticing.

6

Run a test and read the reply in the run history

The automation run shows what the script wrote. Subtraq replies 201 for a new sale, 200 if the invoice ID has already been seen, and in both cases says whether the sale found its source link.

Paths recorded in Airtable support on 12 September 2026 — automation triggers and the when a record matches conditions trigger. Interfaces change: if what you see no longer matches, the source takes precedence.

The tricky part

Linking a base row to the clicked link

The consequence, stated plainly: the click ID does not arrive on its own in an Airtable form. You would need a page of your own that reads st_id and rebuilds the form URL with the right parameter name — feasible, but no longer a setting.

The path with nothing to write is the email address: Subtraq looks for the person within the workspace attribution window, thirty days by default. Same address on both sides, and the sale finds its link.

Prefilling is still useful for other things: passing a campaign name or an ID you already know, and surfacing it later in metadata.

Source: form prefilling, recorded 12 September 2026.

What attribution means

What works, and what does not

Email yes, prefill no

Airtable documents form prefilling via URL parameter, in the form prefill_ followed by the field name. But a Subtraq link passes a parameter named st_id to its destination: the two names do not match up on their own.

The annoying cases, dealt with straight

A shared base is edited by multiple people. That is exactly where duplicates come from.

How do I prevent duplicates?

Through the invoiceId field, and that alone. A row moved back to "collected" sends the same value: Subtraq recognises the duplicate, replies 200, and adds nothing. Without this field, every status change would add a sale — and the total would be wrong in the worst possible direction.

Payment arrives later, after a quote.

This is the most common case, which is why the recommended trigger is "when a record matches conditions" rather than "when a record is created". What remains is the attribution window: beyond it, the sale is recorded but not attributed. For long cycles, extend it before connecting.

Someone edits fifty rows at once.

Watch out: fifty requests in a burst. Airtable caps the number of requests per execution and the total script duration. If you do bulk updates, send in batches instead — and know that the invoice ID protects you from anything sent twice.

What about a refund?

The route does not accept a negative amount, and there is no call that cancels an already-written sale. A refund does not subtract itself: track it with a zero-amount event, and correct the report by hand.

Frequently asked questions

Do I need an Airtable extension?

No. The "Run a script" action is part of automations. It calls an external URL with no domain restriction, unlike the script extension that runs in the browser.

Where do I put the server key?

In a secret, never in plain text in the script: an Airtable base gets shared, and a read-only collaborator should not be able to write revenue into a client's report.

Can Subtraq conversions come INTO Airtable?

Yes, but through a go-between: Subtraq's outgoing webhook wakes Zapier, Make, or n8n, which creates the row via Airtable's API. Airtable does have a "when a webhook is received" trigger, but it expects its own format, not ours.

What amount if the invoice is in dollars?

The currency field takes three letters. Send the amount in its smallest unit and the actual currency: Subtraq does not convert anything, it stores what you declare.

What about a lead with no amount?

The sales route expects an amount. For a lead, the simplest path is still the Subtraq link pasted into a form's redirect field: the form submission becomes a conversion, with no key or script.

You want the reverse: conversions into the base

Subtraq's outgoing webhook notifies Make, and Make writes the row in Airtable. One more link in the chain, zero lines of script.

The Make guide

The next collected row can say where it came from

Create the account, get a server key, add the automation. Ten lines, and the missing column fills itself.

Create a free account