Follow product feed updates with a webhook and the API

Subscribe a webhook to products.updated. Dropday then notifies your endpoint after each product feed import, and your system reads the updated products through the Dropday API.

Dropday's webshop connections don't write imported stock levels or purchase prices back to your webshop. Updating your webshop from a feed is an integration you build: it subscribes to products.updated, reads the products from the Dropday API and writes the stock or purchase price in your shop.

Add a webhook for products.updated

You need a user who can manage the account, and a product feed in Dropday.

  1. Go to Settings → Webhooks.

  2. Add a webhook: give it a name, a description and the URL of your endpoint.

  3. Subscribe it to the products.updated event.

If you had entered a webhook URL in the earlier single webhook URL setting, Dropday has moved it into a webhook subscribed to products.updated.

What the event contains

After each product feed import, Dropday sends products.updated to every active webhook that is subscribed to it, as a JSON POST. The body is an envelope with id, event, created_at and data. In data, the event carries product_feed_id, account_id and updated_at, not the product data itself.

The example below shows where these fields sit. The values are placeholders: Dropday fills in the real values of the import.

{
  "id": "EVENT_ID",
  "event": "products.updated",
  "created_at": "CREATED_AT",
  "data": {
    "product_feed_id": "PRODUCT_FEED_ID",
    "account_id": "ACCOUNT_ID",
    "updated_at": "UPDATED_AT"
  }
}

Each request has an X-Dropday-Event header and an X-Dropday-Signature header. The signature is the lowercase hexadecimal HMAC-SHA256 of the raw request body, keyed with the webhook's secret. Set up order and tracking webhooks shows how to verify it.

When a delivery fails, because your endpoint gives no successful response within 10 seconds or returns an error, Dropday retries it automatically. It makes up to 5 attempts, waiting 1 minute, 5 minutes, 15 minutes and 1 hour between attempts.

Read the updated products

The event doesn't contain the products. Two endpoints of the Dropday API return imported products, and both only read data:

  • GET https://dropday.io/api/v1/products/new lists the active products that were updated in the last 24 hours;

  • GET https://dropday.io/api/v1/products lists all active imported products of your account, 100 per page.

Both use the same headers as the order API: api-key with your API key and account-id with your Account ID. A missing or wrong pair returns HTTP status 403.

To find your API key and Account ID, go to Store Integration and choose the DropdayAPI tile on the screen Choose your e-commerce platform. Under Developers information, that page lists API-key and Account-ID, each with a Copy button.

This request reads the products updated in the last 24 hours. Replace YOUR_API_KEY and YOUR_ACCOUNT_ID with your own values:

GET https://dropday.io/api/v1/products/new
api-key: YOUR_API_KEY
account-id: YOUR_ACCOUNT_ID

The response has a data array with one entry per product. Each product has id, project_id, product_feed_id, sku, ean13, name, purchase_price, stock_quantity, active (always 1 in these responses), created_at and updated_at. The example shows one product in that array, with placeholder values; other parts of the response are not shown.

{
  "data": [
    {
      "id": "PRODUCT_ID",
      "project_id": "PROJECT_ID",
      "product_feed_id": "PRODUCT_FEED_ID",
      "sku": "SKU",
      "ean13": "EAN13",
      "name": "PRODUCT_NAME",
      "purchase_price": "PURCHASE_PRICE",
      "stock_quantity": "STOCK_QUANTITY",
      "active": 1,
      "created_at": "CREATED_AT",
      "updated_at": "UPDATED_AT"
    }
  ]
}

Your integration then writes stock_quantity or purchase_price to the matching product in your shop. The Dropday API documentation is published at docs.dropday.io.