Subscribe to inventory location events

The Inventory must be configured with the newly created store in order to send future inventory location events.

About this task

The Inventory webhook is configured with Ruby and RubyB2B store subscriptions. These subscriptions need to be disabled if you do not wish to receive events for these two stores. However, a new store must subscribe to inventory location events. Complete the steps given in this document for every store you publish.

Procedure

  1. Take a note of the new store's member id.
  2. Obtain a keycloak access token for the current user.
  3. Make a POST call to the webhook server with the following request body after replace -41000 with the new store memberId value:
    POST webhook-url/webhook/api/v1/subscriptions
    {
        "url": "https://${TX_HOST}:${TX_PORT}/rest/admin/v2/fulfillment-centers",
        "method": "POST",
        "successResponseCode": 201,
        "event": "ffm-center-create",
        "template": "{\"extIdentifier\": \"{{fulfillmentCenterId}}\", \"memberId\": -41000, \"defaultShipOffset\": 86400, \"inventoryOperationFlags\": 8, \"maxNumPick\": 10, \"pickDelayInMin\": 10, \"dropShip\": \"N\", \"name\": \"{{fulfillmentCenterName}}\"}"
    }
  4. Do a GET webhook-url/webhook/api/v1/subscriptions and ensure the subscription is created successfully.