Create your first Category and Event Type
After successfully creating an account, the creation of a Category and Event Type must be accomplished.
Create the Category
Let's start by creating a Category on the event registry.
A Category is a logical grouping that Event Types can be associated with one another. There is no rules or limitation on category groupings, but to aid subscribers, the categories should have logical grouping. For example, all Events pertaining to a customer could be conveniently grouped together. Or all Transactional events can be grouped together.
To create a Category:
- Open the Management Portal.
- Select
Categories
in the left sidebar menu. - Press the
Add Event Category
button. - Give the Category a unique name.
- Add a description for the Category.
- Press the
Create
button.
Create the Event Type
Now that you have successfully created your first Category, let's add an Event Type to it.
An Event Type in webhooks specifies the kind of event that triggers the webhook. It defines the particular action or occurrence, such as "customer.created" or "order.completed," that initiates the webhook call.
To create an Event Type for the newly created Category:
- Be sure to be inside the newly created Category.
- Press the
New Event
button. - Name the Event Type.
- Add a brief description to the Event Type.
- Define the schema of the Event Type or allow Qala to generate the JSON schema for you conveniently.
- Press the
Create
button.
Upon the creation of the Event Type we recommend:
- Naming the Event Type with a noun followed by a verb clearly indicates what entity is affected and what action occurred, enhancing readability and understanding. For example, "customer.created" specifies that a customer was created.
- To remove any ambiguity for the Event Type, you can add a brief description denoting what the Event Type is for and when the event is triggered.
- On the schema definition, you can simply copy an existing schema, ensuring it conforms to JSON schema standards or allow Qala to generate the JSON schema for you conveniently. Alternatively, you can create an event without a schema but it’s best practice to define the schema for your subscribers.