Introduction
Webhooks are used to build near realtime integrations with API's and other Saas services. When a business event happens in Younium, an event is placed in a queue that when executed will notify subscribers with a HTTP POST request. The request contains relevant information about the business event for the subscriber to use in the receiving system/platform.
An alternative to Webhooks is to make scheduled API requests on a frequent basis, using Webhooks is more efficient and normally provides a much better user experience.
What business are supported by Webhooks:
At this point, the following endpoints are implemented:
- Subscription Created
- Subscription Changed
- Subscription Cancelled
- Subscription Renewed
- Subscription Updated
- Invoice Posted
- Journal Posted
- Account Created
- Account Changed
Event | Event Tag |
New subscription activated |
SubscriptionActivated
|
Subscription changed (change order) |
SubscriptionChanged
|
Subscription cancelled |
SubscriptionCancelled
|
Subscription renewed | SubscriptionRenewed |
Subscription updated |
SubscriptionUpdated
|
Invoice posted |
InvoicePosted
|
Journal posted |
JournalPosted
|
Account Created |
AccountCreated
|
Account Changed |
AccountChanged
|
How to register a Webhook to your service
The easiest way is to register a webhook in the Younium application: Settings > Webhooks
You can also register a Webhook by making a POST request to the Webhooks endpoint
The Webhooks endpoint take two parameters in the body: URL and Events. Events is a list of Event Tags, see Event tags in the table above.
Example (Sandbox):
POST https://apisandbox.younium.com/Webhooks
Header:
Authorization: Bearer [access token from auth]
Content-Type: application/json
Body:
{
"url": "URL TO YOUR SERVICE",
"events": [
"InvoicePosted"
]
}
You can Delete your Webhook with a DELETE operation on the same endpoint.