Create a webhook endpoint
curl --request POST \
--url https://api.easner.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"enabled_events": []
}
'import requests
url = "https://api.easner.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"enabled_events": []
}
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({url: '<string>', enabled_events: []})
};
fetch('https://api.easner.com/v1/webhook_endpoints', 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.easner.com/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' => '<string>',
'enabled_events' => [
]
]),
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.easner.com/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"enabled_events\": []\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))
}require 'uri'
require 'net/http'
url = URI("https://api.easner.com/v1/webhook_endpoints")
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 \"url\": \"<string>\",\n \"enabled_events\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"enabled_events": [
"checkout.completed"
],
"livemode": true,
"status": "enabled",
"created": "2023-11-07T05:31:56Z",
"secret": "<string>",
"warning": "<string>"
}{
"error": {
"type": "authentication",
"code": "<string>",
"message": "<string>",
"fields": [
{
"name": "<string>",
"message": "<string>"
}
]
}
}Webhook endpoints
Create a webhook endpoint
Adds an https endpoint in this key’s mode and returns its signing secret once. The owner is emailed. Not idempotent: a retry creates a second endpoint.
POST
/
v1
/
webhook_endpoints
Create a webhook endpoint
curl --request POST \
--url https://api.easner.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"enabled_events": []
}
'import requests
url = "https://api.easner.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"enabled_events": []
}
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({url: '<string>', enabled_events: []})
};
fetch('https://api.easner.com/v1/webhook_endpoints', 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.easner.com/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' => '<string>',
'enabled_events' => [
]
]),
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.easner.com/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"enabled_events\": []\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))
}require 'uri'
require 'net/http'
url = URI("https://api.easner.com/v1/webhook_endpoints")
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 \"url\": \"<string>\",\n \"enabled_events\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"enabled_events": [
"checkout.completed"
],
"livemode": true,
"status": "enabled",
"created": "2023-11-07T05:31:56Z",
"secret": "<string>",
"warning": "<string>"
}{
"error": {
"type": "authentication",
"code": "<string>",
"message": "<string>",
"fields": [
{
"name": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Body
application/json
Minimum array length:
1Available options:
checkout.completed, checkout.async_succeeded, checkout.failed, payment.available, subscription.created, subscription.updated, subscription.canceled, subscription.payment_failed, subscription.trial_ending, refund.created, refund.updated, refund.failed, dispute.created, dispute.updated, dispute.closed, account.updated, customer.created, customer.updated, transfer.created, transfer.completed, transfer.failed, transaction.created, payee.linked, payee.unlinked, payee.relinked, payee.link_confirmation_required, payee.balance.updated, payee.restricted, payee.tax_form.updated, credit.available, payout.created, payout.held, payout.waiting_for_funds, payout.waiting_for_limit, payout.waiting_for_tax_form, payout.completed, payout.failed Response
The endpoint, with its signing secret. The secret is shown once.
Available options:
checkout.completed, checkout.async_succeeded, checkout.failed, payment.available, subscription.created, subscription.updated, subscription.canceled, subscription.payment_failed, subscription.trial_ending, refund.created, refund.updated, refund.failed, dispute.created, dispute.updated, dispute.closed, account.updated, customer.created, customer.updated, transfer.created, transfer.completed, transfer.failed, transaction.created, payee.linked, payee.unlinked, payee.relinked, payee.link_confirmation_required, payee.balance.updated, payee.restricted, payee.tax_form.updated, credit.available, payout.created, payout.held, payout.waiting_for_funds, payout.waiting_for_limit, payout.waiting_for_tax_form, payout.completed, payout.failed 