Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Shoppie now supports integration with webhooks.

In the Catalog setup modal, you are can now able to add a Webhook URL. Once you do thisconfigured, any changes made in the Order panel Panel will be sent to the specified URL. Every Each change includes the new updated order data , and the changelog in the request body. The issue key is sent included in the query , you can access it in 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 that contains containing the property data.

The data object

...

includes two properties: changelog and cart

...

.

  • cart is represents the new updated value of the order, which is matches 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

    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
Code Block
languagejson
{
  "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 Webhook" as a the trigger.

...

  1. Add a condition by clicking Add component. Select Component and selecting {{smart values}}.

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

      See data sent

      .

    2. Refer to the Data Sent section for more details.

...

  1. Add an action by clicking Add component

    Select

    Component and selecting Add an

    action component

    Action.

    1. In the Jira Service Management section, select “ApproveApprove/Decline request”Request.

    2. Save the rule by clicking the Turn on rule On Rule button.

...

  1. Integrate the rule with Shoppie

    1. In the rule, click on Incoming webhookWeb.

    2. Copy the URL provided.

...

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

...

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