Create a Subscription Webhook
curl --request POST \
--url https://api.hel.io/v1/webhook/paylink/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [],
"paylinkId": "<string>",
"targetUrl": "<string>"
}
'import requests
url = "https://api.hel.io/v1/webhook/paylink/subscription"
payload = {
"events": [],
"paylinkId": "<string>",
"targetUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: [], paylinkId: '<string>', targetUrl: '<string>'})
};
fetch('https://api.hel.io/v1/webhook/paylink/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hel.io/v1/webhook/paylink/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
],
'paylinkId' => '<string>',
'targetUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hel.io/v1/webhook/paylink/subscription"
payload := strings.NewReader("{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hel.io/v1/webhook/paylink/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hel.io/v1/webhook/paylink/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "679cb0a5eafd565eeab89605",
"paylink": "679bb9db7f3c16eb86bb1c67",
"company": "6683f4efc330474ede1f25aa",
"targetUrl": "https://target-url.com/post-endpoint",
"events": [
"STARTED",
"RENEWED",
"ENDED"
],
"sharedToken": "ZtiSEjZsTNoczv8kvDgtSx5+YO017NOlM/mrqEMj2nnHXi+UfmCQvuqvZlI0eH3JJWrW1D3UDWM+GgK9sVfR0NNPIMwWNV+jcFehjDIMlVq05Ahf2/5tUT/W7qqiHWZy"
}
]{
"message": "Api key or token is invalid",
"code": 401
}Subscriptions
Create a Subscription Webhook
Create a webhook to listen for transaction events on a subscription pay link.
POST
/
v1
/
webhook
/
paylink
/
subscription
Create a Subscription Webhook
curl --request POST \
--url https://api.hel.io/v1/webhook/paylink/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [],
"paylinkId": "<string>",
"targetUrl": "<string>"
}
'import requests
url = "https://api.hel.io/v1/webhook/paylink/subscription"
payload = {
"events": [],
"paylinkId": "<string>",
"targetUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: [], paylinkId: '<string>', targetUrl: '<string>'})
};
fetch('https://api.hel.io/v1/webhook/paylink/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hel.io/v1/webhook/paylink/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
],
'paylinkId' => '<string>',
'targetUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hel.io/v1/webhook/paylink/subscription"
payload := strings.NewReader("{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hel.io/v1/webhook/paylink/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hel.io/v1/webhook/paylink/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [],\n \"paylinkId\": \"<string>\",\n \"targetUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "679cb0a5eafd565eeab89605",
"paylink": "679bb9db7f3c16eb86bb1c67",
"company": "6683f4efc330474ede1f25aa",
"targetUrl": "https://target-url.com/post-endpoint",
"events": [
"STARTED",
"RENEWED",
"ENDED"
],
"sharedToken": "ZtiSEjZsTNoczv8kvDgtSx5+YO017NOlM/mrqEMj2nnHXi+UfmCQvuqvZlI0eH3JJWrW1D3UDWM+GgK9sVfR0NNPIMwWNV+jcFehjDIMlVq05Ahf2/5tUT/W7qqiHWZy"
}
]{
"message": "Api key or token is invalid",
"code": 401
}NOTE: When using Helio on mainnet, set your Base URL to https://api.hel.io and generate your API keys from moonpay.hel.io . For testnet, use https://api.dev.hel.io and generate your API keys from moonpay.dev.hel.io.
Authorizations
Authentication using JWT token
Query Parameters
Your API key can be generated on the Helio Dashboard’s settings page.
Body
application/json
List of subscription lifecycle events that will trigger the webhook. Supported values are 'STARTED', 'RENEWED', and 'ENDED'.
Available options:
STARTED, RENEWED, ENDED The ID of the pay link associated with the subscription.
The URL that will receive webhook notifications for subscription events.
