Home / Docs / Webhooks

Webhooks: tell your other tools when a client buys, renews or cancels

A webhook is a URL that another tool gives you. Paste it into Settings → Integrations → Webhooks and GYMSNA sends that tool a message the moment a client buys, renews, pauses or cancels, a pack runs out or expires, or a payment fails or is refunded: who they are (name and email), which pack or membership, the status, the dates and the amount. It works with Zapier, GoHighLevel (including white-label versions), Make, n8n and your own code. It is one-way: GYMSNA tells the other tool what happened.

What people use it for

Set it up

  1. Get a webhook URL from the other tool (steps for Zapier and GoHighLevel are below).
  2. Add it in GYMSNA. Open Settings → Integrations, scroll to Webhooks, paste the URL, give it a name and choose Every event or only the ones you want. The Integrations tab is for the gym's owner.
  3. Send a test event. Open the webhook, pick an event and click Send test. The other tool receives a sample with a made-up client, marked "test": true, so you can map the fields before a real purchase happens.
  4. Build the automation in the other tool, using the fields listed further down.

A gym can have up to 5 webhooks. The URL must start with https://.

Zapier

  1. Create a Zap and choose Webhooks by Zapier as the trigger, with the event Catch Hook.
  2. Copy the URL Zapier shows (it starts with https://hooks.zapier.com/hooks/catch/) and add it in GYMSNA as above.
  3. Click Send test in GYMSNA, then Test trigger in Zapier. The sample appears with fields such as client email, product name and subscription status.
  4. Add your actions. A Filter or Paths step on type lets one Zap treat a purchase and a cancellation differently.

Webhooks by Zapier is one of Zapier's premium apps, so it needs a paid Zapier plan. Zapier's own prices apply; GYMSNA does not charge for webhooks.

GoHighLevel (and white-label versions of it)

  1. In Automation → Workflows create a workflow and add the trigger Inbound Webhook.
  2. Copy the webhook URL it gives you and add it in GYMSNA as above.
  3. Click Send test in GYMSNA, then pick that sample request in the trigger so the workflow knows the fields.
  4. Add Create/Update Contact and map client.email, client.first_name and client.last_name. Then add Add Contact Tag, Remove Contact Tag or an If/Else on type, product.name or subscription.status to run the right steps.

A simple pattern: one workflow per webhook, an If/Else on type, and tags as the hand-off (for example add member-active on subscription.started and swap it for member-cancelled on subscription.cancelled). Your other workflows can then start from "tag added". Inbound Webhook is a premium trigger in GoHighLevel, so whether it carries a usage charge depends on your plan or agency.

The events

EventWhen it is sent
purchase.completedA one-off payment went through: a class pack, a drop-in, a personal training session or a shop item.
subscription.startedThe first payment of a membership or a recurring pack went through.
subscription.renewedA membership or recurring pack was paid for another period.
subscription.payment_failedA renewal could not be collected. Stripe retries; subscription.renewed follows if a retry succeeds. subscription.booking_allowed says whether the client can still book (see the grace period).
subscription.access_suspendedThe renewal is still unpaid and the client can no longer book on it: straight after the failed payment, or when the gym's grace period runs out. subscription.renewed follows if they pay.
subscription.cancellation_scheduledThe client or the gym asked for it to stop. It runs to the end of the period already paid for, and subscription.ends_at says when.
subscription.reactivatedThat request was withdrawn before the period ended.
subscription.pausedThe subscription was put on hold: payments stop and the client cannot book on it.
subscription.resumedThe hold ended.
subscription.cancelledThe membership or recurring pack has ended and will not renew.
pack.used_upA one-off class pack has no credits left.
pack.expiredA one-off class pack reached its expiry date with credits still on it.
pack.reactivatedA used-up or expired pack can be used again: a cancelled booking gave a credit back, or the gym added credits or extended it.
purchase.refundedA payment was refunded, in full or in part, from GYMSNA or from Stripe's dashboard. refund.full says which.

To manage access accurately:

A checkout that was started and never paid sends nothing. Pack events are sent within about two minutes of the change. A webhook set to receive every event also receives event types added later, so a workflow should ignore a type it does not know.

Failed payments and the grace period

When a renewal fails, Stripe tries the card again over the following days. In Settings → Booking Policy → Failed payments the gym chooses how many days (0 to 30) the client can keep booking in the meantime. 0, the default, stops booking straight away.

What an event contains

Every event is a JSON document with the same shape. Parts that do not apply are null (a one-off purchase has no subscription, a cancellation has no payment).

{
  "id": "evt_4c1d9a7e03b25f6c8a1b2d3e",
  "type": "subscription.renewed",
  "created_at": "2026-11-24T09:30:12.000Z",
  "livemode": true,
  "test": false,
  "gym": { "id": 123, "name": "Northside Coaching" },
  "client": {
    "id": 1042,
    "name": "Alex Sample",
    "first_name": "Alex",
    "last_name": "Sample",
    "email": "alex.sample@example.com",
    "has_account": true
  },
  "product": {
    "type": "membership",
    "id": 7,
    "name": "Monthly Coaching Membership",
    "recurring": true,
    "billing_interval": "month",
    "credits": null,
    "valid_days": null,
    "price": 149
  },
  "subscription": {
    "id": "sub_1Qx7...",
    "status": "active",
    "started_at": "2026-09-24T09:30:00.000Z",
    "current_period_end": "2026-12-24T09:30:00.000Z",
    "next_renewal_at": "2026-12-24T09:30:00.000Z",
    "cancel_at_period_end": false,
    "ends_at": null,
    "cancellation_requested_at": null,
    "paused": false,
    "resumes_at": null,
    "credits_remaining": null,
    "booking_allowed": true,
    "grace_until": null
  },
  "payment": {
    "amount": 149,
    "amount_minor": 14900,
    "currency": "USD",
    "original_amount": 149,
    "discount_code": null,
    "payment_intent_id": "pi_3Qx9...",
    "invoice_id": "in_1Qx9..."
  },
  "pack": null,
  "refund": null
}
FieldMeaning
idThe event's id. A retry carries the same id, so use it to ignore an event you have already handled.
typeOne of the events above.
testtrue only for the samples sent by Send test.
clientName, first and last name, and email address. has_account is false for a guest who paid from a share link and has not finished creating their account yet; id is then null.
product.typepack, membership, or for other one-off payments class (a drop-in), upsell (shop items) and similar.
product.credits, valid_daysFor packs: how many sessions it holds and how long they last.
subscription.statusactive, past_due (a renewal failed), paused or cancelled.
subscription.next_renewal_atWhen the next payment is due. null when it is paused, set to stop, or ended.
subscription.ends_atWhen access ends, once a cancellation is requested or has happened.
subscription.credits_remainingFor a recurring pack: sessions left when the event was sent.
subscription.booking_allowedWhether the client can book on it right now. true on a failed payment only inside the gym's grace period.
subscription.grace_untilOn payment_failed and access_suspended: when the grace period ends (or ended). null when there is none.
packOn pack.* and on a refund of a pack: the client's own pack. id, state (active, used_up, expired, ended), credits_total, credits_remaining, expires_at, purchased_at, and granted (true when the gym gave it without a payment). null on other events.
refundOn purchase.refunded: id, amount (this refund), total_refunded (everything refunded on the payment so far), full, currency, reason. The payment itself is in payment.
payment.amountThe amount as a decimal in payment.currency; amount_minor is the same in cents or pence. For subscription.payment_failed it is the amount that could not be collected, with attempt and next_attempt_at.

Dates are UTC in ISO 8601 format. New fields may be added over time; existing ones keep their meaning.

Delivery and retries

Checking an event really came from GYMSNA

Optional, for your own code. Zapier and GoHighLevel do not need it: their URLs are long and private. Each webhook has a signing secret (shown in the dashboard) and every request carries these headers:

Gymsna-Signaturet=<unix time>,v1=<signature>
Gymsna-EventThe event type
Gymsna-Event-IdThe event's id

The signature is the HMAC-SHA256, in hex, of the timestamp, a full stop and the raw request body, keyed with the signing secret:

const crypto = require('crypto');

function isFromGymsna(rawBody, header, secret) {
  const [, t, v1] = /^t=(\d+),v1=([a-f0-9]+)$/.exec(header || '') || [];
  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;   // older than 5 minutes
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

Use the body exactly as received, before any JSON parsing. New secret in the dashboard replaces the secret at once.

What it does not do

Need an event or a direction that is not here? Email support@gymsna.com.

Troubleshooting