GUIDES

Access check

Block your app on the server after a failed payment or during a paused plan, with GET /v1/customers/{id}/access and the customer.access_* webhooks.

The in-app wall is a convenience: a script blocker or a direct call to your API gets around it. If access to your app must stop after a failed payment, check it on your server too. NoChurn uses one calculation for the wall, this endpoint and the webhooks, so they always agree.

When a customer is restricted

  • Failed payment. The recovery flow is published and running in the mode, its in-app wall is on, and an invoice is still unpaid after the grace period: wall.after_days (0 to 60) after the failure, or annual_grace_days (0 to 90) for an annual plan. 0 restricts as soon as the payment fails.
  • Paused plan. The cancel flow’s pause setting shows a wall (pause.inapp: "wall", off by default) and every live subscription of the customer is paused.

A customer held out of the flow, a customer whose flows are paused, a paused flow or a wall turned off: access stays full.

Check it on your server

Secret key, read access to customers. {id} is any of the customer’s ids (cst_…, cus_… or your user id).

{
  "object": "customer_access",
  "customer": "cst_4w9Nj8EJEvWj7MDT",
  "livemode": false,
  "access": "restricted",
  "reason": "payment_failed",
  "since": "2026-11-11T10:00:00Z",
  "failing_since": "2026-11-04T10:00:00Z",
  "restricts_at": null,
  "invoice": "ninv_1dMMAnaZyLmBNtDB",
  "pay_url": "https://…",
  "cancel_url": "https://cancel.nochurn.sh/a/…",
  "subscription": null,
  "paused_at": null,
  "resumes_at": null
}
  • access: full or restricted; reason: null, payment_failed or paused.
  • since: when the restriction started; restricts_at: when it will start if nothing is paid (null once restricted, or without a wall).
  • pay_url: the same payment link as the recovery emails. cancel_url: a signed page with one Cancel button, valid 30 days. A blocking page must offer both: paying and cancelling (click to cancel).
  • Pause: subscription, paused_at and resumes_at.

Block your app’s pages and API when access is restricted, never the pages to pay or cancel. If NoChurn cannot be reached, let the customer in (fail open): a paying customer is never locked out by an outage.

curl https://api.nochurn.sh/v1/customers/user_123/access -H "Authorization: Bearer $NOCHURN_API_KEY"

Cache it with the webhooks

Rather than calling the API on every request, listen to two webhooks and keep the state on your side:

  • customer.access_restricted: once, when the grace period ends (or the plan is paused with the wall on). It carries customer, access, access_reason, invoice, since, failing_since, grace_days and a readable reason.
  • customer.access_restored: when the invoice is paid, voided or marked uncollectible, recovery stops, the settings change or the plan resumes, with restored_because.

Each transition is sent once. NoChurn re-checks customers with an unpaid invoice under recovery every 10 minutes, and right after a payment. When in doubt, GET /v1/customers/{id}/access is the truth at any time.