Inventory Events

The following inventory events can be specified as part of the request for creating a subscription:

Event Description

inventoryInstalled

The event occurs after moving a serialized inventory or some quantity of non-serialized inventory from the 'resource' pool to the 'install' pool.

Note:

For non-serialized inventory, the event occurs only with the first install operation when new inventory record appears in the 'install' pool. Further installs will update the quantity of the existing inventory record and trigger the resourceInventoryUpdated event.

inventoryDeinstalled

The event occurs after moving a serialized inventory or some quantity of non-serialized inventory from the 'customer' pool to the 'deinstall' pool.

Note:

For non-serialized inventory, the event occurs only with the first deinstall operation when new inventory record appears in the 'deinstall' pool. Further deinstalls will update the quantity of the existing inventory record and trigger the resourceInventoryUpdated event.

customerInventoryCreated

The event occurs after adding inventory to the 'customer' pool.

customerInventoryDeleted

The event occurs after removing inventory from the 'customer' pool.

inventoryUndoInstall

The event occurs after moving the inventory from the installation pool to the 'resource' pool.

inventoryUndoDeinstall

The event occurs after moving the inventory from the deinstallation pool to the 'customer' pool.

customerInventoryUpdated

The event occurs when the customer inventory properties are changed.

resourceInventoryCreated

The event occurs after adding inventory to the 'resource' pool.

resourceInventoryUpdated

The event occurs when the resource inventory properties are changed. It’s also triggered for updates to inventories in 'install' and 'deinstall' pools.

resourceInventoryDeleted

The event occurs after removing inventory from the 'resource' pool.

Event Fields

The inventory events contain the following fields:

  • eventType: The type of the event, such as customerInventoryUpdated, customerInventoryDeleted, resourceInventoryCreated, and so on.
  • applicationId: The ID of the application that performed the operation which generated the event. It is only present if the operation was performed by an Application.
  • time: The time of the event in UTC time standard (string). The time format is YYYY-MM-DD HH:MM:SS.
  • user: The user who performed this event (string).
  • activityDetails: A record containing the following activity-related key fields:
    • activityId: The identifier of the activity (integer). This is a mandatory field.
    • resourceId: The identifier of the resource to which the activity is assigned (string). This is a mandatory field. The field maps to the external_id field.
    • date: The date the activity is scheduled in the format YYYY-MM-DD. If the activity isn't scheduled, the value is NULL.
    • apptNumber: This field is used by integrations to hold the external ID of the activity. The external ID is the identifier of the activity in the origin system. This is an optional field.
    • customerNumber: This field is used by integrations to hold the external ID of the account. The external ID is the identifier of the account in the origin system. This is an optional field.
  • inventoryDetails: A record containing the following inventory-related key fields:
    • inventoryId: The identifier of the inventory (integer). This is a mandatory field.
    • inventoryType: One of the inventory types defined in the Configuration > Inventory types page in the Field Service Manage interface.
    • status: The status, such as customer, resource, installed, and deinstalled.
  • inventoryChanges: A record containing the following inventory changed fields:
    • inventoryId
    • status
    • inventoryType
    • serialNumber
    • quantity
    • exchangedInventoryId
    • resourceId
    • activityId
    • all the custom properties of an inventory, except file properties
  • exchanged: The value is true when an inventory is created as part of the exchange operation. The eventType is inventoryInstalled or inventoryDeinstalled. The field is empty when the value is false.