Webhooks
THIS IS A DRAFT Please be aware that this document is still under development!
The Middleware API is build on a event driven design. Therefor it offers the possibility to consume incomming events via a webhook interface. Webhooks are basic HTTP requests containing a event specific payload.
Webhooks must be individually registered. Please contact entwicklung@tasko.de to get your own Webhook IDs.
Registered Webhook Types
| Type | Comment |
|---|---|
| product | Inform the API about product data updates |
| stock | Inform the API about stock changes |
| price | Inform the API about price changes |
| order | Inform the API about order updates |
Send a Webhook
HTTP Request: POST /webhook/{id}/invoke
Request Body:
| Key | Type | Webhook Type | Comment |
|---|---|---|---|
| productNumber | string | product/stock/price | The product number of the product that changed. |
| action | string | product | The action performed on the object. Can be create, update, delete |
| action | string | order | The action performed on the object. Can be create, update, delete, complete, cancel |
| orderNumber | string | order | The order number of the order that was changed. |
| type | string | order | Only on order update webhooks. Can be invoice, item_canceled, tracking, refund |
Example:
{
"productNumber": "product-test-1",
"action": "update"
}
{
"orderNumber": "1234567890",
"action": "create"
}
{
"orderNumber": "1234567890",
"action": "update",
"type": "invoice"
}
Success Status Code: 200
Response Body:
| Key | Type | Comment |
|---|---|---|
| messsage | string | A status message |
Example:
{
"message": "success"
}