Shoppie now supports integration with webhooks.
In the Catalog setup modal you are now able to add a Webhook URL. Once you do this, changes made in the Order panel will be sent to the URL. Every change includes the new order data, and the changelog in the request body. The issue key is sent in the query, you can access it in the issue
property. The request method is POST.
Data sent
The data sent in the request body is an object that contains the property data
.
The
data
object containschangelog
andcart
properties.cart
is the new value of the order, which is the same value stored in the issue properties.changelog
contains information about what was changed with the update of the order.changelog
is an object that containscart
anditems
, both of this properties are arrays
Example of data being sent in request body
{ "data": { "changelog": { "cart": [ { "status": { "change": "{old_cart_status} → ${new_cart_status}", "old_cart_status": "{status}", "new_cart_status": "{status}" }, "totalPrice": { "change": "decrease" OR "increase", "old_cart_status": "{status}", "new_cart_status": "{status}", } } ], "items": { "status": { [itemId]: { "change": "{old_status} → ${new_status}", "old_status": "{status}", "new_status": "{status}" } }, "quantity": { change: "number of items", old_number_of_items: "{number_of_items_before}", new_number_of_items: "{number_of_items_now}", new_items: [ [itemId]: { change: "added", item_added: { "assetId": "1", "categoryId": "f2e42251-788e-4d27-8d18-827ac9b3a081", "id": "c431983f-872a-4b62-bed8-98a21649e7ac", "status": "none", "name": "PC", "price": 0 } }, ] } } }, "cart": { "id": "f58c2baf-22cf-4a1b-9d68-7784f7d4735f", "catalogId": "04fd2fdc-1668-432e-9bc7-8630bafdacb4", "timestamp": 1734433418325, "items": [ { "assetId": "6", "categoryId": "ecc4e257-7112-4798-88f8-ed413c5a7b30", "id": "0d52b943-1208-4461-a798-4b992f43745f", "status": "completed", "name": "Dell", "price": "1999.0" }, { "assetId": "20", "categoryId": "f2e42251-788e-4d27-8d18-827ac9b3a081", "id": "c431983f-872a-4b62-bed8-98a21649e7ac", "status": "completed", "name": "PC", "price": 0 }, { "assetId": "20", "categoryId": "f2e42251-788e-4d27-8d18-827ac9b3a081", "id": "19e913af-026a-445f-b5b6-7cab26b1c509", "status": "completed", "name": "PC", "price": 0 } ], "currency": "€", "totalPrice": 1999, "status": "completed" } } }
Example: Automation for Jira
In this example we will make an automation which Approves the request once the order of Shoppie is completed.
Create a new rule, and select the Incoming webhook as a trigger.
Add a condition by clicking Add component. Select {{smart values}}.
You can access the data sent by Shoppie, by using {{webookData.changelog}} or {{webhookData.cart}}
See data sent section for more details
Add an action by clicking Add component
Select Add an action component
In the Jira Service Management section, select “Approve/Decline request”
Save the rule by clicking the Turn on rule button
Integrate the rule with Shoppie
In the rule, click on Incoming webhook
Copy the URL provided
Add the URL in the Catalog setup in Shoppie and click on Save.
The setup is now complete, when the Shoppie order is completed, the request will automatically be Approved.