Create Webhook
curl --request POST \
--url https://api.coinvoyage.io/v2/webhooks \
--header 'Authorization-Signature: <authorization-signature>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription_events": [
"ORDER_CREATED",
"ORDER_COMPLETED"
],
"url": "https://example.com/webhook"
}
'import requests
url = "https://api.coinvoyage.io/v2/webhooks"
payload = {
"subscription_events": ["ORDER_CREATED", "ORDER_COMPLETED"],
"url": "https://example.com/webhook"
}
headers = {
"Authorization-Signature": "<authorization-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Authorization-Signature': '<authorization-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subscription_events: ['ORDER_CREATED', 'ORDER_COMPLETED'],
url: 'https://example.com/webhook'
})
};
fetch('https://api.coinvoyage.io/v2/webhooks', 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.coinvoyage.io/v2/webhooks",
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([
'subscription_events' => [
'ORDER_CREATED',
'ORDER_COMPLETED'
],
'url' => 'https://example.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization-Signature: <authorization-signature>",
"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.coinvoyage.io/v2/webhooks"
payload := strings.NewReader("{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization-Signature", "<authorization-signature>")
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.coinvoyage.io/v2/webhooks")
.header("Authorization-Signature", "<authorization-signature>")
.header("Content-Type", "application/json")
.body("{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinvoyage.io/v2/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization-Signature"] = '<authorization-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"id": "cuidjkhg3e289y74u5t6v",
"subscription_events": [
"ORDER_CREATED",
"ORDER_COMPLETED"
],
"url": "https://example.com/webhook",
"webhook_secret": "whsec_xxxxx"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}webhooks
Create Webhook
Create a new webhook for the authenticated organization to receive event notifications
POST
/
webhooks
Create Webhook
curl --request POST \
--url https://api.coinvoyage.io/v2/webhooks \
--header 'Authorization-Signature: <authorization-signature>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription_events": [
"ORDER_CREATED",
"ORDER_COMPLETED"
],
"url": "https://example.com/webhook"
}
'import requests
url = "https://api.coinvoyage.io/v2/webhooks"
payload = {
"subscription_events": ["ORDER_CREATED", "ORDER_COMPLETED"],
"url": "https://example.com/webhook"
}
headers = {
"Authorization-Signature": "<authorization-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Authorization-Signature': '<authorization-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subscription_events: ['ORDER_CREATED', 'ORDER_COMPLETED'],
url: 'https://example.com/webhook'
})
};
fetch('https://api.coinvoyage.io/v2/webhooks', 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.coinvoyage.io/v2/webhooks",
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([
'subscription_events' => [
'ORDER_CREATED',
'ORDER_COMPLETED'
],
'url' => 'https://example.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization-Signature: <authorization-signature>",
"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.coinvoyage.io/v2/webhooks"
payload := strings.NewReader("{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization-Signature", "<authorization-signature>")
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.coinvoyage.io/v2/webhooks")
.header("Authorization-Signature", "<authorization-signature>")
.header("Content-Type", "application/json")
.body("{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinvoyage.io/v2/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization-Signature"] = '<authorization-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription_events\": [\n \"ORDER_CREATED\",\n \"ORDER_COMPLETED\"\n ],\n \"url\": \"https://example.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"id": "cuidjkhg3e289y74u5t6v",
"subscription_events": [
"ORDER_CREATED",
"ORDER_COMPLETED"
],
"url": "https://example.com/webhook",
"webhook_secret": "whsec_xxxxx"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}Headers
Authorization header format: 'APIKey=<api_key>,signature=,timestamp=<unix_timestamp>'
Body
application/json
Was this page helpful?
⌘I