Skip to main content

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

NameDescriptionTypeRequired
urlThe webhook URL. It must be HTTPS.string
trigger_onThe list of the events which trigger the webhook.string
encoding_typeThe encoding type of the webhook. Possible value: jsonstring
request_typeThe request type of the webhook. Possible value: basicstring

Trigger On Types

ValueDescription
transaction.initiateTriggered by a successful transaction initialization.
transaction.pendingTriggered when the transaction status has changed to pending.
transaction.declineTriggered when the transaction has been declined.
transaction.settlementTriggered when the transaction status has changed to settled.
transaction.voidTriggered when the transaction has been voided.
transaction.refundTriggered when the transaction has been refunded.
subscription.createTriggered when the subscription has been created.
subscription.updateTriggered when the subscription has been updated.
subscription.deleteTriggered when the subscription has been deleted.
subscription.cancelTriggered when the subscription has been canceled.
subscription.cancel_by_userTriggered when the subscription has been canceled by user.
subscription.pauseTriggered when the subscription has been paused.
subscription.resumeTriggered when the subscription has been resumed after having been paused.
customer.createTriggered when the customer has been created.
customer.updateTriggered when the customer has been updated.
customer.deleteTriggered when the customer has been deleted.
customer.card.createTriggered when the customer's card has been created.
customer.card.deleteTriggered when the customer's card has been deleted.
customer.ach.createTriggered when the customer's bank account has been created.
customer.ach.deleteTriggered when the customer's bank account has been deleted.
invoice.createTriggered when the invoice has been created.
invoice.updateTriggered when the invoice has been updated.
invoice.archiveTriggered when the invoice has been archived.

Response

CodeDescription
200Success
400Bad Request / Validation error
500Internal Error

Example Usage

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));

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"
}