Docs
Dashboard
View as Markdown

Webhook transformers

Reshape outgoing webhook events for a service that expects its own format, without a relay server.

Attach a transformer to an endpoint in Settings → Developers → Webhooks (or PATCH the endpoint with transformerPluginId). Each attempt runs transform before the event is signed:

function plugin.transform(ctx, input)
  local e = input.event
  if e.type ~= "order.paid" then return { drop = true } end
  local o = e.data.order
  return {
    body = { text = "New order " .. o.number .. " · " .. money.format(o.totalMinor, o.currency) },
    headers = { ["x-event-type"] = e.type },
  }
end

input: event (id, type, createdAt, data) and endpoint (url). Return one of:

  • { body = … }: a table is sent as JSON, a string as is (256 KB). Optional headers: lowercase x- names only, never x-shopfast-*; the Standard Webhooks headers are always ShopFast’s.
  • { drop = true }: nothing is sent and the delivery is closed as done.

The body you return is what gets signed, with the endpoint’s own secret, so receivers that verify keep working. A transformer that fails counts as a failed attempt and is retried on the normal schedule; a transformer that is turned off holds deliveries (they retry) rather than sending unshaped events by surprise. Transformers get no network access.

Was this page helpful?