Create a webhook endpoint
curl --request POST \
--url https://api.brandgate.dev/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [], description: '<string>'})
};
fetch('https://api.brandgate.dev/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.brandgate.dev/v1/webhook_endpoints");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "webhook_endpoint",
"url": "<string>",
"events": [
"order.created"
],
"description": "<string>",
"status": "enabled",
"disabled_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}webhook_endpoints
Create a webhook endpoint
Events are delivered only for scopes the caller holds. The signing secret is returned once.
Requires the webhooks:write scope.
POST
/
v1
/
webhook_endpoints
Create a webhook endpoint
curl --request POST \
--url https://api.brandgate.dev/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [], description: '<string>'})
};
fetch('https://api.brandgate.dev/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.brandgate.dev/v1/webhook_endpoints");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "webhook_endpoint",
"url": "<string>",
"events": [
"order.created"
],
"description": "<string>",
"status": "enabled",
"disabled_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
apiKeyoauth2
An organization API key (bg_live_…), created in BrandGate under Settings → Developers.
Body
application/json
Response
Success.
Available options:
order.created, order.updated, invoice.created, invoice.updated, product.stock_low Maximum string length:
200Available options:
enabled, disabled Maximum string length:
200Pattern:
^whsec_[A-Za-z0-9_-]{43}$