Webhooks

In this tutorial you will learn how to implement Webhooks so that you can receive events from the Upvest Investment API.

Please make sure you meet the following conditions before attempting this tutorial.

 ✓   Understand the concept of a Webhook
Details

If you're not already familiar with the concept of a "Webhook", please take a moment to read our "API Concepts: Webhooks" documentation.


 ✓   Know how to implement an HTTP endpoint
Details

This tutorial is designed for backend engineers with experience implementing HTTP endpoints for API calls. If you do not have this experience seek the help of someone in your organisation who does before continuing.



Let's get started!

A Webhook is an HTTPS endpoint hosted in your backend that will handle requests from the Upvest Investment API. In this way you can trigger actions in your own code based on events happening within Upvest's backend.

INITIATING ASYNCHRONOUS PROCESSES

Many webhooks provide status updates on business processes that are initiated by API calls within the Investment API. The delivery of status via webhooks is not intended to act as a substitute for confirmation of the success or failure of that initial API call.

You should always inspect the returned HTTP status of your API calls to determine whether it was successful or not. Should that call fail, it can be repeated, with an idempotency key.


In order for these HTTP requests to come form Upvest to you, it is necessary to inform the Investment API of the endpoint it should call, and in response to which kind of events. The Investment API provides endpoints for the management of this information. You can create, read, update and delete (CRUD) Webhooks and to test-trigger them to help you integrate with the Investment API.

The following steps will lead you through our recommendations for the implementation of a Webhook handler endpoint, and the use of the Upvest Investment API to create and manage Webhooks.

   Implementation

Webhook implementation is a three step process:

1.1   Implement your Webhook handler

Read this sub-task to understand the requirements for a Webhook handler endpoint within your backend.

1.2   Register your Webhook.

In order for your Webhook to be utilised by the Upvest Investment API, we must be informed of its existence. This registration is performed within the API itself.

Read this sub-task to find out how to register and manage your Webhook.

1.3   Test your Webhook.

Once you've implemented and registered your webhook, it's time to test it. This sub-task explains how you can trigger test requests via the Upvest Investment API.

   Other Webhook Management functions

As well as registering new Webhooks, the Upvest Investment API offers a number of other functions for managing your registered Webhooks.

   Discover the management functions

Read this sub-task to understand the available Webhook management functionality within the Upvest Investment API.

   You're ready to implement Webhooks!

Congratulations! If you've completed all of the tasks above, you're ready to implement Webhooks using the Upvest Investment API.