Skip to main content
POST
/
2025-09
/
webhook_endpoints
Create a Webhook Endpoint
curl --request POST \
  --url https://public-api.stora.co/2025-09/webhook_endpoints \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My New Webhook",
  "api_version": "2025-09",
  "url": "https://example.com/new_webhook",
  "event_types": [
    "credit_note.created"
  ],
  "description": "A new webhook endpoint",
  "metadata": {
    "source": "zapier",
    "external_id": "abc_123"
  }
}
'
import requests

url = "https://public-api.stora.co/2025-09/webhook_endpoints"

payload = {
"name": "My New Webhook",
"api_version": "2025-09",
"url": "https://example.com/new_webhook",
"event_types": ["credit_note.created"],
"description": "A new webhook endpoint",
"metadata": {
"source": "zapier",
"external_id": "abc_123"
}
}
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({
name: 'My New Webhook',
api_version: '2025-09',
url: 'https://example.com/new_webhook',
event_types: ['credit_note.created'],
description: 'A new webhook endpoint',
metadata: {source: 'zapier', external_id: 'abc_123'}
})
};

fetch('https://public-api.stora.co/2025-09/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://public-api.stora.co/2025-09/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([
'name' => 'My New Webhook',
'api_version' => '2025-09',
'url' => 'https://example.com/new_webhook',
'event_types' => [
'credit_note.created'
],
'description' => 'A new webhook endpoint',
'metadata' => [
'source' => 'zapier',
'external_id' => 'abc_123'
]
]),
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://public-api.stora.co/2025-09/webhook_endpoints"

payload := strings.NewReader("{\n \"name\": \"My New Webhook\",\n \"api_version\": \"2025-09\",\n \"url\": \"https://example.com/new_webhook\",\n \"event_types\": [\n \"credit_note.created\"\n ],\n \"description\": \"A new webhook endpoint\",\n \"metadata\": {\n \"source\": \"zapier\",\n \"external_id\": \"abc_123\"\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))

}
HttpResponse<String> response = Unirest.post("https://public-api.stora.co/2025-09/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My New Webhook\",\n \"api_version\": \"2025-09\",\n \"url\": \"https://example.com/new_webhook\",\n \"event_types\": [\n \"credit_note.created\"\n ],\n \"description\": \"A new webhook endpoint\",\n \"metadata\": {\n \"source\": \"zapier\",\n \"external_id\": \"abc_123\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://public-api.stora.co/2025-09/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 \"name\": \"My New Webhook\",\n \"api_version\": \"2025-09\",\n \"url\": \"https://example.com/new_webhook\",\n \"event_types\": [\n \"credit_note.created\"\n ],\n \"description\": \"A new webhook endpoint\",\n \"metadata\": {\n \"source\": \"zapier\",\n \"external_id\": \"abc_123\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "endpoint": {
    "id": "we_c72a94b59dc380a4",
    "api_version": "2025-09",
    "created_at": "2025-02-22T14:41:00Z",
    "creator": {
      "id": "app_531844f4c4837d61"
    },
    "description": "A new webhook endpoint",
    "disabled_at": null,
    "event_types": [
      "credit_note.created"
    ],
    "metadata": {
      "source": "zapier",
      "external_id": "abc_123"
    },
    "name": "My New Webhook",
    "secret": "01a9d2bc4f2301b5313a961ba198b0b900ea49478f9ba86fc8b409a5703a8131",
    "status": "enabled",
    "updated_at": "2025-02-22T14:41:00Z",
    "url": "https://example.com/new_webhook"
  },
  "meta": {
    "request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
    "curies": [
      {
        "name": "bo",
        "href": "https://app.stora.test{rel}",
        "templated": true,
        "title": "Backoffice"
      },
      {
        "name": "sf",
        "href": "https://acme.stora.test{rel}",
        "templated": true,
        "title": "Storefront"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer Token necessary to use API

Body

application/json

Create Webhook Endpoint Request

name
string
required

The name of the webhook endpoint

api_version
enum<string>
required

The API version for the webhook endpoint

Available options:
2025-09
url
string<uri>
required

The URL to which the webhook payloads will be delivered

Pattern: ^https://
event_types
enum<string>[]
required

A list of event types that the webhook endpoint will listen to

Minimum array length: 1
Available options:
contact.churned,
contact.converted,
contact.created,
contact.updated,
contract.created,
contract.signed,
coupon.created,
coupon.updated,
credit_note.created,
credit_note.updated,
deal.created,
deal.lost,
deal.reopened,
deal.stage_changed,
deal.updated,
deal.won,
identity_verification.cancelled,
identity_verification.failed,
identity_verification.processing,
identity_verification.succeeded,
invoice.created,
invoice.finalized,
invoice.marked_uncollectible,
invoice.paid,
invoice.updated,
note.created,
note.updated,
order.abandoned,
order.completed,
order.created,
order.finalized,
protection_level.created,
protection_level.updated,
subscription.cancelled,
subscription.created,
subscription.ended,
subscription.resumed,
subscription.started,
task.completed,
task.created,
task.reopened,
task.updated,
tenancy.auto_reservation.failed,
tenancy.auto_reservation.partially_succeeded,
tenancy.auto_reservation.succeeded,
tenancy.created,
tenancy.started,
unit.available,
unit.created,
unit.deallocated,
unit.occupied,
unit.overlocked,
unit.repossessed,
unit.reserved,
unit.unavailable,
unit.updated,
unit_type.created,
unit_type.updated
description
string | null

Optional description for the webhook endpoint

metadata
object | null

Set of key-value pairs for storing additional information on the webhook endpoint. Learn more about metadata.

Response

201 - application/json

webhook endpoint created

Single Webhook Endpoint

endpoint
object

Webhook Endpoint

meta
object