Automation: Receive changes made in Shoppie order panel
Shoppie now supports integration with webhooks.
In the Catalog setup modal, you can now add a Webhook URL. Once configured, any changes made in the Order Panel will be sent to the specified URL. Each change includes the updated order data and the changelog in the request body. The issue key is included in the query and can be accessed via the issue property. The request method used is POST.
Data sent
The data sent in the request body is an object containing the property data
.
The data
object includes two properties: changelog
and cart
.
cart
represents the updated value of the order, which matches the value stored in the issue properties.changelog
provides details about the changes made during the order update.
The changelog
itself is an object containing two properties: cart
and items
, both of which 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 "Incoming Webhook" as the trigger.
Add a condition by clicking Add Component and selecting {{smart values}}.
You can access the data sent by Shoppie using {{webhookData.changelog}} or {{webhookData.cart}}.
Refer to the Data Sent section for more details.
Add an action by clicking Add Component and selecting Add an Action.
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 Web.
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 be automatically approved.