Skip to main content
A server is private software that handles app requests. A paywall event is a request from that server after a person leaves your paywall. It gives Hyzl the facts that it needs for recovery. Start with Send the paywall event for a short setup guide. You can also use an AI code assistant.

Address

Protect the ingest token

The ingest token is the secret that permits your server to send paywall events. On the Install page, this appears as Server key.
  1. Generate the ingest token on the Install page.
  2. Copy the key to your clipboard.
  3. Store it as HYZL_INGEST_TOKEN in your server environment.
  4. Use your platform’s secret command to read the clipboard.
On macOS, use $(pbpaste). On Windows, use Get-Clipboard -Raw. On Linux, use xclip -selection clipboard -o. Do not put this key in a chat, code file, test, log, or screenshot. Anyone with the key can send events for your app and use your Hyzl number. If the key becomes visible, generate a new key on the Install page. A new key replaces the old key at once.

Choose the right moment

Send the event after a signed-in person sees your price and leaves without payment. This moment starts recovery. If you collect the phone number later, send another event with the same userId. The event with the phone number and consent starts the wait.

Fields

Hyzl ignores fields that do not appear in this table.

Match each person to a payment

For RevenueCat, userId must equal the value that your app gives to Purchases.logIn(). The wrong value can make a person appear unpaid after a purchase. For Stripe, send stripeCustomerId when you know it. Also set client_reference_id or metadata.userId on the Checkout Session or Payment Link. Use the same userId in the paywall event. Hyzl checks each available Stripe identifier before contact. If a Stripe check fails, Hyzl waits instead of treating the person as unpaid. Use offerLinks if your checkout has a different secure link for each allowed discount. Each key is a whole discount percent from 0 through 90. The 0 key means the regular price.
Hyzl uses only the links that you send for that person. Each link must follow the same rules as recoveryUrl. Consent is a person’s recorded permission for contact by text or call. Send the real state of your current consent choice. If you do not ask for consent, add an unchecked box beside your optional phone field. Edit this example for your business and legal requirements. Example wording:
I agree that {Your company} and its service providers may contact me by phone call and text message at the number provided, including with automated or AI-assisted technology, about my account and related offers. An AI may answer calls, and calls may be recorded and transcribed. Consent is not a condition of purchase. Message frequency varies. Message and data rates may apply. Reply STOP to opt out. Reply HELP for help. {Terms link} · {Privacy link}
Replace the placeholders with links to your Terms and Privacy Policy. Send the real consent state as consent.attested, either true or false. Never set it to true for every person. Keep the box clear by default. Keep the phone field optional. Hyzl stores a person without consent, but Hyzl does not contact that person.

Examples

curl

Node

Swift

Send in two steps

Responses

Treat 200 and 202 as success. A 202 response also includes these fields:
  • person_id: the Hyzl record for the person.
  • status: the person’s current recovery state.
  • contactable: whether Hyzl has a phone number.
  • consent_attested: the consent state that Hyzl stored.
  • next_action_at: the next planned action time, or null.
A 202 response means that Hyzl stored the event. It does not mean that Hyzl sent a text.

Send from your server

Do not send this event from a browser or mobile app. A public app can expose the ingest token to other people. The future sdk-event endpoint returns 501 sdk_not_available and is not deployed. Send all paywall events to paywall-event from your server.

What happens after the event

  1. Hyzl stores the event.
  2. Hyzl waits for the first step in your Flow.
  3. Hyzl checks the payment provider before each step.
  4. Hyzl stops recovery if the person paid or sent STOP.
  5. Hyzl sends the step if the person remains eligible.
The default Flow waits five minutes, then sends one text. Its later text steps wait one day and three days. Quiet hours use the time zone for your app, not the person’s location. The default quiet hours are 9 p.m. to 9 a.m. in that app time zone. Hyzl holds scheduled texts until quiet hours end. Call steps use their own calling window. Outbound calls are off by default and only call United States and Canada numbers. A reply pauses the Flow for 24 hours while Hazel talks with the person. Hyzl resumes the Flow only after the conversation stops and the person remains unpaid.