Update Webhook
Endpoint for updating a Webhook.
info
Please be aware that this endpoint requires a Manage Webhooks API Key.
PUT /api/v1/groups/{group_id}/revere_pay/{linked_account_id}/webhooks/{webhook_id}
Request Parameters
Name | Description | Type | Required |
---|---|---|---|
url | The webhook URL. It must be HTTPS. | string | |
trigger_on | The list of the events which trigger the webhook. | string | |
encoding_type | The encoding type of the webhook. Possible value: json | string | |
request_type | The request type of the webhook. Possible value: basic | string |
Trigger On Types
Value | Description |
---|---|
transaction.initiate | Triggered by a successful transaction initialization. |
transaction.pending | Triggered when the transaction status has changed to pending. |
transaction.decline | Triggered when the transaction has been declined. |
transaction.settlement | Triggered when the transaction status has changed to settled. |
transaction.void | Triggered when the transaction has been voided. |
transaction.refund | Triggered when the transaction has been refunded. |
subscription.create | Triggered when the subscription has been created. |
subscription.update | Triggered when the subscription has been updated. |
subscription.delete | Triggered when the subscription has been deleted. |
subscription.cancel | Triggered when the subscription has been canceled. |
subscription.cancel_by_user | Triggered when the subscription has been canceled by user. |
Response
Code | Description |
---|---|
200 | Success |
400 | Bad Request / Validation error |
500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
webhook.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
var requestOptions = {
method: 'PUT',
headers: headers,
redirect: 'follow',
body: {
// request body data
}
};
const group_id = '';
const linked_account_id = '';
const webhook_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/revere_pay/${linked_account_id}/webhooks/${webhook_id}`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
webhook.py
import requests
group_id = ""
linked_account_id = ""
webhook_id = ""
url = "https://api.reverepayments.dev/api/v1/groups/"+group_id+"/revere_pay/"+linked_account_id+"/webhooks/"+webhook_id
headers = {
'Authorization': 'API_KEY'
}
response = requests.request("PUT", url, headers=headers, json={
// request body data
})
print(response.text)
webhook.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
const group_id = ""
const linked_account_id = ""
const webhook_id = ""
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/revere_pay/" + linked_account_id + "/webhooks/"+webhook_id
client := &http.Client{}
body := bytes.NewBuffer(nil)
_ = json.NewEncoder(body).Encode(map[string]any{
// body data
})
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Authorization", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Request
{
"url": "https://webhook.site/ed874d91-5204-4a41-aa9b-224239adc7e9",
"trigger_on": ["transaction.initiate", "transaction.decline", "transaction.settlement"],
"encoding_type": "json",
"request_type": "basic"
}
Example Success Response
{
"id": "62589c1a-07c7-4410-a2dc-8ed2f23d6b49",
"group_id": "3322d0a9-5578-4072-a67b-eb48de1f52c7",
"url": "https://webhook.site/ed874d91-5204-4a41-aa9b-224239adc7e9",
"trigger_on": ["transaction.initiate", "transaction.decline", "transaction.settlement"],
"encoding_type": "json",
"request_type": "basic",
"public_key": "BEGIN RSA PUBLIC KEY...",
"created_at": "2024-07-28T15:11:16.975339432Z",
"updated_at": "2024-07-28T15:11:16.975339432Z"
}