Eventing
The fulfillmenttools eventing mechanism doesn't guarantee event ordering. The same event can be emitted multiple times.
Eventing is the mechanism that notifies external systems about business events, such as Order has been routed or pick job has been completed. Events are phrased in the past tense because they describe actions that have already occurred.
Eventing is available for a callback URL, the Microsoft Azure Service Bus, and Google Cloud Pub/Sub.

Timing
Events are the primary mechanism for decoupling services within a distributed system. The time from publication on the message bus to delivery to a subscription is typically a few milliseconds to several seconds. In worst-case scenarios, such as when backend services are scaling up, this process can take up to 30 seconds.
The following diagram shows the typical timing of events originating from fulfillmenttools to an external system:

Avoid event delivery delays
In a distributed system, it's expected that parts of the system will fail from time to time. However, when running a service on your own that serves as an endpoint for subscriptions, it's important to properly monitor its availability and return codes to ensure events are delivered on time.
Services returning a 200 OK response are considered error-free.
Receiving events
For all Available events, subscriptions can be created using the eventing API to receive notifications.
Prerequisites
Access to your company's tenant (
projectIdand credentials)Have an authenticated session in Postman
Have an Administrator role
Imported the fulfillmenttools Postman collection
Limitations
For any single event, such as ORDER_CREATED, a maximum of five subscriptions can be created.
In the below example, we'll set up a subscription for the order created event.
Set up your preferred provider
Use the tabs below to select the relevant provider instructions needed for set up
To publish fulfillmenttools messages to Microsoft Azure Service Bus in a target system, a few settings must be configured in the target system:
Register an application in Microsoft Entra ID and save the Application (Client) ID and Directory (Tenant) ID.
Create a client secret (in Certificates & secrets) for the new application and save its Value.
Create an Azure Service Bus namespace and save the namespace name.
Configure Access control (IAM), which stands for Identity and Access Management, for the Service Bus. Assign the Service Bus Sender role to the application created in step 1.
Create a Queue or Topic within the namespace.
The following values are then used for the subscription API call in fulfillmenttools:
Directory (Tenant) ID corresponds to
tenantId.Application (Client) ID corresponds to
clientId.Value of application secret corresponds to
clientSecret.Namespace name corresponds to
namespace.Queue or Topic name corresponds to
queueOrTopicName.
To publish fulfillmenttools messages to Google Cloud Pub/Sub in a target system, the following must be configured:
Define the topic where messages will be published.
In the topic's permissions, add the
fulfillmenttoolsservice accountocff-event-function@{YOUR-TENANT-NAME}.iam.gserviceaccount.comas aprincipalwith thePub/Sub Publisherrole.
The following values are then used for the subscription API call in fulfillmenttools:
Google Cloud project id corresponds to
projectId.Google Cloud Pub/Sub topic id corresponds to
topicId.
Visit webhook.site to generate a unique URL that can be used for testing and allows the response code to be changed to simulate failing requests.
The following values are then used for the subscription API call in fulfillmenttools:
GET url corresponds to callbackURL.
Access the endpoint
Register the event
Update the parameters in the body for the relevant settings you created in step one for your provider.
A successful request returns a 201 Created status, and the subscription becomes active immediately.
Test the notification
Create a new test order with the follow endpoint to trigger the ORDER_CREATED event:
A successful request returns a 201 Created status, and you should receive a notification on your provider service of the order.
Example payloads
Google Pub/Sub subscription
Note: We don't set any pub/sub attributes.
Microsoft Azure subscription
Webhook subscription
Contexts
For the INVENTORY_FACILITY_STOCK_CHANGED event, it's possible to specify contexts to further restrict when a subscription is triggered.
If contexts are specified, the subscription is triggered only if all contexts apply
Available context types are
FACILITYandFACILITY_GROUPAn event applies if it occurs for a:
Facility explicitly listed in the context
Facility that belongs to one of the specified facility groups
If the event is a bulk event containing multiple payloads, the payloads are filtered to include only those relevant to the specified contexts.
Attempts to resend messages that weren't delivered successfully
fulfillmenttools follows the exponential backoff pattern when a configured subscription is unreachable or returns a response code other than 200 OK. If this happens, fulfillmenttools will automatically initiate a retry. The time between the retries will progressively increase with every retry from 20 seconds until it reaches 600 seconds. This is executed for one hour.
Redelivery attempts continue at this maximum interval until one of the following occurs:
The subscription endpoint acknowledges the event by returning a
200 OKresponse.The event's 7-day retention period has expired, at which point it's permanently dropped and deleted.
See the following diagram that visualizes the approach:

fulfillmenttools doesn't monitor the health or availability of subscriber endpoints.
Event flow examples
fulfillmenttools communicates relevant changes through events. The flowcharts below provide a brief overview of a subset of processes and the events they trigger.
A comprehensive overview of all events is available in the Available events article.
The eventing API does not guarantee the order of events.
Order, reservations, and fulfillment
The following diagram depicts the typical events emitted during an exemplary order fulfillment process. This includes order routing, reservations, picking, packing, and handover, as well as a potential return.

Inbound process
The following diagram depicts the typical events emitted during an exemplary inbound process, from the creation of a Purchase Order (PO) to the receipt of goods.

Stow jobs
The following diagram depicts the typical events emitted during an exemplary stowing process, from the creation of a stowJob to the stowing of the final items and the completion of the job.

Event scopes
An event scope defines which facilities or facility groups are included in an event type. A unique key identifies each scope and produces independent events.
You can define the scope using facilityRefs and facilityGroupRefs. This can be:
No facilities or facility groups are configured: The event is emitted including all facilities in the network.
facilityRefsconfigured: The event is emitted, but only the explicitly listed facilities contribute to the data within the event.facilityGroupRefsconfigured: The event is emitted, but only the facilities that are members of the referenced facility groups contribute to the data within the event.
Both fields can be combined. The event includes all resolved facilities from facilityRefs and facilityGroupRefs.
If a facility group is edited, the next event automatically reflects the updated facility group list. If a referenced facility or group is deleted, it's removed from the scope.
Create an event scope
Event scopes are managed via the event scope configuration API. The endpoint supports CREATE, GET, SEARCH, UPDATE, and DELETE operations.
Validation
The key field is mandatory and must be unique per tenant.
Limits
Maximum number of event scopes per tenant
10
Maximum number of facilityRefs per event scope
50
Maximum number of facilityGroupRefs per event scope
5
Subscriptions
Events with an event scope follow the standard subscription model. No scope-specific subscription is required. A single subscription to this event type receives events from all configured scopes. The configurationScopeKey field in the payload identifies which scope produced a given event.
For details on creating subscriptions, see the Receiving events section.
Inventory article availability changed event
For the INVENTORY_ARTICLE_AVAILABILITY_CHANGED event, event scopes define which facilities contribute to an aggregated stock availability calculation and determine when a corresponding event is emitted. Rather than receiving one stock signal per facility, consumers receive one aggregated signal per configured scope whenever the aggregated values change.
This mechanism enables retailers to model independent fulfillment domains (such as all stores or all online warehouses) and receive separate, aggregated stock signals for each domain.
If an event is triggered and another a change is made before the event is sent, successive updates to the same SKU and scope are absorbed. This means that when the final emit is triggered, all the freshest data is collected and emitted at once.

Event payload
The system emits one event per scope when the aggregated stockAvailability values for an article change. The event identifies the article by its tenantArticleId and includes the current aggregated values.
For a description of the individual stockAvailability fields, refer to Stock availability.
Last updated
Was this helpful?

