Webhooks & Event Triggers

Event Triggers (API)

Each time a specific Arcadier API is called, a POST request can be sent to your webhook with a payload containing relevant information about the event. More details here.

How They Work

Marketplaces have many events happening at once across its pages and users. Those events might be an item being created, a purchase just being completed or a user signing up. Sometimes customizations, in the form of plug-ins or custom code, depend on the exact moment these events occur to perform a very specific task like:

  • notifying the buyers that a new item was created
  • notifying the admin that a new user registered
  • sending the amount of a transaction to a 3rd party loyalty points calculator.

To enable this type of customizations, Arcadier provides event triggers which act as alerts that can be attached to your own webhooks or to Arcadier's own APIs. The events that Arcadier's event triggers support are listed below, as well as the triggering action.

How to Access Event Triggers From the Admin Portal

To access the Event Trigger Hooks Tool:

  1. Login to your marketplace's admin portal
  2. Navigate to https://{your-marketplace}/admin/event-triggers/index

Connecting Webhooks to Arcadier's Event Triggers

1. Click on Add new Event.


2. Choose the event which will trigger your webhook.


3. Copy & Paste your webhook URL in the URI input field.


4. Save

Note: Mulitple events can be connected to a single webhook URI.

Event Triggers

Payload

Invoices

Invoice is Created

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Invoice is Paid For

Trigger

  • A successful checkout made using a payment gateway that has been set up using a generic payment method.

Or

  • The merchant setting their Delivery Status to "Delivered" on the merchant portal.

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Orders

Order is Created

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Order is Updated

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Carts

Added an item to cart

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Edited an item in a cart

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Deleted an item from a cart

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Categories

Created a Category

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Updated a Category

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Deleted a Category

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Shipping/Delivery Methods

Update Shipping/Delivery Method

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Delete Shipping/Delivery Method

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Items

Created an Item

Trigger

  • A successful call with the following API: Create Item.

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Updated an Item

Trigger

  • A successful call with the following API: Edit Item.

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Deleted an Item

Trigger

  • A successful call with the following API: Delete Item.

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

Users

User is Created

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

User is Updated

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

User is Deleted

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

User Addresses

User Address is Created

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

User Address is Updated

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

User Address is Deleted

Trigger

Payload

The JSON data below is the complete structure of the basic information that will sent as a POST request to your webhook.

Payload

JS Custom Triggers (non-API)

For "non-API call" events, custom triggers can be created to detect events that happen on Arcadier's front-end. Here are some examples with sample code:


Possible use for these triggers - Vetting by admin:


How to install custom triggers

For example, if you want to install Item Creation as a plug-in.

  1. Download the repository
  2. Extract all the content of the zip file
  3. In the resulting extracted folder, fo to Item Creation folder.
  4. Compress admin and user together.
  5. The resulting zip file is what you upload to your developer dashboard.

Template for Custom Trigger

This Plug-In is a template for you to use if you wish to trigger your own action when an item is created. The source code is found in the {root}/user/scripts/scripts.js folder.

You can write the customization you want in the function "customAction(id, merchant)":
Check on the code on the right

Arguments:

  • id - The item GUID (already taken care of by the template)
  • merchant- the merchant GUID (already taken care of by the template) You can add more arguments - just remember to update line 25 where the function is implemented:

For example, if you want to make sure the item is made non-purchasable right after creation, use the following snippet: Check on the code on the right


When installing this plug-in, please create a custom table on the developer dashboard with the following properties:

Custom Table name: cache

  • "item" - string
  • "status" - Integer
  • "merchant" - string
  • "name" - string

You can add names, or change these names, but you'll have to edit the scripts accordingly.


function customAction(id, merchant)

Non-purchasable right after creation