## Overview

Webhooks are a mechanism for an application to send automated, real-time notifications without the need to call REST API endpoints. fabric’s Order Management System (OMS) provides a list of webhook events using which you can create event subscriptions for Create, Read, Update, and Delete (CRUD) operations that take place in fabric OMS (also called fabric Orders). As a merchant, you can configure specific webhook events, such as inventory creation, order creation, order cancellation, and more to receive event-specific information.

## List of Webhook Events

The following are the different services of fabric Orders along with the various webhook events provided by each service:

- [Inventory Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#inventory-service)
- [Order Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#order-service)
- [Notification Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#notification-service)
- [Allocation Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#allocation-service)
- [Shipment Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#shipment-service)
- [Package Tracking Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#package-tracking-service)
- [Fraud Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#fraud-service)
- [Invoice Posting Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#invoice-posting-service)
- [Crossborder Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#crossborder-service)
- [Export Service](https://developer.fabric.inc/v3/orders-and-inventory/api-reference/orders/developer-guide/list-of-webhook-events#export-service)

### Inventory Service

**Source Name:**`INVENTORY_SERVICE`  
**Event Types:**

1. `INVENTORY_CREATE`
2. `INVENTORY_UPDATE`
3. `INVENTORY_BULK`
4. `INVENTORY_NETWORK_UPDATED`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "INVENTORY_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
        "INVENTORY_CREATE",
        "INVENTORY_UPDATE" // List of events to subscribe
    ]
}'
```

### Order Service

**Source name:**`ORDER_SERVICE`  
**Event Types:**

01. `ORDER_CREATE`
02. `ORDER_HOLD_CROSSBORDER`
03. `ORDER_HOLD_FRAUD`
04. `ORDER_HOLD_CSR`
05. `ORDER_CONFIRMED`
06. `ORDER_CANCELLED` (only for full-order-canceled)
07. `ORDER_PARTIALLY_RETURNED`
08. `ORDER_RETURNED` (only for full Order returned)
09. `ORDER_SHIPPED` (once all items are shipped)
10. `EXCHANGE_PENDING`
11. `EXCHANGE_TO_SHIPMENT`
12. `ORDER_CANCELLATION_COUPON_REVERSAL`

**curl example:**

```
curl --location --request POST 'api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "ORDER_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
        "ORDER_CREATE" // List of events to subscribe
    ]
}'
```

### Notification Service

**Source Name:**`NOTIFICATION_SERVICE`  
**Event Types:**

01. `SINGLE_ITEM_ORDER_CONFIRMATION_EMAIL`
02. `MULTI_ITEM_ORDER_CONFIRMATION_EMAIL`
03. `BOPIS_ORDER_CONFIRMATION_EMAIL`
04. `SHIPPING_CONFIRMATION_EMAIL`
05. `BOPIS_ORDER_READY_FOR_PICKUP`
06. `BOPIS_ORDER_COMPLETED`
07. `BOPIS_REMINDER_EMAIL`
08. `BACKORDER_NOTIFICATION_EMAIL`
09. `BACKORDER_30_DAYS_CONSENT_TO_DELAY_EMAIL`
10. `BACKORDER_53_DAYS_CONSENT_TO_DELAY_EMAIL`
11. `BACKORDER_CANCEL_EMAIL`
12. `BACKORDER_AUTH_DECLINE_EMAIL`
13. `ORDER_CANCELLATION_EMAIL_WEBCSC_ORDER_ITEM_CANCEL`
14. `ORDER_CANCELLATION_EMAIL_WEBCSC_ORDER_CANCEL`
15. `ORDER_CANCELLATION_EMAIL_LOCATE_ORDER_ITEM_CANCEL`
16. `RETURN_NOTIFICATION_EMAIL`
17. `REFUND_NOTIFICATION_EMAIL`
18. `APPEASEMENT_NOTIFICATION_EMAIL`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "NOTIFICATION_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
        "SINGLE_ITEM_ORDER_CONFIRMATION_EMAIL",
        "MULTI_ITEM_ORDER_CONFIRMATION_EMAIL" // List of events to subscribe
    ]
}'
```

### Allocation Service

**Source name:**`PPS_SERVICE`  
**Event Types:**

1. `ALLOCATION_RETURN`
2. `ALLOCATION_CREATE_SDD`
3. `ALLOCATION_CREATE_BOPIS`
4. `ALLOCATION_CREATE_SHIP`
5. `ALLOCATION_CREATE_GIFTCARD`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "PPS_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
        "ALLOCATION_CREATE_SHIP" // List of events to subscribe
    ]
}'
```

### Shipment Service

**Source Name:**`SHIPMENT_SERVICE`  
**Event Types:**

1. `SHIPMENT_CREATED`
2. `SHIPMENT_CANCELLED`
3. `GIFTCARD_ACTIVATE`
4. `PICKUP_CREATED`
5. `PICKUP_COMPLETED`
6. `SHIPMENT_UPDATE`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "SHIPMENT_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "SHIPMENT_CREATED" // List of events to subscribe
    ]
}'
```

### Package Tracking Service

**Source Name:**`PACKAGE_TRACKING_SERVICE`  
**Event Types:**

1. `ORDER_CREATE_IN_PTS`
2. `ORDER_CANCELLED_IN_PTS`
3. `SHIPMENT_CREATE_IN_PTS`
4. `SHIPMENT_CANCELLED_IN_PTS`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "PACKAGE_TRACKING_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "ORDER_CREATE_IN_PTS" // List of events to subscribe. PTS refers to Package Tracking Service.
    ]
}'
```

### Fraud Service

**Source Name:**`FRAUD_SERVICE`  
**Event Types:**

1. `FRAUD_CANCEL`
2. `FRAUD_RELEASE`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "FRAUD_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "FRAUD_RELEASE" // List of events to subscribe.
    ]
}'
```

### Invoice Posting Service

**Source Name:**`INVOICE_POSTING_SERVICE`  
**Event Types:**

1. `INVOICE_POSTING`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "INVOICE_POSTING_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "INVOICE_POSTING" // List of events to subscribe.
    ]
}'
```

### Crossborder Service

**Source Name:**`CROSSBORDER_SERVICE`  
**Event Types:**

1. `CROSS_BORDER_VALIDATION`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "CROSSBORDER_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "CROSS_BORDER_VALIDATION" // List of events to subscribe.
    ]
}'
```

### Export Service

**Source Name:**`EXPORT_SERVICE`  
**Event Types:**

01. `EXPORT_ORDER_INITIATED`
02. `EXPORT_ORDER_COMPLETED`
03. `EXPORT_ORDER_ERROR`
04. `EXPORT_ALLOCATION_INITIATED`
05. `EXPORT_ALLOCATION_COMPLETED`
06. `EXPORT_ALLOCATION_ERROR`
07. `EXPORT_SHIPMENT_INITIATED`
08. `EXPORT_SHIPMENT_COMPLETED`
09. `EXPORT_SHIPMENT_ERROR`
10. `EXPORT_INVOICE_INITIATED`
11. `EXPORT_INVOICE_COMPLETED`
12. `EXPORT_INVOICE_ERROR`
13. `EXPORT_LOCATION_INITIATED`
14. `EXPORT_LOCATION_COMPLETED`
15. `EXPORT_LOCATION_ERROR`
16. `EXPORT_INVENTORY_INITIATED`
17. `EXPORT_INVENTORY_COMPLETED`
18. `EXPORT_INVENTORY_ERROR`
19. `EXPORT_NETWORK_INITIATED`
20. `EXPORT_NETWORK_COMPLETED`
21. `EXPORT_NETWORK_ERROR`
22. `EXPORT_SHIPPING_METHODS_INITIATED`
23. `EXPORT_SHIPPING_METHODS_COMPLETED`
24. `EXPORT_SHIPPING_METHODS_ERROR`
25. `EXPORT_AGGREGATED_NETWORK_INITIATED`
26. `EXPORT_AGGREGATED_NETWORK_COMPLETED`
27. `EXPORT_AGGREGATED_NETWORK_ERROR`

**curl example:**

```
curl --location --request POST 'https://api.fabric.inc/v3/oms-webhooks' 
--header 'Authorization: Bearer {token}' 
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "EXPORT_SERVICE", // This will change based on service to be subscribed
    "format": "application/json",
    "requestType": "POST",
    "events": [
       "EXPORT_ORDER_INITIATED",
       "EXPORT_ORDER_COMPLETED" // List of events to subscribe.
    ]
}'
```
