Create bank level Account Notification Webhook
POST /obp/v7.0.0/banks/BANK_ID/web-hooks/account/notifications/on-create-transaction
OBPv4.0.0-createBankAccountNotificationWebhook Roles: CanCreateAccountNotificationWebhookAtOneBank(per bank) WebhookBank
Create a notification Webhook that will fire for all accounts on the specified Bank.
Webhooks are used to call external web services when certain events happen.
For instance, a webhook can be used to notify an external service if a transaction is created on an account.
When an account notification webhook fires it will POST to the URL you specify during the creation of the webhook.
Inside the payload you will find account_id and transaction_id and also user_ids and customer_ids of the Users / Customers linked to the Account.
The webhook will POST the following structure to your service:
{ "event_name": "OnCreateTransaction", "event_id": "9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "bank_id": "gh.29.uk", "account_id": "8ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "transaction_id": "7ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "related_entities": [ { "user_id": "8ca9a7e4-6d02-40e3-a129-0b2bf89de9b1", "customer_ids": ["3ca9a7e4-6d02-40e3-a129-0b2bf89de9b1"] } ] }
Thus, your service should accept the above POST body structure.
User Authentication is Required. The User must be logged in. The Application must also be authenticated.
URL Parameters:
BANK_ID: gh.29.uk
JSON request body fields (3)
- http_method
- GET
- http_protocol
- url
- http://www.example.com/id-docs/123/image.png
JSON response body fields (7)
- bank_id
- gh.29.uk
- created_by_user_id
- http_method
- GET
- http_protocol
- trigger_name
- url
- http://www.example.com/id-docs/123/image.png
- webhook_id
- webhook_id
Example request body
{
"url": "https://localhost.openbankproject.com",
"http_method": "POST",
"http_protocol": "HTTP/1.1"
}Example success response
{
"webhook_id": "fc23a7e2-7dd2-4bdf-a0b4-ae31232a4762",
"bank_id": "gh.29.uk",
"trigger_name": "OnCreateTransaction",
"url": "https://localhost.openbankproject.com",
"http_method": "POST",
"http_protocol": "HTTP/1.1",
"created_by_user_id": "9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1"
}Possible errors (4)
- OBP-20001: User not logged in. Authentication is required!
- OBP-30001: Bank not found. Please specify a valid value for BANK_ID.
- OBP-50000: Unknown Error.
- OBP-20006: User is missing one or more roles: