Subscription Webhooks
Set up webhooks for subscriptions to track when they start, renew, and end
You can set up webhooks for your subscription payments to receive events when a user starts a new subscription, renews an existing one or when a subscription is ended.
Setting up a webhook
NOTE: When using the production environment (app.hel.io)
, set your API endpoint to api.hel.io/v1
and generate API keys there. For the development environment, use api.dev.hel.io/v1
and generate API keys from app.dev.hel.io
.
API Endpoint:
https://api.hel.io/v1/webhook/paylink/subscription
HTTP Method:
POST
Required Query Parameters:
?apiKey={Your public key here}
Required Headers:
Authorization: Bearer {Your API Token here}
Request Body:
“STARTED” – Triggered when a subscription begins after payment.
“RENEWED” – Triggered when a subscription is renewed.
“ENDED” – Triggered when a subscription expires or is canceled due to non-payment.
This is an example of a curl command to register a subscription webhook for paylinkID: 679bb9db7f3c16eb86bb1c67
triggered by the STARTED event upon transaction confirmation.
This sends a POST request to targetUrl: https://target-url.com/post-endpoint
.
The response of this request will look like:
A unique token generated at webhook creation is included with each webhook as authorization: Bearer SHARED_TOKEN, verifying the webhook source as Helio.
Note: Retain this token to authenticate and delete web hooks if needed.
Upon successful payment on Pay Link 679bc67238ad367780fc7cf1
, the targetUrl
will receive an HTTP [POST] request with the following payload:
Note: When you create or list Pay Link webhooks, a sharedToken
is generated. This token is sent to your endpoint as authorization: Bearer SHARED_TOKEN
to validate that the webhook originates from Helio.
Last updated