Configure an Order Completion Webhook
By configuring an Order Completion webhook, you can be alerted as soon as an order has been completed. For large orders this means you don't have to constantly ping Runa until you receive a success response.
You can read more about webhooks, including how to validate and troubleshoot them in our webhooks guide.
How to add your endpoint
- From the API menu in your Runa account, click View webhook. This will open your webhook portal, powered by Svix.
- Once in the webhook portal, click Add new endpoint
- Enter the URL where you want to event to send to in the box labelled Endpoint URL
- Optionally, you can add a description of the endpoint
- Open the Message Filtering menu and select the order.completion event.
- Click Create to save your new endpoint
Helpful Tip!
If you don't have a URL or your service isn't quite ready to start receiving events just yet, just press the use Svix Play button to have a unique URL generated for you.
You'll be able to view and inspect all operational webhooks sent to your Svix Play URL, making it effortless to get started.
Testing your Endpoint works
To ensure your endpoint works as expected you can test an event.
- In your webhook portal click on the new endpoint you created
- Select the Testing tab
- Click the Send example button to fire off an event
- Scroll below and you will see the event that was sent, and whether it succeeded or failed. You can also click into the event to see more information.
If you test failed there may be as issue with your endpoint. Please refer to our webhooks guide to help troubleshoot the problem.
Verify your Webhook signatures
Webhook signatures is your way to verify that webhook messages are sent by us. For a more detailed explanation, check out this article on why you should verify webhooks.
How to verify webhooks with Svix Libraries
Our webhook partner Svix offers a set of useful libraries that make verifying webhooks very simple. Here is an example using Javascript:
import { Webhook } from "svix";
const secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw";
// These were all sent from the server
const headers = {
"svix-id": "msg_p5jXN8AQM9LWM0D4loKWxJek",
"svix-timestamp": "1614265330",
"svix-signature": "v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=",
};
const payload = '{"test": 2432232314}';
const wh = new Webhook(secret);
// Throws on error, returns the verified content on success
const payload = wh.verify(payload, headers);
For more instructions and examples of how to verify signatures, check out their webhook verification documentation.
Updated 8 months ago