latestOpenAPI 3.0.02026-08-105585620.8 KB

18e2f2e178dd

Webhook API

Set up webhook configuration

Use this endpoint to enable a webhook URL for a store and select webhook event types that will be sent to this URL.

Note that only one webhook URL can be active for a store, so calling this method disables all existing webhook configuration.

Setting up the Stock updated webhook requires passing IDs for products that need to be monitored for changes. Stock update webhook will only include information for specified products. These product IDs need to be set up using the params property.

post/webhooks

Headers

X-PF-Store-Idstring

Use this to specify which store you want to use (required only for account level token).

The store IDs can be retrieved with the Get basic information about stores endpoint.

Request body

urlstring required

Webhook URL that will receive store's event notifications

typesstring[] required

Array of enabled webhook event types

paramsobject

Example request

{
  "url": "​https://www.example.com/printful/webhook",
  "types": [
    "package_shipped",
    "stock_updated"
  ],
  "params": {
    "stock_updated": {
      "product_ids": [
        5,
        12
      ]
    }
  }
}

Response

OK

codeinteger

Response status code 200

Example response

{
  "code": 200,
  "result": {
    "url": "​https://www.example.com/printful/webhook",
    "types": [
      "package_shipped",
      "stock_updated"
    ],
    "params": {
      "stock_updated": {
        "product_ids": [
          5,
          12
        ]
      }
    }
  }
}