Setup
Webhooks notify your server when data changes in our Wino system, with an HTTP POST request to a URL you choose. Use them to keep another system, an online store for instance, in sync without constantly polling our Open API.
How it works
- You subscribe with the REST API below: each subscription follows one shop and sends to one URL.
- Each time something changes in that shop (a product is updated …), Wino sends a notification to your URL.
- Your server processes them and answers quickly.
The subscriptions API
- The API is at
{{baseUrl}}/webhooks/subscriptions(see Environments). - Every request needs your API key (see Authentication).
| Method | Path | Does |
|---|---|---|
GET | /webhooks/subscriptions | List your subscriptions |
GET | /webhooks/subscriptions/{id} | Get one subscription |
POST | /webhooks/subscriptions | Create a subscription |
PATCH | /webhooks/subscriptions/{id} | Change some of its properties |
PUT | /webhooks/subscriptions/{id} | Replace it (its event settings go back to the defaults) |
DELETE | /webhooks/subscriptions/{id} | Delete it |
Note
A new, changed or deleted subscription takes up to 5 minutes to apply: after a DELETE or disabled: true, notifications can still arrive for 5 minutes. That's why PATCH answers with a warning property.
Entities which publish changes:
Each subscription has settings: for each kind of data, whether you're notified. A new subscription follows the first four kinds. To turn on others, send a PATCH with their settings after creating it (see Manage subscriptions).
| Kind | On by default |
|---|---|
Product | yes |
Variant | yes |
VariantPrice | yes |
StockActivity | yes |
Shop | no |
Device | no |
Tax | no |
Price | no |
Category | no |
Customer | no |
Voucher | no |
Reward | no |
LoyaltyActivity | no |
Staff | no |
Quote | no |
DeliveryNote | no |
CreditNote | no |
Invoice | no |
RefundReceipt | no |
SalesReceipt | no |
CashFlow | no |
CashRegisterReport | no |
Supplier | no |
Order | no |
Not every change sends a notification
- A stock movement sends a
StockActivitynotification, not aVariantone: followStockActivityto track stock. - Prices set with
createOrUpdateVariantPrice, and categories created or changed through the API, don't send notifications. archiveVariant,unarchiveVariant,activateVariantanddeactivateVariantdon't send notifications either, nor do the product archive and unarchive thatarchiveVariantandunarchiveVariantmake on its product (when it archives the product's last non-archived variant, or unarchives a variant of an archived product).- A
DELIVERYorRECEPTIONmovement on an inactive variant makes it active, without aVariantnotification: read the variant'sactiveagain when you receive itsStockActivity. - Supplier orders handled in the Wino app can make a variant active and change its supplier and purchase price, without a
Variantnotification. Read the variants again when you receive theOrderorStockActivitynotification.