Subscribing to events
You can subscribe to data that is generated as part of internal events
through either a webhook mechanism or IBM Cloud Object Storage.
- Custom analytics
- Unified business monitoring
- Analyzing the data (i.e. order failures, nodes missing for optimization)
- Auditing
promiseOrderProcessedThis event is generated by Fulfillment Optimizer after an order is successfully processed. It contains the details of the assignments (nodes) that Fulfillment Optimizer received as part of the input request. This information includes node capacity, quantity, distance, available carrier services, SLA, delivery dates for each of the assignments received as part of the input order request.[ { "tenantId": "qa02", "eventValue": { "orderId": "1598868862", "scenarioId": "STANDARD", "orderDate": "2020-08-24T14:41:33+0000", "isEnquireMode": "N", "runTime": "2020-08-31T10:14:23+0000", "calculatedSLADays": 0, "eligibleForOptimization": "Y", "opt_sliders": { "opt_scenario": "STANDARD", "opt_shipping": 1, "opt_markdown": 0, "opt_loadbalancing": 1, "opt_stockout": 0, "opt_processing": 1 }, "contextInfo": { "contentType": "application/xml", "tenantName": "qa02", "tenantLocale": "en-US", "tenantTimeZone": "US/Central", "contextId": "8fbee0b5-9758-4c8a-853c-8cabb9e99b2a", "APIVersion": "" }, "lines": [ { "lineId": "1", "itemId": "91810862", "deliveryMethod": "SHP", "isPreDefinedNode": "N", "requiredQuantity": 1, "carrierServiceCode": "Standard Ground", "shipToAddress": { "country": "US", "state": "MA", "zip": "36100" }, "skuWeight": 0, "nodeAssignment": [ { "totalAvailableQuantity": 1, "processingCost": 3.5749156547, "isExternalNode": "N", "assignmentKey": "37::::20160529000000", "capUtil": 0, "capacity": 0, "capacityConsumed": 100, "quantity": 1, "nodeId": "37", "distance": 71.04858709, "deliveryDate": "2020-05-21T14:00:00+0000", "shipDate": "2020-05-20T14:00:00+0000", "isRejected": true, "priority": 0, "availableQuantity": 1, "assignedQuantity": 0, "backlogCost": 0, "loadBalancingCost": 0.03333333333333333, "backlogDays": 0, "daysTodeliver": 6, "modBacklogDays": 0, "slaDays": 6, "nodeType": "Store", "nodeCutOffTime": "12:00", "shippingDelayDays": 0, "ccu": 0.3333333333333333, "distancePenalty": 0.006191108321437561, "eligibleForOptimization": "Y", "carriers": [ { "carrierName": "UPS", "carrierServiceName": "Ground_Residential" }, { "carrierName": "UPS", "carrierServiceName": "Surepost" } ], "qtyAssigned": [] }, { "totalAvailableQuantity": 1, "processingCost": 1.5, "isExternalNode": "N", "assignmentKey": "38::::20160529000000", "capUtil": 0, "capacity": 0, "capacityConsumed": 100, "quantity": 1, "nodeId": "38", "distance": 71.04858709, "deliveryDate": "2020-05-21T14:00:00+0000", "shipDate": "2020-05-20T14:00:00+0000", "isRejected": false, "priority": 1, "availableQuantity": 1, "assignedQuantity": 1, "backlogCost": 0, "loadBalancingCost": 0.03333333333333333, "backlogDays": 0, "daysTodeliver": 6, "modBacklogDays": 0, "slaDays": 6, "nodeType": "Store", "nodeCutOffTime": "12:00", "shippingDelayDays": 0, "ccu": 0.3333333333333333, "distancePenalty": 0.006191108321437561, "eligibleForOptimization": "Y", "carriers": [ { "carrierName": "UPS", "carrierServiceName": "Surepost" }, { "carrierName": "UPS", "carrierServiceName": "Ground_Residential" } ], "qtyAssigned": [] }, { "totalAvailableQuantity": 1, "processingCost": 17.9532559895, "isExternalNode": "N", "assignmentKey": "39::::20160529000000", "capUtil": 0, "capacity": 0, "capacityConsumed": 100, "quantity": 1, "nodeId": "39", "distance": 71.04858709, "deliveryDate": "2020-05-21T14:00:00+0000", "shipDate": "2020-05-20T14:00:00+0000", "isRejected": true, "priority": 0, "availableQuantity": 1, "assignedQuantity": 0, "backlogCost": 0, "loadBalancingCost": 0.03333333333333333, "backlogDays": 0, "daysTodeliver": 6, "modBacklogDays": 0, "slaDays": 6, "nodeType": "ERL", "nodeCutOffTime": "12:00", "shippingDelayDays": 0, "ccu": 0.3333333333333333, "distancePenalty": 0.006191108321437561, "eligibleForOptimization": "Y", "carriers": [ { "carrierName": "UPS", "carrierServiceName": "Ground_Residential" }, { "carrierName": "UPS", "carrierServiceName": "Surepost" } ], "qtyAssigned": [] } ] } ] }, "eventType": "promiseOrderProcessed" } ]promiseShipmentProcessedThis event is generated by Fulfillment Optimizer after a shipment is successfully processed. It contains details of the selected ship nodes, types of costs, optimizer slider values, expected delivery date, carriers, etc.[ { "tenantId": "qa02", "eventValue": { "orderId": "1598868862", "orderDate": "2020-08-24T14:41:33+0000", "runTime": "2020-08-31T10:14:23+0000", "shippingWeight": 1.62, "totalCost": 3.3895244416547707, "shippingCost": 1.85, "isEnquireMode": "N", "carrierServiceCode": "Standard Ground", "loadBalancingCost": 0.03333333333333333, "processingCost": 1.5, "stockoutCost": 0, "markDownCost": 0, "distancePenalty": 0.006191108321437561, "numOfOrderLines": 1, "eligibleForOptimization": "Y", "backlogCost": 0, "omsOptimumCostGap": 0, "calculatedSLADays": 0, "activeOptimization": "Y", "contextInfo": { "contextId": "8fbee0b5-9758-4c8a-853c-8cabb9e99b2a", "APIVersion": "", "contentType": "application/xml", "tenantName": "qa02", "tenantLocale": "en-US", "tenantTimeZone": "US/Central" }, "opt_sliders": { "opt_scenario": "STANDARD", "opt_shipping": 100, "opt_loadbalancing": 100, "opt_processing": 100, "opt_markdown": 0, "opt_stockout": 0 }, "scenarioId": "STANDARD", "shipments": [ { "nodeId": "38", "nodeType": "Store", "shipNodeType": "Store", "shipToAddress": { "zip": "36100", "state": "MA", "country": "US" }, "expectedShipDate": "2020-05-20T14:00:00+0000", "shippingWeight": 1.62, "shippingCost": 1.85, "shipmentDelayDays": 0, "isShipmentUpgraded": false, "carrierMode": "UPS_Surepost", "assignedQuantity": 1, "backlogDays": 0, "backlogCost": 0, "loadBalancingCost": 0.03333333333333333, "processingCost": 1.5, "stockoutCost": 0, "markDownCost": 0, "distancePenalty": 0.006191108321437561, "carrierName": "UPS", "carrierServiceName": "Surepost", "distance": 71.04858709, "zone": 5, "promiseShipmentItems": [ { "lineId": "1", "itemId": "91810862", "assignedQuantity": 1, "orderedQuantity": 1, "numOfAssignments": 3, "stockoutCost": 0, "markdownCost": 0, "markdownType": 1, "totalWeight": 1.6217448333333337 } ] } ], "nonOptimizedShipments": [], "stats": { "tHandler": 1598868863966, "tOptimizer": 47, "tCPXSolve": 3 } }, "eventType": "promiseShipmentProcessed" } ]promiseOrderRankedThis event is generated by Fulfillment Optimizer after it processes a rank request. It has two main sections:InputJson, which contains the details of the input rank request like OrderID, ItemID, carrier service code, and the list of ship nodes to select.OutJSON, which contains the ranked list of ship nodes that are eligible to send for optimization.
{ "tenantId": "support", "eventValue": { "apiName": "RankService", "runTime": "2020-09-02T14:08:32+0000", "uniqueId": "TEST-TENANT-SUPPORT", "scenarioId": "STANDARD", "execTime": 24, "inputJSON": "{\"distToConsider\":\"10\",\"rankNodesLimit\":\"3\",\"orderId\":\"TEST-TENANT-SUPPORT\",\"shipToAddress\":{\"zipCode\":\"95536\",\"state\":\"CA\",\"country\":\"US\"},\"promiseLines\":[{\"requiredQuantity\":\"1.00\",\"shipNodes\":[{\"shipNode\":\"0001Test\"},{\"shipNode\":\"9001Test\"},{\"shipNode\":\"0092Test\"},{\"shipNode\":\"0092Test\"}],\"shipToAddress\":{\"zipCode\":\"95536\",\"state\":\"CA\",\"country\":\"US\"},\"carrierServiceCode\":\"2Day\",\"unitOfMeasure\":\"EACH\",\"itemId\":\"0024599086\",\"lineId\":\"201802071308470867064282\"}]}", "outputJSON": "{\"distToConsider\":10.0,\"rankNodesLimit\":3,\"orderId\":\"TEST-TENANT-SUPPORT\",\"shipToAddress\":{\"country\":\"US\",\"state\":\"CA\",\"zipCode\":\"95536\"},\"promiseLines\":[{\"lineId\":\"201802071308470867064282\",\"itemId\":\"0024599086\",\"unitOfMeasure\":\"EACH\",\"requiredQuantity\":1.00,\"carrierServiceCode\":\"2Day\",\"shipToAddress\":{\"country\":\"US\",\"state\":\"CA\",\"zipCode\":\"95536\"},\"shipNodes\":[{\"shipNode\":\"9001Test\",\"totalAvailableQuantity\":0.0,\"rank\":1.0,\"cost\":8.15,\"shippingCost\":8.15,\"processingCost\":0.0,\"capacityCost\":0.0,\"inventoryCost\":0.0},{\"shipNode\":\"0001Test\",\"totalAvailableQuantity\":0.0,\"rank\":2.0,\"cost\":8.42,\"shippingCost\":8.42,\"processingCost\":0.0,\"capacityCost\":0.0,\"inventoryCost\":0.0},{\"shipNode\":\"0092Test\",\"totalAvailableQuantity\":0.0,\"rank\":3.0,\"cost\":8.42,\"shippingCost\":8.42,\"processingCost\":0.0,\"capacityCost\":0.0,\"inventoryCost\":0.0}]}]}", "contextInfo": { "tenantLocale": "en-US", "tenantName": "support", "APIVersion": "", "contextId": "125676fb-5927-42fa-8bf6-687e08770d67", "tenantTimeZone": "US/Central", "contentType": "application/json" }, "opt_sliders": { "opt_scenario": "STANDARD", "opt_shipping": 1, "opt_loadbalancing": 0.5, "opt_processing": 0, "opt_markdown": 0, "opt_stockout": 0 } }, "eventType": "promiseOrderRanked" }promiseOrderFailedThis event is generated by Fulfillment Optimizer when order processing fails. It contains the reason for the failure in the error message and error code along with other details about the SKU, node, SLA, etc.{ "tenantId": "qa01", "eventValue": { "orderId": "Test238_72", "scenarioId": "STANDARD", "orderDate": "2016-07-18T07:41:33+0000", "isEnquireMode": "N", "errorMessage": "OTMZGNE015: NodeCalendar not found for Node Id '37' .", "errorCode": "OTMZGNE015", "runTime": "2020-07-30T07:04:26+0000", "calculatedSLADays": 0, "eligibleForOptimization": "Y", "baseLineSolution": { "baseLineSourcePlan": { "orderId": null, "orderDate": null, "runTime": null, "shippingWeight": 0, "totalCost": 0, "shippingCost": 0, "backlogCost": 0, "calculatedSLADays": 0, "shipmentCount": 2, "scenarioId": null, "shipments": [ { "nodeId": "37", "nodeType": null, "assignedQuantity": 0, "shippingWeight": 0, "shipToAddress": { "country": "US", "state": "MA", "zip": "36100" }, "shippingCost": 0, "backlogCost": 0, "expectedShipDate": 1591240925000, "expectedDeliveryDate": 1591845725000, "backlogDays": 0, "interactionNo": 1, "shipmentDelayDays": 0, "distance": 0, "zone": 0, "carrierName": "UPS", "carrierServiceName": "Standard Ground", "loadBalancingCost": 0, "distancePenalty": 0, "processingCost": 0, "stockoutCost": 0, "markdownCost": 0, "carrierMode": null, "shipmentUpgraded": false, "totalItems": 0, "orderItems": [], "eligibleForOptimization": true } ], "nonOptimizedShipments": [], "carrierServiceCode": null, "lines": [ { "itemId": null, "assignedQuantity": 0, "orderedQuantity": 0, "numOfAssignments": 0, "lineId": "l01", "stockoutCost": 0, "markdownCost": 0, "nodeAssignment": [ { "reject": false, "possibleCarrier": null, "interactionNo": 1, "shipNode": "37", "quantity": 1, "firstShipDate": null, "externalNode": null, "assignmentKey": null, "assignmentCosts": null, "eligibleForOptimization": true } ], "markdownType": 1, "totalWeight": 0 } ], "context": null, "loadBalancingCost": 0, "distancePenalty": 0, "processingCost": 0, "stockoutCost": 0, "markdownCost": 0, "isEnquireMode": "N", "omsoptimumCostGap": 0, "orderLineCount": 0, "sourcePlanStats": { "e2eWebServiceTime": 0, "e2eSourcePlanGenTime": 0, "cplexInstCreateTime": 0, "cplexSolveRegularTime": 0, "cplexSolvePriorityTime": 0 }, "eligibleForOptimization": true } }, "opt_sliders": { "opt_scenario": "STANDARD", "opt_shipping": 1, "opt_markdown": 0, "opt_loadbalancing": 1, "opt_stockout": 0, "opt_processing": 0 }, "contextInfo": { "contentType": "application/xml", "tenantName": "qa01", "tenantLocale": "en-US", "tenantTimeZone": "US/Central", "contextId": "32aed7b8-fa7a-4f99-9dfe-b7243ce55f17", "APIVersion": "" }, "lines": [ { "lineId": "l01", "itemId": "1111111", "deliveryMethod": "SHP", "isPreDefinedNode": "N", "requiredQuantity": 1, "carrierServiceCode": "Standard Ground", "shipToAddress": { "country": "US", "state": "MA", "zip": "36100" }, "skuWeight": 0, "nodeAssignment": [ { "shipNode": "37", "totalAvailableQuantity": 1, "processingCost": 0, "isExternalNode": "N", "assignmentKey": "37::::20160529000000", "capUtil": 0, "capacity": 0, "capacityConsumed": 100, "quantity": 1, "nodeId": "37", "distance": 71.04858709, "deliveryDate": "2020-05-09T14:00:00+0000", "shipDate": "2020-05-08T14:00:00+0000", "isRejected": true, "priority": 0, "availableQuantity": 1, "assignedQuantity": 0, "backlogCost": 0, "loadBalancingCost": 0.96984375, "backlogDays": 0, "daysTodeliver": 1, "modBacklogDays": 0, "slaDays": -1, "nodeType": "Store", "nodeCutOffTime": "23:59", "shippingDelayDays": -1, "ccu": 0.3125, "distancePenalty": 0.006191108321437561, "eligibleForOptimization": "Y", "carriers": [], "qtyAssigned": [] } ] } ] }, "eventType": "promiseOrderFailed" }baseShipmentProcessedThis event is generated by Fulfillment Optimizer based on information that is received as part of order input from IBM Sterling Order Management. It contains the details about the selected ship node by IBM Sterling Order Management for fulfillment.{ "tenantId": "qa02", "eventValue": { "orderId": "testDevGA89", "orderDate": "2020-07-17T04:07:12+0000", "runTime": "2020-07-21T08:28:05+0000", "shippingWeight": 0, "totalCost": 0, "shippingCost": 0, "carrierServiceCode": "Standard Ground", "loadBalancingCost": 0, "processingCost": 0, "stockoutCost": 0, "markDownCost": 0, "distancePenalty": 0, "numOfOrderLines": 1, "eligibleForOptimization": "N", "backlogCost": 0, "omsOptimumCostGap": 0, "calculatedSLADays": 0, "activeOptimization": "N", "contextInfo": { "contextId": "d240b2ad-3558-45f3-9ee6-d83d29f957d7", "APIVersion": "V1", "contentType": "application/json", "tenantName": "qa02", "tenantLocale": "en-US", "tenantTimeZone": "US/Central" }, "opt_sliders": { "opt_scenario": "OPTBASELINE", "opt_shipping": 0, "opt_loadbalancing": 0, "opt_processing": 0, "opt_markdown": 0, "opt_stockout": 0 }, "scenarioId": "OPTBASELINE", "shipments": [ { "nodeId": "37", "nodeType": "Store", "shipToAddress": { "zip": "36100", "state": "MD", "country": "US" }, "expectedShipDate": "2018-02-16T19:39:53+0000", "shippingWeight": 0, "shippingCost": 0, "shipmentDelayDays": 0, "isShipmentUpgraded": false, "carrierMode": "", "assignedQuantity": 1, "backlogDays": 0, "backlogCost": 0, "loadBalancingCost": 0, "processingCost": 0, "stockoutCost": 0, "markDownCost": 0, "distancePenalty": 0.01004700107173207, "carrierName": "UPS", "carrierServiceName": "Standard Ground", "distance": 1032.8711, "zone": 0, "promiseShipmentItems": [ { "lineId": "101", "itemId": "1111111", "assignedQuantity": 1, "orderedQuantity": 1, "numOfAssignments": 1, "stockoutCost": 0, "markdownCost": 0, "markdownType": 1 } ] } ], "nonOptimizedShipments": [], "stats": { "tHandler": 1595320085331, "tOptimizer": 123, "tCPXSolve": 1595320085467 } }, "eventType": "baseShipmentProcessed" }
You can subscribe to these events through either IBM Cloud Object Storage or a webhook mechanism.
Subscribing to events by using IBM Cloud Object Storage
Complete the following steps to subscribe to events by using IBM Cloud Object
Storage.
- Evaluate your space requirements for IBM Cloud Object Storage.
- Create an IBM Cloud Object Storage account to use as an endpoint. For more information, see IBM CloudObject Storage.
- Create IBM Cloud Object Storage Buckets. To create and name the IBM Cloud Object Storage Buckets, adhere to the following guidelines:
- Create one IBM Cloud Object Storage Bucket for your provisioned account.
- The Bucket names must be unique. Adhere to the following naming convention for
Buckets:
<tenant name>-event-<event type>.For example,
tenantPlus1-event-promiseOrderFailed. - The Bucket names must begin and end with lowercase alphanumeric characters, and can contain 3 - 63 characters.
- Create an endpoint by performing a REST call that contains the details of the IBM Cloud Object
Storage bucket or webhook within the request body.
Request type: PUT
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook/< endpointID >
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
- Subscribe to the events that you want to receive by performing the following REST
call:
Request type: PUT
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook/<endpointID>/subscriptions/event
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
Note: You can update the list of events you subscribe to by adding or removing the name of the event in the request body and making the PUT request. - Validate the endpoint you configured by making the following REST call:
Request type: GET
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
Subscribing to events by using a webhook
Complete the following steps to subscribe to the events by using a webhook.
- Configure the webhook to support basic authorization.Note: Fulfillment Optimizer does not connect to an HTTPS URL with a self-signed certificate. Therefore, if you are hosting HTTPS and TLS to a secure webhook, you must use a certificate that is signed by the certificate authorities and accepted by Java 1.8 JRE. The certificates include VeriSign, DigiCert, Amazon, LuxTrust Global, and Let's Encrypte, among others.
- Create an endpoint by using a REST call that contains the details of the IBM Cloud Object
Storage bucket or webhook within the request body.
Request type: PUT
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook/< endpointID >
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
- Subscribe to the events that you want to receive by using the following REST call:
Request type: PUT
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook/<endpointID>/subscriptions/event
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
Note: You can update the list of events you subscribe to by adding or removing the name of the event in the request body and making the PUT request. - Validate the endpoint you configured by making the following REST call:
Request type: GET
URL: https://api.orderoptimizer.ibm.com/configuration/api/v1/endpoint/webhook
Request headers:
"tenantid":"xxx","Authorization":"Bearer <JWT token>"Content-Type":"application/json"For information, see Authenticating APIs and the API Javadocs.
After you complete these steps, you will start receiving the events that you subscribed to in your IBM Cloud Object Storage bucket or webhook endpoint.