# Notification center

{% hint style="info" %}
More notification API information can be found here: [REST API documentation – Notification Center](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#tag--Core---Notification-Center)
{% endhint %}

A notification configuration with channels is needed to send notifications. We recommend defining different channels for different receiver groups and/or facilities.&#x20;

## Create a notification configuration on network level

Create a configuration on network level for receiving notifications globally, i.e. for all events no matter which facility they apply to.&#x20;

```
PUT https://{YOUR-TENANT-NAME}.fulfillmenttools.com/api/configurations/notifications
```

```json
{
  "channels": [
    {
      "enabled": true,
      "events": [
        "ROUTING_PLAN_NOT_ROUTABLE"
      ],
      "receiver": [
        {
          "email": "user@example.com",
          "language": "de_DE"
        }
      ],
      "type": "EMAIL"
    }
  ],
  "version": 1
}
```

## Create a notification configuration on facility level

Create a configuration on facility level for receiving notifications only for specific facilities, e.g., only for orders that are routed to a specific facility.&#x20;

```
PUT https://{YOUR-TENANT-NAME}.fulfillmenttools.com/api/facilities/{facilityRef}/configurations/notifications
```

```json
{
  "channels": [
    {
      "enabled": true,
      "events": [
        "PICK_JOB_CREATED"
      ],
      "receiver": [
        {
          "email": "user@example.com",
          "language": "de_DE"
        }
      ],
      "type": "EMAIL"
    }
  ],
  "version": 1
}
```

## Create a notification configuration for time-triggered reroute&#x20;

Before a time-triggered reroute happens, it might make sense to inform e.g., a supervisor that a reroute due to inactivity is about to happen.&#x20;

### **1. Define when the notification should be triggered**

```
PUT https://{YOUR-TENANT-NAME}.fulfillmenttools.com/api/configurations/routing/reroutetimetriggered
```

```json
{
  "version": 1,
  "clickAndCollectReroute": {
    "active": false,
    "rerouteTargetTimeHours": 48,
    "rerouteAfterMinutes": 120,
    "leadTimeBeforeTimeTriggeredReroute": 30
  },
  "shipFromStoreDeliveryReroute": {
    "active": false,
    "rerouteTargetTimeHours": 101,
    "rerouteAfterMinutes": 120,
    "leadTimeBeforeTimeTriggeredReroute": 30
  }
}
```

In this example, the task is being rerouted after 120 minutes of inactivity, and 30 minutes before the reroute would happen (in this case, after 90 minutes being inactive), a notification is sent to a defined group of people.

### **2. Set up the notification in the notification center**

```
PUT https://{YOUR-TENANT-NAME}.fulfillmenttools.com/api/configurations/notifications
```

```json
{
  "channels": [
    {
      "enabled": true,
      "events": [
        "UPCOMING_TIME_TRIGGERED_REROUTE"
      ],
      "receiver": [
        {
          "email": "user@example.com",
          "language": "de_DE"
        }
      ],
      "type": "EMAIL"
    }
  ],
  "version": 1
}
```

{% hint style="info" %}
The set CRON\_JOB in your tenant is responsible for triggering sending of emails. Depending on the set intervals of this job, it might be that there is a delay between the actual expiry of the previously set time and the email being sent.
{% endhint %}
