> ## Documentation Index
> Fetch the complete documentation index at: https://playbook.smedleygroup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring the Webhooks

> How to create the four webhooks (Event, Ticket, Transaction, Checkout) for a Vivenu seller.

## Overview

Vivenu uses webhooks to notify the GKL Platform of events on a seller. The development team creates **four** webhooks per seller: **Event**, **Ticket**, **Transaction**, and **Checkout**. They are configured under **Developer > Webhooks**.

***

## Prerequisites

* Vivenu access for the relevant seller, with **Webhooks** installed under Developer Tools. See [Adding Developer Tools](/software/third-party/vivenu/general/vivenu-developer-tools).
* The hub code confirmed (e.g. `de` for Germany, `us-ca` for US California). See the [naming convention](/software/third-party/vivenu/general/vivenu-naming-convention).
* The HMAC key for this hub, generated in the [New Hub Region SOP](/software/third-party/vivenu/hub-deployment/development/configure-new-hub-region).

***

## Naming Convention

Name each webhook using the format:

```
{CONTROLLER} {REGION_CODE} {ENV}
```

Where `{CONTROLLER}` is `Event`, `Ticket`, `Transaction`, or `Checkout`, `{REGION_CODE}` is the uppercase hub code, and `{ENV}` is `PROD`. For example, the checkout webhook for Germany is `Checkout DE PROD`.

***

## URL

Each webhook uses the same host and stage, changing only the controller segment and the `hubRegion` query parameter:

```
https://en6js5j9r3.execute-api.eu-west-2.amazonaws.com/prod/api/v1/{Controller}/webhook?hubRegion={REGION_CODE}
```

Note the controller segment in the URL is **plural** (`Events`, `Tickets`, `Transactions`, `Checkouts`) while the webhook name is singular. `{REGION_CODE}` is the uppercase hub code, e.g. `DE`.

***

## Creating Each Webhook

Repeat the following for all four webhooks.

<Steps>
  <Step title="Open the Create webhook dialog">
    Navigate to **Developer > Webhooks** and click **Create**.

    <img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/create-webhook.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=dfdcfadaf7db4dddf8bf13bae90b80b3" alt="The Create webhook dialog" width="960" height="1722" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/create-webhook.png" />
  </Step>

  <Step title="Set the name and URL">
    Enter the **Name** and **URL** for this webhook using the conventions above, taking the controller segment and events from the [webhook reference](#webhook-reference) table.
  </Step>

  <Step title="Set the HMAC key">
    Take the HMAC key generated for this hub in the [New Hub Region SOP](/software/third-party/vivenu/hub-deployment/development/configure-new-hub-region), **base64 encode** it, and paste the encoded value into the **HMAC Key** field.

    <Warning>
      Do not use the **Generate HMAC Key** button in Vivenu. The key must match the value stored in the GKL API configuration so the receiving API can validate incoming webhooks.
    </Warning>
  </Step>

  <Step title="Select the events">
    Under **Events**, select the events for this webhook as listed in the [webhook reference](#webhook-reference) below.
  </Step>

  <Step title="Activate and save">
    Enable the **Active** toggle at the top of the dialog, then click **Save Changes**.
  </Step>
</Steps>

***

## Webhook Reference

| Webhook name                | URL controller segment | Events                                                                                                          |
| --------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------- |
| `Event {REGION} PROD`       | `Events`               | `event.created`, `event.updated`, `event.deleted`                                                               |
| `Ticket {REGION} PROD`      | `Tickets`              | `ticket.created`, `ticket.updated`                                                                              |
| `Transaction {REGION} PROD` | `Transactions`         | `transaction.complete`, `transaction.reservedBySystem`, `transaction.canceled`, `transaction.partiallyCanceled` |
| `Checkout {REGION} PROD`    | `Checkouts`            | `checkout.completed`, `checkout.aborted`, `checkout.detailsSubmitted`                                           |

The selected events for each webhook should match the screenshots below.

<Steps>
  <Step title="Event webhook">
    <img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/event-events.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=aa207a90954f1cc404e10885114b6eaa" alt="The selected events for the Event webhook" width="474" height="600" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/event-events.png" />
  </Step>

  <Step title="Ticket webhook">
    <img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/ticket-events.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=5248718c15fcf4f3713fe7d90ba5cf4f" alt="The selected events for the Ticket webhook" width="554" height="600" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/ticket-events.png" />
  </Step>

  <Step title="Transaction webhook">
    <img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/transaction-events.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=27adbf5bf9e7b46df216e553246f8d4b" alt="The selected events for the Transaction webhook" width="554" height="600" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/transaction-events.png" />
  </Step>

  <Step title="Checkout webhook">
    <img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/checkout-events.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=7cdd7b5a1436fa798638bbf67480fd16" alt="The selected events for the Checkout webhook" width="554" height="600" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/checkout-events.png" />
  </Step>
</Steps>

***

## Confirming the Webhooks

Once all four are saved, the **Webhooks** list should show each one as active.

<img src="https://mintcdn.com/smedley_group/InEdB1yfdYn2-5Z7/images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/webhooks-result.png?fit=max&auto=format&n=InEdB1yfdYn2-5Z7&q=85&s=386a6e3d16431325d6c51e7ed1c1f90f" alt="The Webhooks list showing all four webhooks active" width="474" height="420" data-path="images/software/third-party/vivenu/hub-deployment/development/configure-webhooks/webhooks-result.png" />
