Skip to end of banner
Go to start of banner

Receive changes made in Shoppie Order Panel

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

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 contains changelog and cart 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 contains cart and items, 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.

  1. Create a new rule, and select the Incoming webhook as a trigger.

Screenshot 2024-12-18 at 12.05.43.png
  1. Add a condition by clicking Add component. Select {{smart values}}.

    1. You can access the data sent by Shoppie, by using {{webookData.changelog}} or {{webhookData.cart}}

      1. See data sent section for more details

Screenshot 2024-12-18 at 12.15.30.png
  1. Add an action by clicking Add component

    1. Select Add an action component

    2. In the Jira Service Management section, select “Approve/Decline request”

    3. Save the rule by clicking the Turn on rule button

Screenshot 2024-12-18 at 12.24.59.png
  1. Integrate the rule with Shoppie

    1. In the rule, click on Incoming webhook

    2. Copy the URL provided

Screenshot 2024-12-18 at 12.07.25.png

  1. Add the URL in the Catalog setup in Shoppie and click on Save.

Screenshot 2024-12-18 at 12.09.25.pngScreenshot 2024-12-18 at 12.10.36.png

The setup is now complete, when the Shoppie order is completed, the request will automatically be Approved.

  • No labels