Create system level Account Notification Webhook
POST /obp/v7.0.0/web-hooks/account/notifications/on-create-transaction
OBPv4.0.0-createSystemAccountNotificationWebhook Roles: CanCreateSystemAccountNotificationWebhook WebhookBank
Create a notification Webhook that will fire for all accounts on the system.
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.
JSON request body fields (3)
- http_method
- GET
- http_protocol
- url
- http://www.example.com/id-docs/123/image.png
JSON response body fields (6)
- 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",
"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 (3)
- OBP-50000: Unknown Error.
- OBP-20001: User not logged in. Authentication is required!
- OBP-20006: User is missing one or more roles: