curl --request POST \
--url https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://hooks.example-transit.example.com/allride-voucher",
"eventTypes": [
"redemption-created",
"redemption-voided",
"catalog-voucher-set-available",
"catalog-voucher-set-unavailable"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://hooks.example-transit.example.com/allride-voucher',
eventTypes: [
'redemption-created',
'redemption-voided',
'catalog-voucher-set-available',
'catalog-voucher-set-unavailable'
]
})
};
fetch('https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints"
payload = {
"url": "https://hooks.example-transit.example.com/allride-voucher",
"eventTypes": ["redemption-created", "redemption-voided", "catalog-voucher-set-available", "catalog-voucher-set-unavailable"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.example-transit.example.com/allride-voucher\",\n \"eventTypes\": [\n \"redemption-created\",\n \"redemption-voided\",\n \"catalog-voucher-set-available\",\n \"catalog-voucher-set-unavailable\"\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"https://hooks.example-transit.example.com/allride-voucher\",\n \"eventTypes\": [\n \"redemption-created\",\n \"redemption-voided\",\n \"catalog-voucher-set-available\",\n \"catalog-voucher-set-unavailable\"\n ]\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints",
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([
'url' => 'https://hooks.example-transit.example.com/allride-voucher',
'eventTypes' => [
'redemption-created',
'redemption-voided',
'catalog-voucher-set-available',
'catalog-voucher-set-unavailable'
]
]),
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;
}Create a webhook endpoint
Registers a receiver and returns its two signing secrets once (firstSecret, secondSecret). Verify x-signing-signature against either. At most 10 endpoints; needs active API access. Endpoints that include billing event types also need view-consumer-billing, and price-terms-* types view-consumer-pricing (403 missing-permission otherwise). See Verifying signatures.
Required permissions: manage-webhooks · API keys: allowed · Recent sign-in: required for dashboard users (15 minutes)
curl --request POST \
--url https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://hooks.example-transit.example.com/allride-voucher",
"eventTypes": [
"redemption-created",
"redemption-voided",
"catalog-voucher-set-available",
"catalog-voucher-set-unavailable"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://hooks.example-transit.example.com/allride-voucher',
eventTypes: [
'redemption-created',
'redemption-voided',
'catalog-voucher-set-available',
'catalog-voucher-set-unavailable'
]
})
};
fetch('https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints"
payload = {
"url": "https://hooks.example-transit.example.com/allride-voucher",
"eventTypes": ["redemption-created", "redemption-voided", "catalog-voucher-set-available", "catalog-voucher-set-unavailable"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.example-transit.example.com/allride-voucher\",\n \"eventTypes\": [\n \"redemption-created\",\n \"redemption-voided\",\n \"catalog-voucher-set-available\",\n \"catalog-voucher-set-unavailable\"\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"https://hooks.example-transit.example.com/allride-voucher\",\n \"eventTypes\": [\n \"redemption-created\",\n \"redemption-voided\",\n \"catalog-voucher-set-available\",\n \"catalog-voucher-set-unavailable\"\n ]\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/partner/v1/webhook-endpoints",
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([
'url' => 'https://hooks.example-transit.example.com/allride-voucher',
'eventTypes' => [
'redemption-created',
'redemption-voided',
'catalog-voucher-set-available',
'catalog-voucher-set-unavailable'
]
]),
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;
}Authorizations
Your API key in Authorization: Bearer <key>. Use vk_test_… keys against the sandbox and vk_live_… keys against production.
Headers
Optional key (1-255 printable ASCII characters, no spaces; a UUID is ideal) that makes this POST safe to retry: the same key with the same request replays the stored response for 24 hours. See Idempotency.
1 - 255^[\x21-\x7E]{1,255}$Body
New webhook endpoint.
Receiver URL: https, port 443 or 8443, publicly resolvable.
Event types (1-30).
1 - 30 elementsA consumer webhook type. Billing types (invoice-*, payment-failed, payment-method-deactivated) need view-consumer-billing, price-terms-* types need view-consumer-pricing. Treat as an open set: new values may be added.
redemption-created, redemption-voided, redemption-entity-created, redemption-link-exhausted, redemption-link-expired, catalog-voucher-set-available, catalog-voucher-set-updated, catalog-voucher-set-activation-scheduled, catalog-voucher-set-activated, catalog-voucher-set-deactivation-scheduled, catalog-voucher-set-deactivated, catalog-voucher-set-unavailable, catalog-voucher-set-stock-low, catalog-voucher-set-depleted, webhook-endpoint-test, invoice-finalised, invoice-paid, invoice-overdue, invoice-voided, payment-failed, payment-method-deactivated, price-terms-change-scheduled, price-terms-acceptance-required, price-terms-accepted Description (at most 200 characters).
200Response
Created
Single-object envelope around a WebhookEndpointWithSecrets.
A webhook endpoint with newly issued secrets.
Show child attributes
Show child attributes