Struct Docs
Struct.PIM 4
Struct.PIM 4
  • Struct PIM Documentation
  • API Reference
  • Latest updates from Struct HQ
  • Latest updates in Documentation
  • Fundamental concepts
    • Get familiar with Struct PIM
    • Catalogues & categories
    • Products & variants
    • Attributes
    • Product structures
    • Identifiers
    • Global lists
    • Localization & segmentation
    • Revisions & changelog
    • Publications
    • Supplier onboarding portal
  • Tutorials
    • Welcome to Struct PIM 4
    • Helpful guides
      • How to search efficiently
      • How to use Import
        • How to import products
        • How to import data into a list property on entities
        • How to import categories
        • How to import with media
        • How to use File templates
    • Example projects
      • Working with the API
  • Integration
    • Web API
    • Webhooks
  • Media format
  • API Reference
    • Introduction
    • Endpoints
      • AssetFolders
      • Assets
      • AssetTypes
      • AttributeGroups
      • Attributes
      • AttributeScopes
      • Browse
      • BusinessUnits
      • Catalogues
      • Categories
      • Dimensions
      • Exports
      • EnrichmentInsightSetups
      • GlobalLists
      • Languages
      • Maintenance
      • Miscellaneous
      • Messaging
      • Permissions
      • Products
      • ProductStructures
      • Publications
      • Transactions
      • UserGroup
      • UserRoles
      • Users
      • VariantGroups
      • UserTasks
      • Variants
      • Webhooks
      • Workflows
      • Models
Powered by GitBook
On this page
  • Implementing webhook endpoint
  • Setting up webhooks
  • Advanced settings
  • Viewing webhook requests
  1. Integration

Webhooks

Struct PIM offers support for webhooks for external messaging in response to events in the system

PreviousWeb APINextMedia format

Implementing webhook endpoint

When you implement your webhook endpoint, you have to make sure that your endpoint responds on the url you have set up. Webhook requests are all POST requests and uses header information to tell your endpoint what kind of request you are receiving, whereas the request body contains the actual payload of the request.

Request header key
Description

X-Event-Key

This header contains an identification of the event type, which can be products.created, products.updated, products.deleted, variants.created, variants.updated, variants.deleted, category.created, category.updated, category.deleted, globallistvalue.created, globallistvalue.updated, globallistvalue.deleted

X-Hook-UID

Contains the unique id of the webhook you have configured in StructPIM

X-Request-UID

Contains a unique id identifying this particular webhook request

Setting up webhooks

You can manage webhooks in the Settings -> Webhooks page. Here you can set up as many webhooks as needed. Each webhook is set up to point to an address, to which an http request is be made, when an event happens in Struct PIM. You can activate or deactivate each webhook and select which events to send to the endpoint.

Advanced settings

The Products updated, Variants updated and Categories updated webhook events supports setting up advanced settings when enabled.

Conditional triggering

In the advanced settings dialog, you can select between conditional triggering and non-conditional triggering

Conditional triggering disabled

When conditional triggering is disabled, all events of the selected type are propagated as webhook events

Conditional triggering enabled

When conditional triggering is enabled, you can select the type of changes on the entity that shall make the webhook event trigger.

For the product updated event, the following conditions can be controlled in the advanced settings of the webhook

  • Category updates - Only trigger when the product classifications have changed

  • Product structure updates - Only trigger when the product structure has changed

  • Variation definition updates - Only trigger when the variation definition has changed

  • Archiving status update - Only trigger when the product archiving status has changed

  • Attribute updates

    1. Do not fire - Do not trigger on attribute updates at all

    2. Fire on all attribute updates - Trigger the webhook whenever an attribute value is updated

    3. Fire on specific attribute updates - Only trigger when the selected attributes are updated

Data mode

Besides conditional triggering, you can select between two data modes in advanced settings.

Default data mode

When default is selected, the entity (product, variant or category) ids are sent in the payload along with the transaction uid

Include changeset mode

When Include changeset mode is selected, information on what changes have happened are sent as payload in the webhook along with the ids of the entities

Viewing webhook requests

At each webhook you can view the latest requests made to the webhook endpoint by clicking the icon at the right side of the webhook header.

Click View details to see details on a specific request

Upon triggering the webhook in Struct PIM, webhook.site is live updated for you to examine the request and e.g. copy it into Postman for testing on a local machine. As it is a free service, the link will only work for a given number of requests after which you will have to generate a new link.

While developing and testing handling of webhooks, can also be a valuable resource. Go to the site, copy the unique webhook link and paste it into the relevant webhook settings in Struct PIM.

webhook.site
Setting up webhooks
Webhooks advanced settings
Webhook logs
View webhook request