Webhooks
Build near real-time integrations with API's and other Saas services. When a business event happens in Younium, a webhook event is placed in a queue that when executed will notify
Webhooks are used to build near real-time integrations with API's and other Saas services. When a business event happens in Younium, a webhook event is placed in a queue that when executed will notify subscribers with an HTTP POST request. The request contains relevant information about the business event for the subscriber to use in the receiving system or 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.
The events that trigger a webhook may come from any source, meaning that that calls to the API, users actions in the UI as well as integrations will trigger the webhook.
Available webhooks
Subscribing to webhook event
Subscribing to webhook events can be done in the Younium app in settings>webhooks or using the API webhook endpoint. The endpoint takes two parameters in the body: URL and Events. Events is a list of Event Tags, see Event tags in the table above.
Example (Sandbox):
Headers:
Body:
Response:
Webhook request body
Example of a webhook request body:
Webhook request attempts and delivery
When a webhook event is executed a webhook attempt is created and a POST request is sent to the subscribing URL. In order for the attempt to be successful this request will require a successful response (response code 2xx). Any other response will be handled as a failed attempt. In the table below statuses for a failed webhook attempt are listed with descriptions.
The logs for webhook attempts can be found in settings>webhooks in the Younium app and will show all attempted requests over the past 15 days.
Automatic and manual retries
If a webhook request fails it will automatically be resent every third hour until attempted retries reach 10 times. After that, it will need to be resent manually from the app.
Error notifications
Notifications can be enabled in settings > notifications if a webhook request fails, notifying a user via the app notifications.
Webhooks list
Subscriptions:
SubscriptionUpdated - Triggered when information is edited or when a stock product delivery is made, that doesn't require a change Subscription. Equivalent to patch Subscription.
SubscriptionCancelled - Triggered when a Subscription is cancelled.
SubscriptionRenewed - Triggered when a Subscription is renewed.
SubscriptionReverted - Triggered when a Subscription is reverted.
SubscriptionDeleted - Triggered when a Subscription is deleted.
Try it: https://younium.gitbook.io/younium/api/subscriptions
SalesOrders:
SalesOrderActivated - Triggered when a new sales order is activated.
SalesOrderUpdated - Triggered when information is edited or when a stock product delivery is made.
SalesOrderDeleted - Triggered when a sales order is deleted.
Try it:
Invoices:
InvoicePosted - Triggered when an Invoice is posted.
InvoiceUpdated - Triggered when an Invoice is updated.
Try it: https://younium.gitbook.io/younium/api/invoices
Journals:
JournalPosted - Triggered when a Journal is posted.
Try it: https://younium.gitbook.io/younium/api/journals
Accounts:
AccountsCreated - Triggered when an Account is created.
AccountsChanged - Triggered when an Account is edited.
Try it: https://younium.gitbook.io/younium/api/accounts
Quotes:
QuoteCreated - Triggered when a Quote is created.
QuoteEdited - Triggered when a Quote is edited.
QuoteConverted - Triggered when a Quote is converted to an Order.
Try it: https://younium.gitbook.io/younium/api/quotes
Payments:
PaymentsCreated - Triggered when a payment is created.
PaymentsPosted - Triggered when a payment is posted.
Try it: -
InvoiceBatches:
InvoiceBatchCreated - Triggered when an invoice batch is created.
InvoiceBatchPosted - Triggered when an invoice batch is posted.
InvoiceBatchCancelled - Triggered when an invoice batch is cancelled.
Try it: -
Products:
ProductsCreated - Triggered when a product is created.
ProductsUpdated - Triggered when a product is updated.
ProductsDeleted - Triggered when a Product is deleted. Body: Id and confirmation message.
Last updated