---
schema_version: "1"
id: b5d9032446f502f69c20d451cbe86f5d13294629a5da7686700698a30d87c707
title: Inventory Event Webhooks
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/retail-cloud/guides/inventory-event-webhooks.md
canonical_url: https://developer.salesforce.com/docs/commerce/retail-cloud/guide/inventory-event-webhooks.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6ad1040255017e29e19cf55e629a27467380061b38cdc722fb67afe3a4322de4
products:
  - Point of Sale for Developers
  - Salesforce APIs
---
# Inventory Event Webhooks

Point of Sale created Inventory Events webhooks that allow merchants to integrate and interact with inventory management systems programmatically. They can enable real-time data exchange for inventory-related events. These events include transfer, adjustment, cycle count, purchase order, and inventory movements (sales, returns) data.

:::tip

For a comprehensive list of Retail Cloud's API and SPIs, refer to [Retail Cloud API, SPI, and Webhook Overview](https://developer.salesforce.com/docs/commerce/retail-cloud/guide/retail-cloud-api-spi-webhook-specs.html).


## Inventory Events

**1. Inventory Transfer** - This API sends inventory transfer-related data to an external system. The types of transfers are Advanced Shipping Notice (ASN), Corporate Transfer (CTS), Store to Store (STS), Blind Receivings (BLD), and Return to Vendor (RTV).

```bash
POST/merchant/spi/sample/endpoint/sa/customer/inventory/inventoryTransfer 
```

**2. Inventory Adjustment** - This API sends inventory adjustment-related data to an external system (for example, quantity count, reason for adjustment, reason text, etc.).

```bash
POST/merchant/spi/sample/endpoint/sa/customer/inventory/inventoryAdjustment
```

**3. Cycle Count** - This API sends cycle count-related data to an external system (for example, product information, inventory/counted quantity, variances, etc.).

```bash
POST/merchant/spi/sample/endpoint/sa/customer/inventory/cycleCount
```

**4. Purchase Order** - This API sends purchase order-related data to an external system (for example, product information, order quantity, costs, etc.).

```bash
POST/merchant/spi/sample/endpoint/sa/customer/inventory/purchaseOrder
```

**5. Inventory Movement** - This API sends inventory movement-related data to an external system (for example, sales, returns).

```bash
  POST/merchant/spi/sample/endpoint/sa/customer/inventory/sale
```

```bash
  POST/merchant/spi/sample/endpoint/sa/customer/inventory/return
```

**6. Create ASN** - This API creates an ASN in the inventory management system.

```bash
POST/merchant/{version}/ims/inventory/asn
```

### Example Payload Request and Response

Below, you'll find examples of both the request payload and the response for the Inventory Transfer API.

#### Request

```json
  "eventType": "STS_TRANSFER_STARTED_EVENT",
  "lines": [
    {
      "billOfLadingID": "99865",
      "cancelledOn": 1686608971000,
      "cartonID": "A-4-PS00000001P1C1",
      "color": "Navy",
      "createdOn": 1686607971000,
      "deliveredOn": 1686608971000,
      "description": "Request for transfer from from store 1 to store 2",
      "dueOn": 1686608971000,
      "estimatedDeliveryOn": 1686608971000,
      "exportDate": 1686608971000,
      "externalDocNumber": "4900071859",
      "externalLineNumber": "00010",
      "fromID": "1",
      "gtin": "3661601593970",
      "inventoryTransferID": "ITS00000001",
      "isManualAdd": true,
      "itemStatus": "COMPLETE",
      "itemTrackingNumber": "TrackingIDPS00000001",
      "lastProcessedById": "2036",
      "lastProcessedByName": "Rob",
      "orderID": "OrderPS00000001",
      "palletID": "A-4-PS00000001P1",
      "poNumber": "123456",
      "productCount": 3,
      "productID": "3661601594304",
      "productImageLinks": "https://us.maje.com/dw/image/v2/AAON_PRD/on/demandware.static/-/Sites-maje-catalog-master-H13/default/dwd569bdfb/images/h13/Maje_E18GUMPY-0067_H_1.jpg",
      "productImageURL": "https://us.maje.com/dw/image/v2/AAON_PRD/on/demandware.static/-/Sites-maje-catalog-master-H13/default/dw2b369dcf/images/h13/Maje_E18PERSE-1066_H_1.jpg",
      "productTitle": "Wide-leg checked trousers",
      "quantityOrdered": 3,
      "quantityReceived": 1,
      "quantityTransferred": 2,
      "reasonCode": "1",
      "reasonText": "Damaged",
      "receivedBy": "2036",
      "receivedOn": 1686608971000,
      "shippedOn": 1686608971000,
      "shipper": "UPS",
      "size": "OS",
      "status": "IN_PROGRESS",
      "toID": "2",
      "trackingNumber": "track123",
      "transferID": "409a92a5-834b-4500-b062-cedd89a38602",
      "transferType": "STORE_TO_STORE",
      "updatedOn": 1686608971000,
      "vendorID": "1",
      "vendorNumber": "0607282"
    }
  ]
}
```

#### Response

```json
{
  "message": "Successfully",
  "status": "SUCCESS"
}
```

## CMS - Configuration & Setup

To set up inventory event webhooks in Point of Sale, you'll need to configure custom connectors in CMS for each type of inventory event you want to monitor. This involves creating endpoints, specifying API keys, and configuring the appropriate event subscriptions. The setup process allows you to establish real-time data exchange between Point of Sale and your external inventory management systems.

### Configuring Webhooks

To configure APIs, endpoints must be implemented and provided by the merchant system. Then they must be configured in Point of Sale CMS.

In CMS, go to **Store Management** **>** **Integrations** **>** **Custom Connectors**.

Create a new connector by referring to the table below:

| Inventory Events                      | Used for sending inventory data to external system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Send inventory Transfer data          | **API Key:** This should be one of the following values:<br>• INVENTORY_EXPORT_ASN<br>• INVENTORY_EXPORT_STS<br>• INVENTORY_EXPORT_RTV<br>• INVENTORY_EXPORT_CTS<br>• INVENTORY_EXPORT_BLD<br><br>**Events:** Only the subscribed event's data will be sent out, available events:<br>• ASN_RECEIVED_EVENT<br>• ASN_PARTIALLY_RECEIVED_EVENT<br>• ASN_RECEIVE_COMPLETED_EVENT<br><br>**API Endpoint:** Provide the external endpoint to send the inventory transfer data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory/inventoryTransfer`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`<br><br>For a full list of events, see [Retail Cloud API Specifications](https://developer.salesforce.com/docs/commerce/retail-cloud/references/about-retail-cloud-api/about.html) and this [guide](https://developer.salesforce.com/docs/commerce/retail-cloud/guide/retail-cloud-api-spi-webhook-specs.html). |
| Send inventory adjustment data        | **API Key:** This should be one of following values:<br>• INVENTORY_EXPORT_INA<br><br>**Events:** Only the subscribed event's data will be sent out, available events:<br>• INVENTORY_ADJUSTMENT<br>• INVENTORY_BUCKET_ADJUSTMENT<br><br>**API Endpoint:** Provide the external endpoint to send the inventory transfer data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory/inventoryAdjustment`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Send inventory bucket adjustment data | **API Key:** This should be one of following values:<br>• INVENTORY_EXPORT_INBA<br><br>**Events:** Only the subscribed event's data will be sent out, available events:<br>• INVENTORY_BUCKET_ADJUSTMENT<br><br>**API Endpoint:** Provide the external endpoint to send the inventory transfer data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory/inventoryBucketAdjustment`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Send cycle count data                 | **API Key:** This should be one of following values:<br>• INVENTORY_EXPORT_CYC<br><br>**Events:** Only the subscribed event's data will be sent out, available events:<br>• CYC_COUNT_CREATED_EVENT<br>• CYC_COUNT_STARTED_EVENT<br>• CYC_COUNT_COMPLETED_EVENT<br>• CYC_COUNT_CANCELED_EVENT<br><br>**API Endpoint:** Provide the external endpoint to send the inventory transfer data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory/cycleCount`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                       |
| Send purchase order data              | **API Key:** This should be one of following values:<br>• INVENTORY_EXPORT_PO<br><br>**Events:** Only the subscribed event's data will be sent out, available events:<br>• PO_TRANSFER_STARTED_EVENT<br>• PO_TRANSFER_COMPLETED_EVENT<br>• PO_TRANSFER_ERRORED_EVENT<br><br>**API Endpoint:** Provide the external endpoint to send the inventory transfer data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory/purchaseOrder`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Send sales data                       | This event indicates that an item (or items) has been sold. When this event is triggered, the expectation is that the inventory for the specified item(s) should decrease.<br><br>**API Key:** This should be SALE_INVENTORY.<br><br>**API Endpoint:** Provide the external endpoint to send inventory-related sales data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Send return data                      | This event indicates that an item (or items) has been returned or exchanged. When this event is triggered, the inventory for the specific item(s) should increase or adjust in some manner if it's an exchange.<br><br>**API Key:** This should be RETURN_INVENTORY.<br><br>**API Endpoint:** Provide the external endpoint to send inventory-related returns data out. E.g., `https://sample/external/endpoint/merchant/spi/sample/endpoint/sa/customer/inventory`<br><br>**Integration Type:** It should be HTTP_POST.<br><br>**JSON Headers:** Provide the header for the API. Headers can be Content-Type or Authorization attributes that is, clientId/password.<br>`{"Content-Type":"application/json","client_id":"myClientId", "client_secret":"myClientSecret"}`                                                                                                                                                                                                                                                                                                                                                                                                                                        |


### Reposting Webhooks

Point of Sale offers the ability to manually repost failed webhook events.

1. In CMS, go to **Store Management > Reporting and Analytics > Repost Failed Webhook Events**.
2. Search for the failed webhook event by configuring the search query parameters.
3. Click **View Details** to view the details of the payload inside the selected webhook event.
4. Click **Repost** to manually trigger a webhook event repost.
