Create a webhook registration
curl --request POST \
--url https://api.pushcash.com/webhook/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.yourdomain.com/webhooks/push",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
'import requests
url = "https://api.pushcash.com/webhook/register"
payload = {
"url": "https://api.yourdomain.com/webhooks/push",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
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: 'https://api.yourdomain.com/webhooks/push',
secret: 'whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
})
};
fetch('https://api.pushcash.com/webhook/register', 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.pushcash.com/webhook/register",
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://api.yourdomain.com/webhooks/push',
'secret' => 'whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
]),
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.pushcash.com/webhook/register"
payload := strings.NewReader("{\n \"url\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\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://api.pushcash.com/webhook/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pushcash.com/webhook/register")
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\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://api.yourdomain.com/webhooks/push"
}{
"url": "https://api.yourdomain.com/webhooks/push"
}{}{}webhook
Create a webhook registration
Register the endpoint which receives global webhook events. Calling this endpoint again replaces the stored registration.
POST
/
webhook
/
register
Create a webhook registration
curl --request POST \
--url https://api.pushcash.com/webhook/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.yourdomain.com/webhooks/push",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
'import requests
url = "https://api.pushcash.com/webhook/register"
payload = {
"url": "https://api.yourdomain.com/webhooks/push",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
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: 'https://api.yourdomain.com/webhooks/push',
secret: 'whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
})
};
fetch('https://api.pushcash.com/webhook/register', 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.pushcash.com/webhook/register",
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://api.yourdomain.com/webhooks/push',
'secret' => 'whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
]),
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.pushcash.com/webhook/register"
payload := strings.NewReader("{\n \"url\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\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://api.pushcash.com/webhook/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pushcash.com/webhook/register")
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\": \"https://api.yourdomain.com/webhooks/push\",\n \"secret\": \"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://api.yourdomain.com/webhooks/push"
}{
"url": "https://api.yourdomain.com/webhooks/push"
}{}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The HTTPS URL for your webhook callback. For more information, see Enabling Webhooks.
Example:
"https://api.yourdomain.com/webhooks/push"
A cryptographically random string of at least 32 characters. If omitted, events are delivered unsigned. For more information, see Enabling Webhooks.
Required string length:
32 - 4096Example:
"whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
Response
Webhook registration updated
A webhook registration for global events
The registered URL. The secret is not returned.
⌘I