Webhook Subscriptions
Create a webhook subscription
Create a webhook subscription to deliver webhook notifications to a specified URL endpoint for your application. Requires a destination URL where Dwolla will send notifications and a secret key for webhook validation and security. Returns the location of the created subscription resource. Essential for establishing real-time event notifications and automated integrations with Dwolla’s payment processing events.
POST
/
webhook-subscriptions
cURL
POST https://api-sandbox.dwolla.com/webhook-subscriptions
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
{
"url": "http://myapplication.com/webhooks",
"secret": "sshhhhhh"
}// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
url: "http://myawesomeapplication.com/destination",
secret: "your webhook secret",
};
dwolla
.post("webhook-subscriptions", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'url': 'http://myapplication.com/webhooks',
'secret': 'sshhhhhh'
}
subscription = app_token.post('webhook-subscriptions', request_body)
subscription.headers['location'] # => 'https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$webhookApi = new DwollaSwagger\WebhooksubscriptionsApi($apiClient);
$subscription = $webhookApi->create(array (
'url' => 'http://myapplication.com/webhooks',
'secret' => 'sshhhhhh',
));
$subscription; # => "https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
?>
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
request_body = {
:url => "http://myawesomeapplication.com/destination",
:secret => "your webhook secret"
}
subscription = app_token.post "webhook-subscriptions", request_body
subscription.response_headers[:location] # => "https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
{
"code": "ValidationError",
"message": "Validation error(s) present. See embedded errors list for more details.",
"_embedded": {
"errors": [
{
"code": "InvalidFormat",
"message": "Url must be a valid url.",
"path": "/url",
"_links": {}
}
]
}
}{
"code": "Forbidden",
"message": "The supplied credentials are not authorized for this resource."
}{
"code": "NotFound",
"message": "The requested resource was not found."
}{
"code": "Too Many Requests",
"message": "Please wait a short period of time before re-attempting the request."
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
FlowClient Credentials
- Token URL
- /token
Headers
The media type of the response. Must be application/vnd.dwolla.v1.hal+json
Available options:
application/vnd.dwolla.v1.hal+json Body
application/json
Parameters to create a webhook subscriptions
Response
create
Was this page helpful?
⌘I
cURL
POST https://api-sandbox.dwolla.com/webhook-subscriptions
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
{
"url": "http://myapplication.com/webhooks",
"secret": "sshhhhhh"
}// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
url: "http://myawesomeapplication.com/destination",
secret: "your webhook secret",
};
dwolla
.post("webhook-subscriptions", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'url': 'http://myapplication.com/webhooks',
'secret': 'sshhhhhh'
}
subscription = app_token.post('webhook-subscriptions', request_body)
subscription.headers['location'] # => 'https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216'
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$webhookApi = new DwollaSwagger\WebhooksubscriptionsApi($apiClient);
$subscription = $webhookApi->create(array (
'url' => 'http://myapplication.com/webhooks',
'secret' => 'sshhhhhh',
));
$subscription; # => "https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
?>
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
request_body = {
:url => "http://myawesomeapplication.com/destination",
:secret => "your webhook secret"
}
subscription = app_token.post "webhook-subscriptions", request_body
subscription.response_headers[:location] # => "https://api-sandbox.dwolla.com/webhook-subscriptions/5af4c10a-f6de-4ac8-840d-42cb65454216"
{
"code": "ValidationError",
"message": "Validation error(s) present. See embedded errors list for more details.",
"_embedded": {
"errors": [
{
"code": "InvalidFormat",
"message": "Url must be a valid url.",
"path": "/url",
"_links": {}
}
]
}
}{
"code": "Forbidden",
"message": "The supplied credentials are not authorized for this resource."
}{
"code": "NotFound",
"message": "The requested resource was not found."
}{
"code": "Too Many Requests",
"message": "Please wait a short period of time before re-attempting the request."
}